How doitintl/doit-mcp-server works
Project type and purpose
• This is a TypeScript-based Node.js microservice (the “DoiT MCP Server”) that implements the Model Context Protocol (MCP) to expose DoiT platform data to LLM clients (e.g. Claude).
• The repo is structured as a small monorepo:
• A core “tools” library (root/src/tools) that implements individual API calls (incidents, anomalies, reports, invoices, etc.)
• The MCP server app (doit-mcp-server/) that wires the library into an SSE/HTTP server, serving static assets and handling STDIO mode for local use.
File structure
• Top level: CI config (.github/), Dockerfile, license, readme.
• Root package.json + tsconfig.json with a “src/” containing:
• index.ts – entry point for the core tools library or CLI shim
• tools/ – one file per API tool (allocations.ts, anomalies.ts, …)
• utils/ – support modules (filterFields, prompts, toolsHandler)
• Sub-project “doit-mcp-server/”:
• src/app.ts – sets up HTTP/SSE endpoints and static file routes
• src/index.ts – entry script, reads env, starts server or STDIO mode
• src/utils.ts – helper functions for message parsing, streaming
• static/ – bundled frontend/static files under “.doit”
• wrangler.jsonc – config for Cloudflare Workers deployment
Key insights from README
• The MCP server exposes an SSE endpoint at /sse for LLM clients.
• It requires DOIT_API_KEY and optional CUSTOMER_CONTEXT.
• Clients (Claude Desktop, Cursor) invoke it via STDIO or TCP/HTTP.
• It supports a fixed set of “tools” (API calls) which it dispatches based on natural-language prompts.
• Labels: each component (Client, SSE Listener, STDIO Adapter, Router, Tool Modules, DoiT API)
• Client → SSE Listener / STDIO Adapter
• SSE Listener → Router → Tool Module → DoiT API
• DoiT API → Tool Module → Router → Client