Clinical Trials MCP Agent
Click on "Install 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., "@Clinical Trials MCP Agentfind active Phase 2 trials for breast cancer"
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.
Enterprise Clinical Trials Agent (MCP Architecture)
This project implements a robust Retrieval-Augmented Generation (RAG) agent using the Model Context Protocol (MCP) standard. It acts as an integration middleware that fetches real-world clinical data, stores it in hybrid databases (SQL + Vector), and exposes it to LLM clients for autonomous reasoning.
🚀 Key Features
REST API Integration: Implements a custom ETL pipeline (
etl_pipeline.py) that consumes the ClinicalTrials.gov API with pagination and error handling.Hybrid Data Architecture:
Structured (SQL): Uses SQLite for high-precision filtering (Trial Status, Phase, Conditions).
Unstructured (Vector DB): Uses ChromaDB with
sentence-transformersfor semantic search within medical protocols.
MCP Server: A centralized integration server (
mcp_server.py) that standardizes tools for any AI client (Claude Desktop, Cursor, IDEs).
Related MCP server: ClinicalTrials.gov MCP Server
📸 Autonomous Agent Demo
1. Backend Verification (MCP Inspector)
The server exposes structured SQL tools and Vector RAG tools via standard JSON-RPC.

2. Structured Reasoning (SQL Tool)
User asks for "Diabetes trials". The Agent autonomously selects the SQL tool to filter by disease.

3. Semantic Reasoning (RAG Tool)
User asks for specific "kidney function exclusion criteria". The Agent switches tools to perform vector search on the protocol text.

🛠️ Installation
Clone the repository:
git clone https://github.com/tonih23/clinical-trials-mcp-agent.git
cd clinical-trials-mcp-agentSet up the environment:
python -m venv venv
Windows:
venv\Scripts\activate
Mac/Linux:
source venv/bin/activate
pip install -r requirements.txt
🔄 Usage Workflow
1. Data Ingestion (ETL)
Run the pipeline to fetch live data from the API and populate local databases. This demonstrates the REST integration pattern:
python etl_pipeline.pyThis will fetch the latest trials related to Oncology, Cardiology, and Diabetes.
2. Run the MCP Server (Dev Mode)
Start the integration server to test connections:
mcp dev mcp_server.py3. Connect to LLM Client (Production-like)
To use this with an MCP-compliant client (like Claude Desktop), add this configuration to your claude_desktop_config.json:
Note: Replace the path below with the absolute path to your project folder.
On Windows, use double backslashes (\\).
{
"mcpServers": {
"clinical-agent": {
"command": "python",
"args": ["C:\\Users\\YOUR_USER\\Desktop\\clinical-trials-mcp-agent\\mcp_server.py"]
}
}
}🧠 Example Queries
Once connected, the Agent can perform autonomous tool calling:
Structured Query (SQL)
"Find active Phase 3 trials for Diabetes."
(The LLM will automatically route this to search_trials_sql.)
Semantic Query (RAG)
"For trial NCT00528879, what are the specific exclusion criteria regarding kidney function?"
(The LLM will automatically route this to get_protocol_details_rag.)
Developed as a Proof of Concept for Enterprise AI Integration.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityBmaintenanceEmpowers AI agents with direct access to the official ClinicalTrials.gov database, enabling programmatic searching, retrieval, and analysis of clinical study data through a Model Context Protocol interface.71,14987Apache 2.0
- Flicense-qualityDmaintenanceEnables 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
- Flicense-qualityDmaintenanceEnables AI assistants to search and access clinical trial data from ClinicalTrials.gov, including searching trials by keywords, retrieving detailed trial metadata by NCT ID, and managing trial data in CSV format for research and analysis.16
- AlicenseBqualityDmaintenanceProvides programmatic access to ClinicalTrials.gov API with 18 specialized tools for searching, analyzing, and retrieving detailed information about 400,000+ clinical trials worldwide, including filtering by condition, location, phase, sponsor, eligibility criteria, and outcomes.17183MIT
Related MCP Connectors
Search ClinicalTrials.gov — find studies, retrieve results, match patients to eligible trials.
ClinicalTrials MCP — wraps ClinicalTrials.gov API v2 (free, no auth)
NIH clinical trials and FDA adverse event reports. 4 MCP tools for health research.
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tonih23/clinical-trials-mcp-agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server