← Projects · MCP Protocol · Open Source

Lumenore Analytics MCP Server

FastMCP · Python · asyncio · aiohttp · Streamable HTTP · Pydantic · Docker

An MCP server that makes a BI and analytics platform accessible to any MCP-compatible AI assistant, so users can query analytics in natural language instead of copying data into a chat window. Published open source under the Lumenore Platform organisation.

What it exposes

Seven analytics tools: natural-language query to data (with a streamed response), trend, prediction, correlation, outlier, change and Pareto analysis. Alongside them are two metadata helpers for dataset discovery and column-level schema, and a health check. Tool parameters are typed with Pydantic and validated before any backend call.

My role

I built the server: framework choice, the typed tool surface, the async HTTP client with connection pooling, authentication handling, streamed responses, and the Docker packaging.

Tech stack

FastMCPMCP ProtocolPythonasyncioaiohttpStreamable HTTPPydanticDocker

Key design decisions & trade-offs

  • asyncio and aiohttp over threads. Every tool is an I/O call to the analytics backend, so a single event loop with a pooled async HTTP client fits better than a thread per request.
  • Connection pooling. One reused aiohttp session with a TCPConnector, connection limits, DNS caching and configured timeouts avoids a new TCP and TLS handshake on every call, with cleanup on shutdown.
  • FastMCP over the raw MCP SDK. Tool schemas are generated from type hints, which cuts boilerplate across the tool surface and gives Streamable HTTP transport out of the box.
  • Thin server, heavy backend. All analytics computation stays in the platform; the server only validates, authenticates, forwards and returns results.
  • Authentication. A middleware accepts the caller’s authorization header when present and falls back to the server’s configured credentials otherwise, erroring only when neither exists. The backend client logs in with client credentials, receives a JWT in a cookie, and reuses it.

Known limitations

In the published build, backend credentials are configured at server level, so all callers share one identity and the caller’s own authorization header is not forwarded to the backend. The client-credential login path is synchronous. Next steps would be forwarding each caller’s own credentials to the backend, an async login path, and retries with backoff.

Results

7 analytics tools plus two metadata helpers · connection-pooled async client · Streamable HTTP · MIT-licensed, published open source

Employer and client work is described at a general level. Client identities, internal figures and confidential details are omitted.