npi-verify
MCP server for looking up and searching US healthcare providers in the CMS NPPES NPI Registry.
README
npi-verify
A small, typed Python client and MCP server for the public CMS NPPES NPI Registry.
What it is
npi-verify looks up and searches United States healthcare providers against the
National Plan and Provider Enumeration System (NPPES) NPI Registry. NPPES is the
authoritative registry published by the Centers for Medicare and Medicaid Services
(CMS). Every clinician and healthcare organization that bills US payers has an NPI,
and the registry is the source of truth for that identity.
The package gives you two things:
- A typed, dependency-light Python client that parses NPPES JSON into frozen dataclasses.
- An MCP (Model Context Protocol) server that exposes the same lookups as tools an AI agent can call.
Why
If you are building anything that touches the healthcare workforce, you eventually need to confirm that a provider is real and that the identity you were handed matches the public record. Checking the NPI against the CMS source of truth is the cheapest, most defensible verification step available, and it requires no credentials. This package makes that check a one-line call and a reusable agent tool.
The client validates the NPI offline before it ever hits the network, using the
same Luhn checksum (over the 80840 issuer prefix) that NPPES itself uses, so
malformed input fails fast and for free.
Public CMS data, no PHI
The NPPES NPI Registry is free, public, and requires no authentication. It returns provider demographic data only: names, NPIs, taxonomies, practice addresses, and enumeration status. It contains no protected health information (PHI). This package sends no credentials and stores nothing.
Install
pip install npi-verify
To use the MCP server, install the optional mcp extra:
pip install "npi-verify[mcp]"
From source:
git clone https://github.com/gm4prezi/npi-verify.git
cd npi-verify
pip install -e ".[dev]"
Client usage
Look up a single provider by NPI:
from npi_verify import NPIClient
with NPIClient() as client:
provider = client.lookup_npi("1234567893")
if provider is None:
print("No provider with that NPI.")
else:
print(provider.name, provider.credential)
print(provider.taxonomy.description)
print(provider.primary_address.city, provider.primary_address.state)
Search by name, state, taxonomy, or organization:
from npi_verify import NPIClient
with NPIClient() as client:
providers = client.search(
last_name="Rivera",
state="GA",
taxonomy_description="Internal Medicine",
limit=10,
)
for provider in providers:
print(provider.npi, provider.name, provider.entity_type)
Validate an NPI without any network call:
from npi_verify import is_valid_npi, validate_npi
is_valid_npi("1234567893") # True
is_valid_npi("1234567890") # False (bad checksum)
validate_npi("0000000000") # raises ValueError
Errors
lookup_npiandvalidate_npiraiseValueErrorfor a structurally invalid NPI.- A not-found lookup returns
None. An empty search returns[]. - Network failures, timeouts, and NPPES query errors raise
NPIRegistryError.
MCP usage
The package ships an MCP server over stdio that exposes two tools, lookup_npi and
search_providers, both wired to the client above.
Run it directly:
npi-verify-mcp
# or
python -m npi_verify.mcp_server
Register it with an MCP client (for example, Claude Desktop) by adding this to your MCP configuration:
{
"mcpServers": {
"npi-verify": {
"command": "npi-verify-mcp"
}
}
}
If you prefer not to install the console script, point the config at the module:
{
"mcpServers": {
"npi-verify": {
"command": "python",
"args": ["-m", "npi_verify.mcp_server"]
}
}
}
Data model
lookup_npi and search return frozen Provider dataclasses:
| Field | Description |
|---|---|
npi |
The 10-digit NPI. |
entity_type |
"Individual" or "Organization". |
name |
Person name, or organization name for entity type 2. |
credential |
Credential string (for example MD), individuals only. |
taxonomy |
Primary taxonomy: code, description, state, license. |
primary_address |
Practice location address (falls back to mailing). |
status |
NPPES status code (A for active). |
enumeration_date |
The date the NPI was issued. |
Development
pip install -e ".[dev]"
pytest
The default test run mocks all HTTP, so it makes no network calls and is safe for CI.
A single live smoke test against the real NPPES API is marked live and is skipped by
default. Run it explicitly with:
pytest -m live
License
MIT. See LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。