cms-datagov-mcp-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cms-datagov-mcp-server Query dataset 9887a515-7552-4693-bf58-735c77af46d7 for organization CCN 100007"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CMS Data.gov MCP Server
A Model Context Protocol (MCP) server that provides Claude and other MCP clients with direct access to CMS (Centers for Medicare & Medicaid Services) healthcare data from data.cms.gov.
Overview
This MCP server enables AI assistants to:
Search and discover CMS healthcare datasets
Query dataset records with filters and pagination
Get dataset statistics and metadata
Obtain CSV download links for large-scale analysis
Perfect for healthcare analytics workflows, especially when working with LEJR (Lower Extremity Joint Replacement) analyses, provider enrollment data, hospital quality metrics, and other CMS datasets.
Related MCP server: ClinicalTrials MCP Server
Features
Five Core Tools
cms_search_datasets - Find datasets by keyword or theme
cms_get_dataset - Get detailed dataset information
cms_query_dataset - Query data with filters (up to 5000 rows)
cms_get_dataset_stats - Get row counts and column info
cms_get_csv_link - Get CSV download URL for Athena
Resource Templates
cms://datasets- Browse all available CMS datasetscms://dataset/{id}- Access specific dataset metadatacms://csv/{id}- Get CSV download link
Installation
Prerequisites
Node.js 18 or higher
Claude Desktop or other MCP-compatible client
Quick Install
# Clone or navigate to the project directory
cd cms-datagov-mcp-server
# Install dependencies
npm install
# Build the TypeScript code
npm run build
# Link globally (for Claude Desktop)
npm linkConfigure Claude Desktop
Edit your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
Add this configuration:
{
"mcpServers": {
"cms-datagov": {
"command": "cms-datagov-mcp-server",
"args": [],
"env": {}
}
}
}Restart Claude Desktop to activate the server.
Usage
Search for Datasets
"Search CMS datasets for TEAM episode"Returns a list of matching datasets with IDs, descriptions, and available formats.
Get Dataset Details
"Get details for dataset 9887a515-7552-4693-bf58-735c77af46d7"Returns comprehensive metadata including API endpoints, CSV links, and column information.
Query Dataset Records
"Query dataset 9887a515-7552-4693-bf58-735c77af46d7 where organization_ccn=100007, return 100 rows"Returns up to 5000 rows with optional filtering, sorting, and column selection.
Get Dataset Statistics
"Get statistics for dataset 9887a515-7552-4693-bf58-735c77af46d7"Returns column names, types, and metadata about the dataset.
Get CSV Download Link
"Get CSV link for dataset 9887a515-7552-4693-bf58-735c77af46d7"Returns direct download URL for creating Athena EXTERNAL TABLEs.
API Reference
cms_search_datasets
Search CMS datasets by keyword, theme, or title.
Parameters:
query(optional): Search term for titles, descriptions, or keywordstheme(optional): Filter by theme (e.g., 'Medicare', 'Medicaid')limit(optional): Maximum results to return (default: 10)
Returns: Array of matching datasets with metadata
cms_get_dataset
Get detailed information about a specific dataset.
Parameters:
dataset_id(required): UUID of the dataset
Returns: Complete dataset metadata including API endpoint and CSV URL
cms_query_dataset
Query dataset records with filtering and pagination.
Parameters:
dataset_id(required): UUID of the datasetfilter(optional): Filter expression (e.g.,[field]=value)columns(optional): Comma-separated column listsort(optional): Column to sort by (prefix with-for descending)offset(optional): Number of rows to skip (default: 0)size(optional): Number of rows to return (max 5000, default: 100)
Returns: JSON array of matching records
cms_get_dataset_stats
Get statistics about a dataset.
Parameters:
dataset_id(required): UUID of the dataset
Returns: Column information and dataset metadata
cms_get_csv_link
Get direct CSV download URL.
Parameters:
dataset_id(required): UUID of the dataset
Returns: CSV download URL with usage instructions
Integration with Athena
For large datasets or complex analysis:
Use
cms_get_csv_linkto get the download URLDownload CSV to your S3 bucket
Create an Athena EXTERNAL TABLE:
CREATE EXTERNAL TABLE cms_team_data (
organization_ccn STRING,
organization_name STRING,
-- ... other columns
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS TEXTFILE
LOCATION 's3://your-bucket/cms-data/'
TBLPROPERTIES ('skip.header.line.count'='1');Run complex SQL queries in Athena
Troubleshooting
Server Not Appearing in Claude Desktop
Verify the server is linked:
npm list -g @clarify/cms-datagov-mcp-serverCheck configuration file syntax (valid JSON)
Restart Claude Desktop completely
Check Claude Desktop logs for errors
API Errors
404 Not Found: Invalid dataset ID
Timeout: Dataset too large, use CSV download instead
Rate Limit: Wait a moment and retry
Build Errors
# Clean and rebuild
rm -rf build node_modules
npm install
npm run buildCMS API Details
Base URL: https://data.cms.gov/data-api/v1
Catalog: https://data.cms.gov/data.json
Max Rows: 5000 per request
No Authentication: Public data, no API key required
When to Use MCP vs Athena
Use MCP for:
Dataset discovery and exploration
Quick lookups (< 1000 rows)
Data validation
Getting CSV links
Use Athena for:
Large datasets (> 5000 rows)
Complex joins and aggregations
GROUP BY operations
Repeated analysis
Development
Build
npm run buildWatch Mode
npm run watchTesting
node test-validation.mjsLicense
MIT License - See LICENSE file for details
Support
For CMS API questions: OEDAUserResearch@cms.hhs.gov
For MCP protocol documentation: https://modelcontextprotocol.io/
Related Resources
Available Tools
5 toolscms_get_csv_linkA
Get the direct CSV download URL for a dataset. Use this to download large datasets and create Athena EXTERNAL TABLEs for complex analysis.
Inputs: dataset_id (required).
cms_get_datasetB
Get detailed information about a specific CMS dataset by its ID. Returns metadata, API endpoints, CSV download URLs, and usage information.
Inputs: dataset_id (required).
cms_get_dataset_statsA
Get statistics about a CMS dataset including total row count and column information. Useful for understanding dataset size before querying.
Inputs: dataset_id (required).
cms_query_datasetA
Query a CMS dataset with filters, sorting, and pagination. Returns up to 5000 rows per request. For larger datasets, use csv_link and load into Athena.
Inputs: dataset_id (required), size, sort, filter, +2 more.
cms_search_datasetsB
Search CMS datasets by keyword, theme, or title. Returns a list of matching datasets with their IDs, titles, descriptions, and available formats.
Inputs: limit, query, theme.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct operation: querying, stats, CSV link, search, and metadata retrieval. cms_get_dataset and cms_get_dataset_stats could be slightly confused, but descriptions clarify their purposes.
All tool names follow a consistent snake_case pattern with the 'cms_' prefix and clear verb_noun structure, making them predictable and easy to scan.
Five tools are well-scoped for a data catalog server, covering discovery, metadata, querying, stats, and export without redundancy.
The tool set covers key aspects of dataset interaction, but lacks tools for schema exploration (e.g., listing columns) or direct data export beyond CSV links, which might be needed for some workflows.
Maintenance
Related MCP Connectors
US healthcare data for AI agents: CMS, FDA adverse events, CDC, NPPES NPI. Keyless, real samples.
CMS Open Payments, with annual dataset discovery through the official DKAN API.
US healthcare public data, one endpoint: prices, Medicare, MA benefits, Stars, Medicaid, providers.
CMS quality ratings, payer-negotiated prices, and clinician data for 41K+ US healthcare facilities.
Related MCP Servers
- AlicenseBqualityCmaintenanceProvides comprehensive access to CMS Medicare data including physician services, prescriber information, hospital quality metrics, drug spending, formulary coverage, and ASP pricing for healthcare analysis and decision-making.18MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to search and access clinical trial data from ClinicalTrials.gov, including searching trials by keywords, retrieving detailed trial metadata by NCT ID, and managing trial data in CSV format for research and analysis.18-
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to query and analyze FDA adverse events, drug labels, medical device clearances, and other public health datasets through natural language commands.14-
- AlicenseAqualityDmaintenanceEnables AI assistants to query NHS public health datasets, including prescribing data, dataset exploration, and organisation lookup via the NHSBSA Open Data Portal.9MIT