Skip to content

Application

obsidian_palace.app

FastAPI application — serves MCP over SSE + Streamable HTTP and health endpoints.

The MCP server (with OAuth) runs as a Starlette sub-application mounted under the root, serving both SSE (/sse) and Streamable HTTP (/mcp) transports. Health and docs endpoints are served by FastAPI directly.

logger = logging.getLogger(__name__) module-attribute

app = FastAPI(title='ObsidianPalace', version=__version__, description='MCP server bridging Obsidian vaults with AI via semantic search and bidirectional sync. Exposes vault tools over SSE and Streamable HTTP transports for Claude Desktop, OpenCode, and other MCP clients.', docs_url='/docs', redoc_url='/redoc', openapi_url='/openapi.json', lifespan=lifespan) module-attribute

mcp_app = create_mcp_app() module-attribute

lifespan(app: FastAPI) -> AsyncIterator[None] async

Application startup and shutdown lifecycle.

Vault indexing runs as a background task so the server starts accepting requests immediately. Search may be empty until the initial index completes.

health() -> dict[str, str] async

Health check endpoint for GCE instance monitoring.