"""{{ name }} — MCP server.

Built with vivesca conventions:
- Structured output (Pydantic return types → outputSchema)
- Tool annotations (readOnlyHint, destructiveHint)
- Service-layer separation (tools are thin wrappers)
"""

from pathlib import Path

from fastmcp import FastMCP
from fastmcp.server.providers import FileSystemProvider

_project_root = Path(__file__).resolve().parent.parent.parent


def create_server() -> FastMCP:
    """Build and return the {{ name }} FastMCP server."""
    mcp = FastMCP(
        "{{ name }}",
        instructions="{{ description }}",
        providers=[
            FileSystemProvider(_project_root / "src" / "{{ module }}" / "tools"),
            FileSystemProvider(_project_root / "src" / "{{ module }}" / "resources"),
            FileSystemProvider(_project_root / "src" / "{{ module }}" / "prompts"),
        ],
    )
    return mcp


mcp = create_server()


def main():
    """Entry point for {{ name }} CLI (stdio transport)."""
    mcp.run(transport="stdio")


if __name__ == "__main__":
    main()