UNPKG

remcode

Version:

Turn your AI assistant into a codebase expert. Intelligent code analysis, semantic search, and software engineering guidance through MCP integration.

27 lines (26 loc) 872 B
/** * MCP-Compatible SSE Handler * * Implements proper JSON-RPC 2.0 over Server-Sent Events for MCP Inspector compatibility. * FIXED: Parameter parsing for MCP Inspector integration. */ import { Request, Response } from 'express'; export declare class MCPSSEHandler { private activeConnections; private connectionCounter; handleSSEConnection(req: Request, res: Response): void; handleMCPMessage(req: Request, res: Response, toolHandlers: any): Promise<void>; private routeMCPMethod; private getAllToolDefinitions; /** * FIXED: Handle tool call with proper MCP Inspector parameter parsing */ private handleToolCall; /** * Helper to call handler methods with proper error handling */ private callHandlerMethod; private sendSSEMessage; private broadcastToSSEClients; closeAllConnections(): void; }