Skip to main content
Glama
HuaiyuZhang

ClinicalTrials.gov Natural Language API Server

by HuaiyuZhang

ClinicalTrials.gov 自然语言 API 的 MCP 服务器

此 MCP(模型控制协议)服务器允许您使用自然语言查询 ClinicalTrials.gov。它使用 OpenAI 的 GPT 模型将您的查询转换为 API 参数并返回结构化结果。

特征

  • 接受自然语言查询(例如,“向我展示加拿大已完成的 3 期糖尿病试验”)

  • 使用 OpenAI API 解析并映射到 ClinicalTrials.gov API 参数

  • 返回解析后的参数和结果

Related MCP server: AACT Clinical Trials MCP Server

要求

  • Python 3.8+

  • requirements.txt中的依赖项

  • OpenAI API 密钥(设置为OPENAI_API_KEY环境变量)

运行服务器

  1. 安装依赖项:

    pip install -r requirements.txt
  2. 设置您的 OpenAI API 密钥:

    export OPENAI_API_KEY=sk-...
  3. 启动服务器:

    uvicorn server:app --reload

用法

cURL 示例

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 示例

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())

什么是 MCP?

MCP(模型控制协议)是一种构建 AI 驱动 API 的模式,它充当自然语言 API 和结构化 API 之间的控制层。该服务器使用 LLM 来解释用户意图并将其映射到 API 调用,从而可以通过普通语言访问复杂数据。

定制

  • 您可以在server.py中修改提示或添加更多参数模式以支持更多查询类型或API。


如有疑问或需要改进,请提出问题或 PR!

-
security - not tested
A
license - permissive license
-
quality - not tested

Resources

Looking for Admin?

Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.

Latest Blog Posts

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/HuaiyuZhang/clinical-trial-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server