Quickstart
Install
Section titled “Install”uv add lexigram-ai-mcplexigram-ai-mcp depends on lexigram and lexigram-contracts (installed automatically).
Minimal MCP Server
Section titled “Minimal MCP Server”import asyncio
from lexigram import Application, LexigramConfigfrom lexigram.ai.mcp import MCPModule
async def main() -> None: config = LexigramConfig.from_yaml("application.yaml") app = Application(name="my-mcp-app", config=config) app.add_module(MCPModule.configure()) await app.start()
# MCPServer is now wired and ready print("MCP server is running")
await app.stop()
asyncio.run(main())With application.yaml:
ai_mcp: host: "0.0.0.0" port: 8080 path: "/mcp"What Just Happened
Section titled “What Just Happened”MCPModule.configure()creates aDynamicModulewith anMCPProvider.Application.boot()starts the provider lifecycle:- register —
MCPConfigis bound in the container. - boot — handlers, connectors, transports, and the
MCPServerare wired.
- register —
- The server listens for JSON-RPC messages over HTTP+SSE or stdio.
Next Steps
Section titled “Next Steps”- Guide — mental model, tools/resources/prompts, client usage
- How-Tos — task-oriented recipes
- Configuration — all config keys and env-var overrides