MCP Server for CDISC Library API - Clinical Data Standards Access
Project description
CDISC Library MCP Server
MCP Server for CDISC Library API - 提供对临床数据标准的完整访问。
功能特性
- 🔧 15 个 MCP Tools - 覆盖 SDTM, ADaM, CDASH, CT 等标准
- 📦 MCP Resources - 产品列表、API 信息
- 💬 MCP Prompts - 引导式标准探索
- 🗄️ 持久化缓存 - 减少 API 调用,加速访问
- 🇨🇳 中文错误提示 - 友好的错误消息
安装
pip install cdisc-library-mcp
配置
1. 获取 API Key
- 访问 CDISC Library API Portal
- 登录或注册 CDISC 账号
- 在 Profile 页面 获取 API Key
2. 配置方式
方式一:使用 .env 文件(推荐)
在项目根目录创建 .env 文件:
# 复制模板
cp .env.example .env
# 编辑文件,填入你的 API Key
CDISC_API_KEY=your-api-key-here
Server 启动时会自动加载 .env 文件。
方式二:MCP 客户端配置
在 Claude Desktop 配置文件中添加:
{
"mcpServers": {
"cdisc-library": {
"command": "python",
"args": ["-m", "cdisc_mcp.server"],
"env": {
"CDISC_API_KEY": "your-api-key-here"
}
}
}
}
配置文件位置:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
可用工具
标准查询
| 工具 | 描述 |
|---|---|
get_products |
获取所有 CDISC 产品列表 |
get_products_by_group |
按分组获取产品列表(如 sdtm, adam, cdash) |
get_standard |
获取标准产品信息 |
get_classes |
获取标准的类列表 |
数据集操作
| 工具 | 描述 |
|---|---|
get_datasets |
获取数据集列表 |
get_dataset |
获取数据集详情 |
get_dataset_variables |
获取变量列表 |
get_variable |
获取变量详情 |
控制术语
| 工具 | 描述 |
|---|---|
get_ct_packages |
获取 CT 包列表 |
get_ct_package |
获取 CT 包详情 |
get_codelists |
获取编码列表 |
get_codelist |
获取编码详情 |
get_codelist_terms |
获取术语列表 |
get_term |
获取术语详情 |
搜索与比较
| 工具 | 描述 |
|---|---|
search |
全局搜索 CDISC Library |
compare_versions |
版本差异比较 |
版本号格式
CDISC Library API 使用 - 分隔版本号:
| 标准 | 正确格式 | 错误格式 |
|---|---|---|
| SDTM | 1-8, 2-0 |
1.8, 2.0 |
| SDTMIG | 3-4, 3-3 |
3.4, 3.3 |
工具会自动转换格式,支持两种输入。
环境变量
| 变量名 | 必需 | 默认值 | 说明 |
|---|---|---|---|
CDISC_API_KEY |
✅ | - | API 密钥 |
CDISC_BASE_URL |
❌ | https://library.cdisc.org/api |
API URL |
CDISC_CACHE_DIR |
❌ | ~/.cdisc-mcp/cache |
缓存目录 |
CDISC_CACHE_TTL |
❌ | 86400 |
缓存时间(秒) |
开发
# 克隆仓库
git clone https://github.com/whereayan/cdisc-library-mcp.git
cd cdisc-library-mcp
# 安装开发依赖
pip install -e ".[dev]"
# 运行测试
python -m pytest tests/ -v
# 运行测试覆盖率
python -m pytest tests/ --cov=src/cdisc_mcp
许可证
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cdisc_library_mcp-0.1.1.tar.gz
(51.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cdisc_library_mcp-0.1.1.tar.gz.
File metadata
- Download URL: cdisc_library_mcp-0.1.1.tar.gz
- Upload date:
- Size: 51.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70faf1980f3a00f9bda7aa1e0bc80447541d98b77cdbf6a494f59111d2c2a07b
|
|
| MD5 |
dce33de8d061ce6e6e54794f9efe034e
|
|
| BLAKE2b-256 |
ee6855d99bd95ee2a1adb14bb74dd3cbc414e78515e328fc56d31689e55e7f93
|
File details
Details for the file cdisc_library_mcp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: cdisc_library_mcp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
171f3fd012139583ba4fcd33021c6a25f940dc14d60cfeec667b09fc3eadf3de
|
|
| MD5 |
423b3ba703d2ae03a7810d2240ec95fd
|
|
| BLAKE2b-256 |
963a836c30db185154a00a2ef8c30f0107afc22bdfc43a007ead3a5a7bebb9d5
|