endfield-mcp
Version:
MCP Server for Arknights: Endfield (TypeScript / stdio + Streamable HTTP)
27 lines (26 loc) • 1.19 kB
TypeScript
/**
* Stateless Streamable HTTP transport — for remote / shared deployment.
*
* Uses the SDK's WebStandard variant (standard Request → Response) which
* pairs natively with Bun.serve. Stateless mode (sessionIdGenerator:
* undefined) means no session tracking — every request is handled
* independently, which is ideal for "simple API-style servers" per the
* SDK docs and lets any number of clients hit the same endpoint without
* session-eviction concerns.
*
* This is the single-binary equivalent of what PRTS-MCP's ts/ achieves
* with express + session state. We skip session state on purpose: the
* Endfield MCP has no per-session state (no cursors, no partial sync),
* so stateless is strictly simpler with no capability loss.
*
* Endpoints:
* POST /mcp — MCP JSON-RPC over Streamable HTTP
* GET /mcp — SSE stream (stateless mode returns 405; clients use POST)
* GET /health — liveness probe
*/
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
export interface HttpOptions {
port: number;
host: string;
}
export declare function runHttp(serverFactory: () => McpServer, opts: HttpOptions): Promise<void>;