Build a clinical trial finder agent with MCP
Call Clareo's free, read-only clinical trials MCP server from code: the request shape, both tools, rate limits, errors and the privacy rule for anything patient-facing.

One POST, no key. That is all it takes to search clinical trials from your own code through Clareo's server at https://www.clareohealth.com/mcp. The data is public registry data from ClinicalTrials.gov, and it is not medical advice.
The call in Python
The server is stateless, so a plain tool call works without the initialize handshake. A proper MCP client does the handshake for you. These four lines make a search and read the results. They use the requests library:
body = {"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "search_clinical_trials", "arguments": {"query": "asthma in Boston", "recruitingOnly": True, "limit": 3}}}r = requests.post("https://www.clareohealth.com/mcp", json=body, headers={"accept": "application/json, text/event-stream"}, timeout=20)results = r.json()["result"]["structuredContent"]["results"]for t in results: print(t["nctId"], t["overallStatus"], t["briefTitle"])
To read one trial in full, send the same body shape with "name": "get_clinical_trial" and "arguments": {"nctId": "NCT07330778"}. The record is under ["result"]["structuredContent"]["trial"], and the eligibility text is in its eligibilityCriteria field.
MCP or REST
The same data comes two ways. Use MCP when a language model chooses the calls. Use REST when your own code does.
- MCP: connect an MCP client, or send JSON-RPC over POST as above. The model sees two tools and picks.
- REST: two GET endpoints described by an OpenAPI 3.1 file at
https://www.clareohealth.com/developers/openapi.json. Search isGET /api/clinical-trials/search?q=asthma+in+Boston&status=RECRUITING&limit=10, and one trial isGET /api/clinical-trials/NCT07330778. The developers page has the rest.
What the server reports about itself
The initialize reply names the server clareo-clinical-trials, version 1.0.0, on protocol version 2025-06-18. It also supports 2025-03-26 and 2024-11-05. The transport is Streamable HTTP with stateless JSON replies, and it answers POST only. A server card sits at /.well-known/mcp/server-card.json.
The server's own instructions tell the model to search by condition and place, not to send a person's health details, and not to give medical advice. Repeat that in your prompts.
Tools
search_clinical_trials takes these arguments:
query: a string, required, 1 to 200 characters. A condition, treatment or sponsor, optionally with a place. Put "in" before the place.recruitingOnly: a boolean. Limits results to trials that are recruiting or enrolling by invitation.page: an integer from 1 to 50, default 1.limit: an integer from 1 to 20, default 10.
get_clinical_trial takes nctId, required: "NCT" plus eight digits.
Both tools are marked read-only, idempotent and non-destructive. Place matching is loose, so a result can come back without a site in the city you named. Check locations before you show it as nearby. Search results are short records, and some fields, such as the lead sponsor and study type, can come back empty. The eligibility text, the healthy-volunteer flag, the enrollment count and the dates come only from get_clinical_trial, so call it for any trial you show in detail.
Wiring it into an agent
- Give the model the two tool schemas, or point an MCP client at the server.
- In the system prompt: search by condition and place only, never ask the user for personal health details, never say whether someone qualifies, and always show the registry link.
- After a search, call
get_clinical_trialfor the trial the user picks. - Show
url, the plain-language Clareo page, andregistryUrl, the ClinicalTrials.gov record, with every result. - Add one line to the interface: trial information is not medical advice, and who qualifies is up to the study team.
Limits and errors
Each IP address gets 60 requests a minute. A refused REST request returns a 429 with Retry-After and rate-limit headers. REST errors are JSON shaped like {"error": "...", "code": "..."}, with codes invalid_request (400), not_found (404), rate_limited (429) and upstream_unavailable (500). An MCP lookup for an NCT ID that doesn't exist comes back as a tool result flagged isError. A search with no match returns an empty list.
What it leaves out
Two tools means gaps. The server doesn't return posted results, count studies, compare trials or run a radius search around a place. If you need those, call the registry's own API next to this server, or build a comparison in your agent from two get_clinical_trial calls. Other ClinicalTrials.gov MCP servers exist, with different tools, so check which one fits what you are building.
If your agent talks to patients
Don't log or store a user's health details, and don't ask for them. Search on condition and place. Tell users up front not to type personal information into the chat.
