MCP Overview
MCP (Model Context Protocol) extends the agent's capabilities with external tools. The system consists of a central gateway service and multiple tool servers, each exposing one or more tools.
How It Works
- Agent service receives a request with a list of allowed tool names
- Agent service calls
GET /mcp/v1/tools/list-toolson the MCP gateway to discover available tools - Agent service filters tools to only those allowed in the request
- Tool schemas are sent to the LLM as part of the completion request
- When the LLM decides to call a tool, agent service calls
POST /mcp/v1/tools/call-toolon the gateway - The gateway routes the call to the correct tool server
- The tool server executes and returns results
- Results are fed back into the LLM conversation
Architecture
agent-service
|
v
mcp-client-service (gateway, port 8000)
|
+---> mcp-rag-tool (port 3002)
+---> mcp-spreadsheet
+---> mcp-web-search
+---> mcp-veo2
+---> mcp-code-execute-python (port 8000)
+---> mcp-atlassian
+---> mcp-ui-components (port 3004)
Tool Server Summary
| Server | Tool(s) | Language | Description |
|---|---|---|---|
| mcp-rag-tool | search_documents | TypeScript | Semantic search through uploaded documents |
| mcp-spreadsheet | analyze_excel_spreadsheet | TypeScript | Analyze CSV/Excel with natural language |
| mcp-web-search | web_search | TypeScript | Web search, extraction, crawling |
| mcp-veo2 | generateVideoFromText, generateImage | TypeScript | Video/image generation (Google Veo2/Imagen) |
| mcp-code-execute-python | run_python_code | TypeScript/Deno | Sandboxed Python execution (Pyodide) |
| mcp-atlassian | Many (Jira + Confluence) | Python | Full Atlassian integration |
| mcp-ui-components | ui_render, show_weather, etc. | TypeScript | Interactive UI in chat |
Authentication
The gateway authenticates requests using the x-jeen-mcp-service-secret header. This secret is shared between agent-service and mcp-client-service.
Configuration
In development, tool server endpoints are configured in config.json. In production, configurations are loaded from PostgreSQL.
SDK
All TypeScript MCP servers use a vendored copy of @modelcontextprotocol/sdk v1.23.0-beta.0. Transports supported: stdio, SSE, Streamable HTTP.