NPI注册表MCP服务器🏥
用于搜索国家提供商标识符(NPI)注册表的模型上下文协议(MCP)服务器。该服务器提供搜索和检索美国医疗服务提供者和组织信息的工具。
概述📋
NPI是美国受保医疗保健提供者的唯一识别码。此MCP服务器允许Claude和其他兼容MCP的客户端搜索由医疗保险和医疗补助服务中心(CMS)维护的官方NPI注册表,并将结果整合到LLM上下文中,以增强分析和见解。
特性✨
- 按提供商名称搜索:按名字、姓氏或两者查找个人医疗服务提供者
- 按组织搜索:按名称查找医疗机构
- 按NPI编号搜索:使用特定的10位NPI直接查找
- 基于位置的搜索:按城市、州或邮政编码筛选结果
- 专业搜索:根据专业或分类描述查找提供商
- 综合数据:返回详细信息,包括地址、练习地点、专业和其他标识符
用例💡
- 验证医疗保健提供者凭据
- 查找提供商联系信息和地址
- 查找组织详细信息和授权官员
- 验证NPI编号
- 研究提供者的专业和分类
- 查找特定地理区域的供应商
安装🚀
先决条件📋
- Python 3.10或更高版本
- 紫外线 包管理器
开发设置🛠️
- 克隆存储库:
git clone https://github.com/eliotk/npi-registry-mcp-server.git
cd npi-registry-mcp-server- 安装uv (如果尚未安装):
curl -LsSf https://astral.sh/uv/install.sh | sh- 创建虚拟环境并安装依赖项:
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -e ".[dev]"- 直接运行服务器 (用于测试):
uv run python -m npi_registry_mcp.server
# or using the entry point:
uv run npi-registry-mcp-server生产装置🌟
从PyPI安装(发布后):
uv pip install npi-registry-mcp-server或者从源代码安装:
uv pip install git+https://github.com/eliotk/npi-registry-mcp-server.git用法📚
可用工具🛠️
search_npi_registry 🔎
使用各种条件搜索NPI注册表:
参数:
first_name(可选):提供者的名字last_name(可选):提供者的姓氏organization_name(可选):组织名称npi(可选):特定的10位NPI编号city(可选):城市名称state(可选):州缩写(例如“CA”、“NY”)postal_code(可选):邮政编码(支持通配符)specialty(可选):提供商专业或分类limit(可选):返回的最大结果数(1-200,默认值:10)
示例:
# Search for a specific provider by name
search_npi_registry(first_name="John", last_name="Smith", state="CA")
# Look up a specific NPI
search_npi_registry(npi="1234567890")
# Find organizations in a city
search_npi_registry(organization_name="Hospital", city="Los Angeles", state="CA")
# Search by specialty
search_npi_registry(specialty="cardiology", state="NY", limit=20)
# Find providers in a specific ZIP code area
search_npi_registry(postal_code="902*", state="CA")响应格式📄
搜索返回一个结构化响应,其中包含:
{
"success": true,
"count": 5,
"results": [
{
"npi": "1234567890",
"entity_type": "Individual",
"is_organization": false,
"status": "A",
"enumeration_date": "2010-05-05",
"last_updated": "2023-01-15",
"name": {
"first": "John",
"last": "Smith",
"credential": "MD"
},
"addresses": [...],
"practice_locations": [...],
"taxonomies": [...],
"identifiers": [...]
}
]
}Claude桌面配置🖥️
要将此MCP服务器与Claude Desktop一起使用,请将以下配置添加到您的Claude Desktop配置文件中:
macOS🍎
地点: ~/Library/Application Support/Claude/claude_desktop_config.json
视窗🪟
地点: %APPDATA%/Claude/claude_desktop_config.json
配置📝
{
"mcpServers": {
"npi-registry": {
"command": "uv", # may need full path to executable
"args": [
"--directory",
"/path/to/npi-registry-mcp-server",
"run",
"npi-registry-mcp-server"
]
}
}
}验证✅
- 保存配置文件
- 完全重新启动克劳德桌面
- 寻找🔧 Claude Desktop中的图标,用于验证服务器是否已连接
- 试着问克劳德:“在加利福尼亚州寻找名叫史密斯的医生”
发展👨💻
项目结构📁
npi-registry-mcp-server/
├── src/
│ └── npi_registry_mcp/
│ ├── __init__.py
│ └── server.py
├── tests/
├── pyproject.toml
├── README.md
└── .gitignore运行测试🧪
uv run pytest代码格式化🎨
# Format code
uv run black src/ tests/
# Sort imports
uv run isort src/ tests/
# Lint
uv run ruff check src/ tests/
# Type checking
uv run mypy src/构建包📦
uv buildapi参考📖
此服务器使用CMS提供的官方NPI注册表API:
- 基本URL: https://npiregistry.cms.hhs.gov/api/
- 文档: https://npiregistry.cms.hhs.gov/registry/help-api
- 速率限制:API对正常使用有合理的费率限制
数据源🗃️
所有数据直接来自官方NPI注册表,由以下机构维护:
- 医疗保险和医疗补助服务中心(CMS)
- 美国卫生与公众服务部
贡献🤝
- 分叉存储库
- 创建要素分支:
git checkout -b feature-name - 进行更改并添加测试
- 运行测试套件:
uv run pytest - 设置代码格式:
uv run black src/ tests/ - 提交拉取请求
许可证📄
MIT许可证-有关详细信息,请参阅许可证文件。
支持🆘
- 问题:通过GitHub Issues报告错误和请求功能
- 文档:其他文件见
/docs目录 - API问题:参考官方NPI注册表API文件
更新日志📝
v0.1.0🎉
- 初始版本
- 基本的NPI注册表搜索功能
- 支持个人和组织搜索
- 位置和专业过滤
- 全面的提供商数据检索
______________________________________________________________________
有关模型上下文协议的更多信息,请访问:https://modelcontextprotocol.io/
