Skip to main content
Glama
ARCHITECTURE.md1.11 kB
# Architecture Modules - `ExpressMCP`: Facade to init, mount, run standalone, list tools. - `RouteIntrospector`: Extract routes/methods/middlewares/handlers from `express` app. - `InMemoryDispatcher`: Synthetic `req`/`res` to execute the same middleware chain and handler without HTTP. - `SchemaResolver`: Build tool schemas from OpenAPI v3 or per-route annotations; fallback to permissive object. - `McpServer`: Tool registry plus HTTP gateway `/mcp/tools` and `/mcp/invoke`. Flow 1. `init()`: discover routes → build tool metadata (name/title/description/schemas). 2. `mount('/mcp')`: expose gateway for tool discovery and invocation. 3. Invocation: map toolName → dispatch(method, path, args) → return response body and status. Parity with FastAPI-MCP - Minimal setup in existing app. - Preserves docs/schemas where available. - Uses in-process dispatch for speed and fidelity (similar to ASGI transport claim in FastAPI-MCP). Notes - For multipart/files, add specialized handling in `InMemoryDispatcher` and `SchemaResolver`. - For OpenAPI, supply your spec via `openapi` option for best schemas.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bowen31337/expressjs_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server