UNPKG

atlas-mcp-server

Version:

ATLAS (Adaptive Task & Logic Automation System): An MCP server enabling LLM agents to manage projects, tasks, and knowledge via a Neo4j-backed, three-tier architecture. Facilitates complex workflow automation and project management through LLM Agents.

25 lines (24 loc) 1.48 kB
/** * @fileoverview Handles the setup and management of the Streamable HTTP MCP transport. * Implements the MCP Specification 2025-03-26 for Streamable HTTP. * This includes creating an Express server, configuring middleware (CORS, Authentication), * defining request routing for the single MCP endpoint (POST/GET/DELETE), * managing server-side sessions, handling Server-Sent Events (SSE) for streaming, * and binding to a network port with retry logic for port conflicts. * * Specification Reference: * https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-03-26/basic/transports.mdx#streamable-http * @module src/mcp-server/transports/httpTransport */ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import http from "http"; import { RequestContext } from "../../utils/index.js"; /** * Sets up and starts the Streamable HTTP transport layer for the MCP server. * * @param createServerInstanceFn - An asynchronous factory function that returns a new `McpServer` instance. * @param parentContext - Logging context from the main server startup process. * @returns A promise that resolves with the Node.js `http.Server` instance when the HTTP server is successfully listening. * @throws {Error} If the server fails to start after all port retries. */ export declare function startHttpTransport(createServerInstanceFn: () => Promise<McpServer>, parentContext: RequestContext): Promise<http.Server>;