{
  "markdown": "<div align=\"center\">\n  <h1>@cyanheads/npi-providers-mcp-server</h1>\n  <p><b>Search NPPES providers and resolve NUCC specialty codes via MCP over STDIO or Streamable HTTP.</b>\n  <div>3 Tools • 2 Resources</div>\n  </p>\n</div>\n\n<div align=\"center\">\n\n[![Version](https://img.shields.io/badge/Version-0.1.8-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/npi-providers-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/%40cyanheads%2Fnpi-providers-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/npi-providers-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.4.0-blueviolet.svg?style=flat-square)](https://bun.sh/)\n\n</div>\n\n<div align=\"center\">\n\n[![Install in Claude Desktop](https://img.shields.io/badge/Install_in-Claude_Desktop-D97757?style=for-the-badge&logo=anthropic&logoColor=white)](https://github.com/cyanheads/npi-providers-mcp-server/releases/latest/download/npi-providers-mcp-server.mcpb) [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=npi-providers-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvbnBpLXByb3ZpZGVycy1tY3Atc2VydmVyIl19) [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22npi-providers-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cyanheads%2Fnpi-providers-mcp-server%22%5D%7D)\n\n[![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-67E8F9?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)\n\n</div>\n\n<div align=\"center\">\n\n**Public Hosted Server:** [https://npi-providers.caseyjhand.com/mcp](https://npi-providers.caseyjhand.com/mcp)\n\n</div>\n\n---\n\n## Tools\n\nThree tools covering the provider directory — search the registry, decode an NPI to its full record, and resolve plain-language specialties through the bundled taxonomy:\n\n| Tool | Description |\n|:---|:---|\n| `npi_search_providers` | Search the NPPES registry by name, organization, location, provider type, and specialty. Plain-language specialties resolve through the bundled NUCC taxonomy before searching. |\n| `npi_get_provider` | Fetch the complete NPPES record for up to 10 NPIs — taxonomies, addresses, credentials, identifiers, endpoints, and status. |\n| `npi_lookup_taxonomy` | Resolve, fetch, or browse the NUCC Healthcare Provider Taxonomy — fully offline. |\n\n### `npi_search_providers`\n\nSearch the registry for individual practitioners and organizations, with specialty resolution and honest pagination disclosure.\n\n- Search by `name_search` shortcut, explicit `first_name` / `last_name`, `organization_name`, `city` / `state` / `postal_code`, and `provider_type` (`individual` / `organization`)\n- Plain-language `specialty` (e.g. \"cardiologist\") resolves through the bundled NUCC taxonomy to the registry's exact descriptions before searching; the resolved taxonomy is echoed back so you can see what was actually searched\n- `taxonomy_description` escape hatch for callers who already hold an exact NUCC description (mutually exclusive with `specialty`)\n- Trailing-wildcard (`*`) name matching, with the registry's ≥2-leading-character rule documented inline\n- Discloses that the returned count is the page size — never a grand total — and that only the first 1200 matches are reachable, steering broad queries toward narrower filters\n\n---\n\n### `npi_get_provider`\n\nDecode one or more NPIs into fully populated provider profiles — the tool to turn an NPI from a claim, prescription, or another health data source into a known provider.\n\n- Batch fetch up to 10 NPIs per call; the 10-digit format is validated before any API call\n- Returns every taxonomy (with its primary flag, license number and state), all practice and mailing addresses, credential, sex, sole-proprietor flag, enumeration and last-updated dates, secondary identifiers (Medicaid, etc.), and FHIR/Direct endpoints\n- Partial-success reporting — well-formed NPIs with no registry record (deactivated or never enumerated) land in `notFound` rather than failing the whole call\n\n---\n\n### `npi_lookup_taxonomy`\n\nResolve and browse the NUCC Healthcare Provider Taxonomy — the specialty code set NPPES uses — fully offline from the bundled code set.\n\n- `resolve` — turn a plain-language specialty into matching taxonomy codes and canonical descriptions (the value the search tools filter on); plain-language phrasing (\"heart doctor\", \"eye doctor\") and common abbreviations (\"ent\", \"obgyn\") resolve to the right physician entry\n- `get` — return the full entry for an exact taxonomy code\n- `browse` — walk the hierarchy (grouping → classification → specialization), filterable by grouping and by NPI section (Individual/NPI-1 vs Non-Individual/NPI-2)\n\n`resolve` and `browse` cap results at `limit` (≤50) and disclose `truncated`; page past the cap with `skip` (raise it by `limit` each call, same query/filters) so every bundled entry stays reachable. `skip` is ignored for `get`.\n\n## Resources and prompts\n\n| Type | Name | Description |\n|:---|:---|:---|\n| Resource | `npi://provider/{npi}` | A single provider's full decoded record by NPI — the resource twin of `npi_get_provider`. |\n| Resource | `npi://taxonomy/{code}` | A single NUCC taxonomy entry by code — the resource twin of `npi_lookup_taxonomy` mode `get`. |\n\nAll resource data is also reachable via tools. The resources are convenience twins for resource-capable clients; tool-only clients lose nothing.\n\n## Features\n\nBuilt on [`@cyanheads/mcp-ts-core`](https://www.npmjs.com/package/@cyanheads/mcp-ts-core):\n\n- Declarative tool and resource definitions — single file per primitive, framework handles registration and validation\n- Unified error handling — handlers throw, framework catches, classifies, and formats\n- Pluggable auth: `none`, `jwt`, `oauth`\n- Swappable storage backends: `in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`\n- Structured logging with optional OpenTelemetry tracing\n- STDIO and Streamable HTTP transports\n\nNPI/NPPES-specific:\n\n- **Keyless** — runs against the public CMS NPPES NPI Registry API (v2.1) with no API key or account\n- **Bundled NUCC taxonomy** — the 879-code Healthcare Provider Taxonomy (v25.0) ships in the image and loads into an in-memory index at startup, so specialty resolution and code lookups work fully offline with no second upstream\n- Specialty resolution turns a vague term (\"heart doctor\") into the precise taxonomy description the registry filters on, and echoes the match back for the agent to verify\n- Detects the registry's quirk of returning HTTP 200 with an `Errors[]` body on validation failure and maps it to typed, recoverable error reasons\n\nAgent-friendly output:\n\n- Provenance on search — the resolved taxonomy and the exact `taxonomy_description` sent to the registry are echoed back, so agents can see what was actually searched and re-run with a different code\n- Honest pagination — the returned count is disclosed as the page size, never a fabricated grand total, with the 1200-match reachable ceiling surfaced when a broad query is capped\n- Graceful partial failure — `npi_get_provider` returns per-NPI `found` / `notFound` rows instead of failing the whole batch when some NPIs are deactivated or never enumerated\n\n## Getting started\n\n### Public Hosted Instance\n\nA public instance is available at `https://npi-providers.caseyjhand.com/mcp` — no installation required. Point any MCP client at it via Streamable HTTP, with this client config:\n\n```json\n{\n  \"mcpServers\": {\n    \"npi-providers-mcp-server\": {\n      \"type\": \"streamable-http\",\n      \"url\": \"https://npi-providers.caseyjhand.com/mcp\"\n    }\n  }\n}\n```\n\n### Self-hosted / local install\n\nAdd the following to your MCP client configuration file. No API key is required — the upstream NPPES registry is keyless.\n\n```json\n{\n  \"mcpServers\": {\n    \"npi-providers-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"bunx\",\n      \"args\": [\"@cyanheads/npi-providers-mcp-server@latest\"],\n      \"env\": {\n        \"MCP_TRANSPORT_TYPE\": \"stdio\",\n        \"MCP_LOG_LEVEL\": \"info\"\n      }\n    }\n  }\n}\n```\n\nOr with npx (no Bun required):\n\n```json\n{\n  \"mcpServers\": {\n    \"npi-providers-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@cyanheads/npi-providers-mcp-server@latest\"],\n      \"env\": {\n        \"MCP_TRANSPORT_TYPE\": \"stdio\",\n        \"MCP_LOG_LEVEL\": \"info\"\n      }\n    }\n  }\n}\n```\n\nOr with Docker:\n\n```json\n{\n  \"mcpServers\": {\n    \"npi-providers-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"docker\",\n      \"args\": [\"run\", \"-i\", \"--rm\", \"-e\", \"MCP_TRANSPORT_TYPE=stdio\", \"ghcr.io/cyanheads/npi-providers-mcp-server:latest\"]\n    }\n  }\n}\n```\n\nFor Streamable HTTP, set the transport and start the server:\n\n```sh\nMCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http\n# Server listens at http://localhost:3010/mcp\n```\n\n### Prerequisites\n\n- [Bun v1.3.0](https://bun.sh/) or higher (or Node.js v24+).\n- No API key — the NPPES NPI Registry API is public and keyless. The NUCC taxonomy is bundled, so there is no second data source to provision.\n\n### Installation\n\n1. **Clone the repository:**\n\n```sh\ngit clone https://github.com/cyanheads/npi-providers-mcp-server.git\n```\n\n2. **Navigate into the directory:**\n\n```sh\ncd npi-providers-mcp-server\n```\n\n3. **Install dependencies:**\n\n```sh\nbun install\n```\n\n4. **Configure environment (optional):**\n\n```sh\ncp .env.example .env\n# edit .env only if you need to override the NPPES base URL or timeout\n```\n\n## Configuration\n\nNo required variables — the server runs out of the box against the keyless NPPES registry. All variables below are optional overrides.\n\n| Variable | Description | Default |\n|:---|:---|:---|\n| `NPPES_API_BASE_URL` | NPPES NPI Registry API base URL. Override for a private mirror or testing. | `https://npiregistry.cms.hhs.gov/api` |\n| `NPPES_TIMEOUT_MS` | Per-request HTTP timeout for NPPES calls, in milliseconds. | `15000` |\n| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |\n| `MCP_HTTP_PORT` | Port for the HTTP server. | `3010` |\n| `MCP_AUTH_MODE` | Auth mode: `none`, `jwt`, or `oauth`. | `none` |\n| `MCP_SESSION_MODE` | HTTP session handling: `stateless`, `stateful`, or `auto`. This server pins `stateless`; the schema default `auto` resolves to `stateful`. | `stateless` |\n| `MCP_LOG_LEVEL` | Log level (RFC 5424). | `info` |\n| `STORAGE_PROVIDER_TYPE` | Storage backend. | `in-memory` |\n| `OTEL_ENABLED` | Enable [OpenTelemetry instrumentation](https://github.com/cyanheads/mcp-ts-core/tree/main/docs/telemetry) (spans, metrics, completion logs). | `false` |\n\nSee [`.env.example`](./.env.example) for the full list of optional overrides.\n\n## Running the server\n\n### Local development\n\n- **Build and run:**\n\n  ```sh\n  # One-time build\n  bun run rebuild\n\n  # Run the built server\n  bun run start:stdio\n  # or\n  bun run start:http\n  ```\n\n- **Run checks and tests:**\n\n  ```sh\n  bun run devcheck   # Lint, format, typecheck, security\n  bun run test       # Vitest test suite\n  bun run lint:mcp   # Validate MCP definitions against spec\n  ```\n\n### Docker\n\n```sh\ndocker build -t npi-providers-mcp-server .\ndocker run --rm -e MCP_TRANSPORT_TYPE=http -p 3010:3010 npi-providers-mcp-server\n```\n\nThe Dockerfile defaults to HTTP transport, stateless session mode, and logs to `/var/log/npi-providers-mcp-server`. OpenTelemetry peer dependencies are installed by default — build with `--build-arg OTEL_ENABLED=false` to omit them.\n\n## Project structure\n\n| Directory | Purpose |\n|:----------|:--------|\n| `src/index.ts` | `createApp()` entry point — registers tools and resources, inits services. |\n| `src/config` | Server-specific environment variable parsing and validation with Zod. |\n| `src/mcp-server/tools` | Tool definitions (`*.tool.ts`). |\n| `src/mcp-server/resources` | Resource definitions (`*.resource.ts`). |\n| `src/services/nppes` | NPPES NPI Registry API client — query building, `Errors[]`-on-200 detection, normalization. |\n| `src/services/taxonomy` | Bundled NUCC taxonomy service — in-memory index for resolve / get / browse. |\n| `tests/` | Unit and integration tests mirroring `src/`. |\n\n## Development guide\n\nSee [`CLAUDE.md`/`AGENTS.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:\n\n- Handlers throw, framework catches — no `try/catch` in tool logic\n- Use `ctx.log` for request-scoped logging, `ctx.state` for tenant-scoped storage\n- Register new tools and resources in the `createApp()` arrays\n- Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields\n\n## Contributing\n\nIssues and pull requests are welcome. Run checks and tests before submitting:\n\n```sh\nbun run devcheck\nbun run test\n```\n\n## License\n\nApache-2.0 — see [LICENSE](LICENSE) for details.\n\n---\n\nProvider data from the [CMS NPPES NPI Registry](https://npiregistry.cms.hhs.gov/) (public domain). The bundled specialty codes are the [NUCC Health Care Provider Taxonomy](https://www.nucc.org/index.php/code-sets-mainmenu-41/provider-taxonomy-mainmenu-40), © American Medical Association on behalf of the National Uniform Claim Committee (NUCC), redistributed unmodified beyond formatting under the [NUCC permission](https://www.nucc.org/index.php/nucc-structure-mainmenu-36/contact-us-mainmenu-34?id=111). See [`NOTICE`](NOTICE).\n",
  "bytes": 13985,
  "sha": "84f3d80f4e1765d9a6167addc845fa8d9a692f96c31e45039b3ce89fc54319bc",
  "repo_slug": "cyanheads/npi-providers-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_cyanheads_npi_providers_mcp_se_80dcaba4/readme"
}