feat(gateway): add MCP server endpoint with streamable HTTP transport (#52)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful

- Install @modelcontextprotocol/sdk and zod in apps/gateway
- Create McpModule with McpService and controller at /mcp endpoint
- Implement stateful streamable HTTP transport (MCP spec 2025-03-26)
- Expose 14 tools: brain (projects/tasks/missions), memory, coord
- Require valid BetterAuth session for all MCP connections
- Per-session McpServer + StreamableHTTPServerTransport instances
- Follows same Fastify onRequest hook pattern as auth handler
- Add mcp.dto.ts with McpToolDescriptor and McpServerInfo interfaces

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-15 13:04:27 -05:00
parent a8dc498794
commit e2de76ca9f
9 changed files with 1196 additions and 11 deletions

View File

@@ -0,0 +1 @@
export const MCP_SERVICE = 'MCP_SERVICE';