Skip to main content
Glama
clarifyhealth

cms-datagov-mcp-server

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

  1. cms_search_datasets - Find datasets by keyword or theme

  2. cms_get_dataset - Get detailed dataset information

  3. cms_query_dataset - Query data with filters (up to 5000 rows)

  4. cms_get_dataset_stats - Get row counts and column info

  5. cms_get_csv_link - Get CSV download URL for Athena

Resource Templates

  • cms://datasets - Browse all available CMS datasets

  • cms://dataset/{id} - Access specific dataset metadata

  • cms://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 link

Configure 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 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 keywords

  • theme (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 dataset

  • filter (optional): Filter expression (e.g., [field]=value)

  • columns (optional): Comma-separated column list

  • sort (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

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:

  1. Use cms_get_csv_link to get the download URL

  2. Download CSV to your S3 bucket

  3. 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');
  1. Run complex SQL queries in Athena

Troubleshooting

Server Not Appearing in Claude Desktop

  1. Verify the server is linked: npm list -g @clarify/cms-datagov-mcp-server

  2. Check configuration file syntax (valid JSON)

  3. Restart Claude Desktop completely

  4. 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 build

CMS API Details

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 build

Watch Mode

npm run watch

Testing

node test-validation.mjs

License

MIT License - See LICENSE file for details

Support

For CMS API questions: OEDAUserResearch@cms.hhs.gov

For MCP protocol documentation: https://modelcontextprotocol.io/

Available Tools

5 tools
cms_get_datasetB

Get detailed information about a specific CMS dataset by its ID. Returns metadata, API endpoints, CSV download URLs, and usage information.

ParametersJSON Schema
NameRequiredDescriptionDefault
dataset_idYesThe unique identifier (UUID) of the dataset

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. 'Get' implies a read-only lookup and the description helpfully enumerates the return payload (metadata, endpoints, CSV URLs, usage info), but it says nothing about auth requirements, rate limits, or error behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two compact sentences, with the core action front-loaded before the return-value enumeration. The return list is slightly long but each item is informative rather than filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple single-parameter read tool with no output schema, the description compensates well by summarizing what is returned. It is near-complete; only the sibling routing and prerequisite information are missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and the single parameter is fully documented (UUID format) in the schema. The description's 'by its ID' only echoes that, adding no syntax or format detail beyond the schema baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Get detailed information about a specific CMS dataset') and the lookup key ('by its ID'). It does not distinguish itself from siblings like cms_get_csv_link, which its return-value list (CSV download URLs) partially overlaps with.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The only usage signal is the implicit 'by its ID', meaning the agent must already possess the identifier. There is no statement of when to use this versus cms_search_datasets or cms_get_dataset_stats, and no prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

cms_get_dataset_statsA

Get statistics about a CMS dataset including total row count and column information. Useful for understanding dataset size before querying.

ParametersJSON Schema
NameRequiredDescriptionDefault
dataset_idYesThe unique identifier (UUID) of the dataset

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It does disclose the return payload (row count, column info), which is valuable given there is no output schema, but it never states that this is a safe read-only operation, nor anything about auth or cost. Adequate but incomplete for a zero-annotation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, zero padding, and the primary capability is front-loaded before the usage hint. Nothing here could be cut without losing information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter read tool with no output schema, the description covers both what is returned and when to reach for it. The only shortfall is the vagueness of 'column information' as a return description, but overall the agent has enough to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There is a single parameter with 100% schema description coverage ('The unique identifier (UUID) of the dataset'), so the schema already fully documents it. The description adds no format or semantics beyond that, which is the expected baseline when the schema does the work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb+resource ('Get statistics about a CMS dataset') and enumerates the payload ('total row count and column information'), which distinguishes it from siblings like cms_query_dataset. It does not, however, explicitly contrast itself with cms_get_dataset or cms_search_datasets, so an agent must infer the boundary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

'Useful for understanding dataset size before querying' supplies a concrete usage context and implicitly sequences the call ahead of cms_query_dataset. There is no explicit when-not guidance or named alternative, but the triggering condition is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
sizeNoNumber of rows to return (max 5000, default 100)
sortNoColumn name to sort by (prefix with - for descending)
filterNoFilter expression (e.g., '[field]=value' or '[field]=value1,value2')
offsetNoNumber of rows to skip (for pagination)
columnsNoComma-separated list of columns to return
dataset_idYesThe unique identifier (UUID) of the dataset

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the full behavioral burden. It discloses the row limit (5000) and mentions pagination parameters, which is helpful, but omits important traits such as authentication requirements, rate limits, or what happens when filters are invalid. The mention of 'Returns up to 5000 rows' is a useful constraint but insufficient for a query tool with no annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the core functionality and a key operational limit. Every sentence earns its place by quickly establishing scope and a fallback for larger datasets.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a query tool with six parameters and no output schema, the description covers the essential constraints (row limit, pagination alternative). It is nearly complete, though it could benefit from a brief note on return format or error handling to fully guide the agent in edge cases.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, meaning all parameters are fully documented in the schema itself. The description does not add any parameter-specific details beyond what is already present, such as filter syntax or sort direction format. Baseline score of 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Query a CMS dataset') and names the supported operations (filters, sorting, pagination). However, it doesn't differentiate from siblings like cms_search_datasets or cms_get_dataset, leaving the agent to infer that this tool retrieves actual row data rather than metadata.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context: it returns up to 5000 rows and suggests using csv_link for larger datasets, which is a useful when-to-use-exclusion. It lacks explicit guidance on when to choose this tool over cms_search_datasets or cms_get_dataset_stats, which would resolve ambiguity.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of results to return (default: 10)
queryNoSearch term to find in dataset titles, descriptions, or keywords
themeNoFilter by theme (e.g., 'Medicare', 'Medicaid', 'Hospital')

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It helpfully discloses the return shape (IDs, titles, descriptions, formats), but says nothing about pagination, result limits beyond the default, rate limits, or that this is a safe read-only operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tight sentences: the first states purpose, the second states the return contents. Nothing is wasted and the most important information is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple search tool with full schema coverage and no output schema, the description covers purpose and return structure adequately. It misses routing guidance versus alternative query/get tools and result-pagination behavior, but those are minor for this complexity level.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds only a light echo of the query/theme parameters ('keyword, theme, or title') and no additional syntax, format, or matching behavior details beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb (Search) and resource (CMS datasets) with the searchable facets (keyword, theme, title). It clearly conveys what the tool does, though it does not explicitly differentiate itself from siblings like cms_query_dataset or cms_get_dataset.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives no explicit when-to-use guidance, no exclusions, and never names an alternative among the several sibling tools. Usage is only implied by the search-oriented phrasing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv1.0.4
    • First observedcms_get_csv_link
    • First observedcms_get_dataset
    • First observedcms_get_dataset_stats
    • First observedcms_query_dataset
    • First observedcms_search_datasets

TDQS

A3.7/5.0

Scored across 5 tools

Disambiguation4/5

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.

Naming Consistency5/5

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.

Tool Count5/5

Five tools are well-scoped for a data catalog server, covering discovery, metadata, querying, stats, and export without redundancy.

Completeness4/5

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

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers