ClinicalTrials.gov Natural Language API Server
Uses OpenAI's GPT models to translate natural language queries into structured API parameters for ClinicalTrials.gov
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ClinicalTrials.gov Natural Language API Serverfind phase 2 breast cancer trials in Europe with results"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server for ClinicalTrials.gov Natural Language API
This MCP (Model Control Protocol) server allows you to query ClinicalTrials.gov using natural language. It uses OpenAI's GPT models to translate your query into API parameters and returns structured results.
Features
Accepts natural language queries (e.g., "Show me completed phase 3 diabetes trials in Canada")
Uses OpenAI API to parse and map to ClinicalTrials.gov API parameters
Returns both the parsed parameters and the results
Related MCP server: Clinical Trials MCP Server
Requirements
Python 3.8+
Dependencies in
requirements.txtOpenAI API key (set as
OPENAI_API_KEYenvironment variable)
Running the Server
Install dependencies:
pip install -r requirements.txtSet your OpenAI API key:
export OPENAI_API_KEY=sk-...Start the server:
uvicorn server:app --reload
Usage
cURL Example
curl -X POST "http://127.0.0.1:8000/query" \
-H "Content-Type: application/json" \
-d '{"query": "Show me completed phase 3 diabetes trials in Canada"}'Python Example
import requests
query = "Show me completed phase 3 diabetes trials in Canada"
response = requests.post(
"http://127.0.0.1:8000/query",
json={"query": query}
)
print(response.json())What is MCP?
MCP (Model Control Protocol) is a pattern for building AI-driven APIs that act as a control layer between natural language and structured APIs. This server uses an LLM to interpret user intent and map it to API calls, making complex data accessible via plain language.
Customization
You can modify the prompt or add more parameter schema in
server.pyto support more query types or APIs.
For questions or improvements, open an issue or PR!
This server cannot be deployed
Maintenance
Related MCP Connectors
Clinical trial search and status from ClinicalTrials.gov
Provide structured access to ClinicalTrials.gov data for searching, retrieving, and analyzing clin…
ClinicalTrials MCP — wraps ClinicalTrials.gov API v2 (free, no auth)
Search ClinicalTrials.gov — find studies, retrieve results, match patients to eligible trials.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables searching and retrieving information from the ClinicalTrials.gov database of over 400,000 clinical studies, including trial details, eligibility criteria, locations, and results across 220+ countries.5-
- AlicenseBqualityDmaintenanceEnables searching and querying clinical trials from ClinicalTrials.gov with intelligent filtering for recruiting studies, geographic search, and detailed trial information including contacts and eligibility criteria.34 npm6MIT
- AlicenseAqualityFmaintenanceEnables conversational access to 400,000+ clinical trials on ClinicalTrials.gov, allowing users to search, compare, and retrieve trial details using plain English through MCP-compatible clients like Cursor and Claude Desktop.53MIT
- AlicenseNot gradedqualityCmaintenanceWraps the ClinicalTrials.gov API v2 to enable querying clinical trials data through natural language.3 npmMIT