@cyanheads/pubmed-mcp-server
Version:
Production-ready PubMed Model Context Protocol (MCP) server that empowers AI agents and research tools with comprehensive access to PubMed's article database. Enables advanced, automated LLM workflows for searching, retrieving, analyzing, and visualizing
27 lines • 1.18 kB
TypeScript
/**
* @fileoverview Hono middleware for handling MCP transport logic.
* This middleware encapsulates the logic for processing MCP requests,
* delegating to the appropriate transport manager, and preparing the
* response for Hono to send.
* @module src/mcp-server/transports/http/mcpTransportMiddleware
*/
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { MiddlewareHandler } from "hono";
import { TransportManager, TransportResponse } from "../core/transportTypes.js";
import { HonoNodeBindings } from "./httpTypes.js";
/**
* Creates a Hono middleware for handling MCP POST requests.
* @param transportManager - The main transport manager (usually stateful).
* @param createServerInstanceFn - Function to create an McpServer instance.
* @returns A Hono middleware function.
*/
type McpMiddlewareEnv = {
Variables: {
mcpResponse: TransportResponse;
};
};
export declare const mcpTransportMiddleware: (transportManager: TransportManager, createServerInstanceFn: () => Promise<McpServer>) => MiddlewareHandler<McpMiddlewareEnv & {
Bindings: HonoNodeBindings;
}>;
export {};
//# sourceMappingURL=mcpTransportMiddleware.d.ts.map