import { ConfigService } from "@nestjs/config"; import { FastifyReply, FastifyRequest } from "fastify"; import { ClsService } from "nestjs-cls"; import { UserModulesRepository } from "../../agents/graph/repositories/user-modules.repository"; import { McpServerFactory } from "../services/mcp.server.factory"; /** * MCP (Model Context Protocol) endpoint — stateless Streamable HTTP. * * Each `POST /mcp` request is authenticated by the existing OAuthTokenGuard * (which populates CLS `userId`/`companyId`), then handed to a fresh per-request * MCP Server + StreamableHTTPServerTransport pair (`sessionIdGenerator: * undefined` — stateless mode, no session tracking). GET/DELETE are rejected * with 405: stateless servers expose no SSE notification channel and no * session to terminate. * * Uses `@Res()` with raw reply writing (the SDK transport writes directly to * `res.raw`), which opts this handler out of Nest response serialization — * the MCP wire format is JSON-RPC, not JSON:API, matching how the OAuth * controllers speak their own RFC-mandated wire formats. */ export declare class McpController { private readonly factory; private readonly cls; private readonly userModules; private readonly configService; constructor(factory: McpServerFactory, cls: ClsService, userModules: UserModulesRepository, configService: ConfigService); /** Handles one stateless MCP Streamable-HTTP request (initialize, tools/list, tools/call, ...). */ handle(req: FastifyRequest, res: FastifyReply): Promise; /** Stateless server: no SSE notification stream is offered. */ rejectGet(): never; /** Stateless server: there is no session to terminate. */ rejectDelete(): never; } //# sourceMappingURL=mcp.controller.d.ts.map