Sets up HTTP transport for an existing MCP server
Low-level function that handles HTTP server creation, router mounting, and port binding. Path is always '/mcp' per MCP convention.
The MCP server instance to connect transport to
Configuration for HTTP transport
HTTP server instance
const mcpServer = new McpServer({ name: 'my-server', version: '1.0.0' });const { close, httpServer } = await connectHttp(mcpServer, { logger, app, port: 3000}); Copy
const mcpServer = new McpServer({ name: 'my-server', version: '1.0.0' });const { close, httpServer } = await connectHttp(mcpServer, { logger, app, port: 3000});
Sets up HTTP transport for an existing MCP server
Low-level function that handles HTTP server creation, router mounting, and port binding. Path is always '/mcp' per MCP convention.