MedAdapt内容服务器
Claude Desktop的专用模型上下文协议(MCP)服务器,通过从PubMed、NCBI书架和用户提供的文档中获取和处理教育资源来增强人工智能辅助医学学习。
概述
MedAdapt Content Server与Claude Desktop集成,提供搜索、检索和分析医学教育内容的工具。它是克劳德和医学知识来源之间的桥梁,可以增强人工智能辅助学习体验。
快速开始
# Clone the repository
git clone https://github.com/ryoureddy/medadapt-content-server.git
cd medadapt-content-server
# Install dependencies
pip install -r requirements.txt
# Run the server
python content_server.py特性
- 内容搜索:跨多个来源搜索医学教育内容
- 资源检索:获取完整的文章、书籍章节和用户文档
- 主题概述:生成医学主题的全面概述
- 学习资源:根据主题和学生水平建议适当的学习资源
- 学习计划:制定有目标和资源的结构化学习计划
- 内容分析:从医疗资源中提取关键点、方法和发现
- 用户内容:导入和分析用户提供的文档
安装
标准安装
- 克隆存储库:
git clone https://github.com/ryoureddy/medadapt-content-server.git
cd medadapt-content-server- 创建虚拟环境(可选但推荐):
python -m venv .venv
source .venv/bin/activate # On Windows, use: .venv\Scripts\activate- 安装依赖项:
pip install -r requirements.txt- 配置(可选):
- 获取NCBI API密钥以提高速率限制:https://ncbiinsights.ncbi.nlm.nih.gov/2017/11/02/new-api-keys-for-the-e-utilities/ - 创建一个 .env 文件基于 .env.example
用法
运行服务器
python content_server.py与Claude Desktop集成
- 打开克劳德桌面
- 转到“设置”→ 模型上下文协议→ 添加服务器
- 在您的
claude_desktop_config.json文件位于:
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json - 窗户: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"medadapt": {
"command": "/path/to/python",
"args": [
"/path/to/medadapt-content-server/content_server.py"
],
"env": {
"DB_PATH": "/path/to/medadapt-content-server/medadapt_content.db"
}
}
}
}替换 /path/to/python 使用您的实际Python路径(例如。, /opt/anaconda3/bin/python 或 C:\Python311\python.exe). 替换 /path/to/medadapt-content-server/ 带有克隆存储库的绝对路径。
重要:The DB_PATH 环境变量确保数据库文件是以绝对路径创建和访问的,从而防止常见的文件访问错误。填充初始主题映射
python populate_topics.py测试
运行测试以验证一切正常:
python test_server.pyClaude使用示例
场景1:学习医学主题
克劳德的用户提示:
I'd like to learn about the cardiac cycle. Can you provide a big picture overview and help me understand the key concepts?场景2:寻找特定资源
克劳德的用户提示:
I need to find recent research articles about COVID-19 treatment options. Can you help me find relevant resources?场景3:制定学习计划
克劳德的用户提示:
I'm a second-year medical student studying neurology. Can you create a learning plan for understanding stroke pathophysiology?可用工具
服务器为Claude提供以下工具:
search_medical_content:使用过滤器搜索医疗内容get_resource_content:检索特定资源的完整内容get_topic_overview:生成医学主题的全面概述suggest_learning_resources:获取个性化的资源推荐import_user_document:上传用户提供的学习材料generate_learning_plan:制定有目标的结构化学习计划extract_article_key_points:从医学文章中提取关键发现
故障排除
常见问题及解决方法
- 数据库连接错误
- 症状: sqlite3.OperationalError: unable to open database file - 解决方案:确保 DB_PATH 环境变量在Claude Desktop配置中设置正确,指向应用程序具有写入权限的绝对路径。
- 文件路径错误
- 症状: No such file or directory 错误 - 解决方案:确保Claude Desktop配置中的所有路径都是绝对路径,没有额外的引号或转义符。
- API速率限制
- 症状:PubMed或NCBI书架的响应缓慢或失败 - 解决方案:获取NCBI API密钥并将其添加到您的 .env 文件
- Claude桌面连接
- 症状:Claude无法连接到MCP服务器 - 解决方案:验证服务器是否在终端窗口中运行,并在Claude Desktop中正确配置
项目结构
medadapt-content-server/
│
├── content_server.py # Main MCP server implementation
├── database.py # SQLite database interface
├── pubmed_utils.py # PubMed API utilities
├── bookshelf_utils.py # NCBI Bookshelf utilities
├── populate_topics.py # Script to populate initial topic data
├── test_server.py # Test script
├── requirements.txt # Python dependencies
├── .env.example # Example environment variables
└── README.md # Documentation许可证
此项目根据MIT许可证获得许可-有关详细信息,请参阅许可证文件。
致谢
- NCBI提供PubMed和Bookshelf API的访问权限
- 克劳德的拟人化与MCP集成能力
