UNPKG

clinicaltrialsgov-mcp-server

Version:

ClinicalTrials.gov Model Context Protocol (MCP) Server that provides a suite of tools for interacting with the official ClinicalTrials.gov v2 API. Enables AI agents and LLMs to programmatically search, retrieve, and analyze clinical trial data.

27 lines (26 loc) 1.13 kB
/** * @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 {};