The `clinicaltrialsgov-mcp-server` package offers a robust Model-Context-Protocol (MCP) server solution for interacting with the ClinicalTrials.gov v2 API. Its core functionalities include comprehensive search capabilities for clinical trials, detailed retrieval of study information and results, and advanced patient-to-trial matching based on specified eligibility criteria. The package is currently stable at version 2.3.4, with a release cadence likely driven by API updates or feature enhancements. As a TypeScript-first server, it provides strong type safety and is designed to serve as a backend component, particularly useful for AI agents or LLMs that require structured, real-time access to clinical trial data. Key differentiators include its specialized focus on the ClinicalTrials.gov ecosystem and its MCP adherence, abstracting away much of the API complexity for developers building patient matching and research applications, offering a higher-level interface than direct API interaction. The server can run locally via HTTP or stdio, and is deployable to platforms like Cloudflare Workers.
npm install clinicaltrialsgov-mcp-serverVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize and start the `clinicaltrialsgov-mcp-server` locally, handling port configuration and API key loading from environment variables. It also shows basic error and ready event handling.
Ensure your environment uses Node.js `>=22.0.0` or Bun `>=1.2.0`. Update your runtime or use a version manager like `nvm` or `fnm`.
Set the `CLINICALTRIALS_API_KEY` environment variable with your valid API key before starting the server, or pass it explicitly in the server configuration. Refer to ClinicalTrials.gov developer documentation for key acquisition.
Consult the `CHANGELOG.md` or GitHub release notes for specific breaking changes between major versions. Update your configuration and tool definitions to align with the latest MCP specification and server API.
Review the package's documentation or the `tools` directory in the source code to understand the available MCP tools and their usage. Clients (e.g., LLMs) need to be configured to correctly call these tools.
Convert your consuming module to ES Modules by using `import` statements and ensuring your `package.json` has `"type": "module"` or files end with `.mjs`.
Change the `PORT` environment variable or the `port` configuration option to an available port, or terminate the process currently using that port.
Ensure the `CLINICALTRIALS_API_KEY` environment variable is correctly set and is a valid API key. Verify that server initialization is complete before attempting to use its tools or endpoints.
No dependency data recorded yet.