Skip to main content
Glama
openpharma-org

Medicaid MCP Server

Unofficial Medicaid MCP Server

Model Context Protocol (MCP) server for Medicaid public data access via data.medicaid.gov and state formularies

Features

State Formulary Coverage

Access Medicaid formularies for 5 states covering 43% of US Medicaid beneficiaries (32M of 74M):

  • California - 40K drugs with NDC codes, prior authorization requirements, tier-based pricing

  • New York - 37K drugs with MRA pricing, daily updates, preferred drug lists

  • Ohio - 76K drugs with comprehensive step therapy and quantity limit data

  • Texas - 4.7K drugs with multi-program pricing (Medicaid, CHIP, specialty programs)

  • Illinois - 5.7K drugs with intelligent cross-state NDC enrichment (61.7% coverage)

Pricing & Utilization Data

  • NADAC Drug Pricing - National average drug acquisition costs (1.5M NDCs, weekly updates)

  • Federal Upper Limits - Generic drug maximum reimbursement (2.1M records, monthly updates)

  • Drug Rebate Program - Manufacturer product information and rebate agreements (~3M records)

  • State Drug Utilization - Prescription volume by state, drug, and quarter (5.3M records)

  • Enrollment Trends - Monthly Medicaid/CHIP enrollment by state (all 50 states + territories)

Provider-Level Spending (DuckDB Extension)

Provider-level Medicaid claims data from the HHS T-MSIS dataset (2018-2024, 227M rows). Queried locally via DuckDB on a 2.9 GB Parquet file — no API, reads only columns/rows needed per query (~50-500ms).

  • get_provider_spending - Filter by NPI, HCPCS code, and/or date range

  • get_provider_top_services - Top HCPCS codes by total payment for a provider

  • get_hcpcs_top_providers - Top providers by total payment for a HCPCS code

  • get_provider_spending_summary - Aggregate stats for a provider NPI

Setup: Download the Parquet file first:

python scripts/download_medicaid_provider_spending.py

Note: Provider spending methods are handled by the Python wrapper layer (DuckDB on local Parquet), not the Node.js MCP server. The wrapper routes these methods locally and forwards all other methods to Node.js as before.

Technical Features

  • Hybrid Architecture - Optimized data access: in-memory caching for small datasets, streaming API for large datasets

  • Automatic Pricing Integration - Formulary queries auto-enrich with NADAC pricing data

  • Intelligent Enrichment - Illinois formulary enhanced via cross-state NDC matching (CA/NY/OH sources)

Related MCP server: OpenFDA MCP Server

Usage

{
  "mcpServers": {
    "medicaid": {
      "command": "node",
      "args": ["/path/to/medicaid-mcp-server/build/index.js"]
    }
  }
}

API Reference

Unified Tool: medicaid_info

The server provides a single tool with multiple methods:

{
  "method": "search_state_formulary",
  "state": "CA",  // CA, NY, OH, TX, IL
  "label_name": "OZEMPIC",
  "limit": 10
}

Parameters:

  • state (required): State code (CA, NY, OH, TX, IL)

  • label_name: Brand/trade name

  • generic_name: Generic drug name

  • ndc: 11-digit NDC code

  • requires_pa: Prior authorization filter (true/false)

  • has_ndc: Filter for drugs with NDC codes (Illinois only)

  • limit: Max results (default: 10)

State-Specific Parameters:

California:

  • tier: Cost ceiling tier ("Brand" or "Generic")

  • extended_duration: Extended duration eligibility (true/false)

Texas:

  • pdl_pa: PDL prior authorization (true/false)

  • clinical_pa: Clinical prior authorization (true/false)

  • program: Program filter (medicaid, chip, cshcn, etc.)

  • max_price / min_price: Price range filters

New York:

  • preferred: Preferred drug status (true/false)

  • is_brand: Brand vs generic filter (true/false)

  • max_price / min_price: MRA cost range

Drug Pricing

{
  "method": "get_nadac_pricing",
  "drug_name": "ibuprofen",
  "limit": 10
}

Parameters:

  • drug_name: Drug name (fuzzy match)

  • ndc: Specific 11-digit NDC code

  • limit: Max results (default: 10)

{
  "method": "get_enrollment_trends",
  "state": "CA",
  "start_date": "2023-01-01",
  "end_date": "2024-12-31"
}

Federal Upper Limits

{
  "method": "get_federal_upper_limits",
  "ingredient": "NYSTATIN",
  "limit": 10
}

Drug Rebate Information

{
  "method": "get_drug_rebate_info",
  "drug_name": "ozempic",  // or labeler_name: "novo nordisk"
  "limit": 10
}

State Drug Utilization

{
  "method": "get_drug_utilization",
  "state": "CA",
  "drug_name": "OZEMPIC",
  "year": 2024,
  "quarter": 4,
  "limit": 10
}

Provider Spending (DuckDB)

// Filter by HCPCS code
{
  "method": "get_provider_spending",
  "hcpcs_code": "J3490",
  "month_from": "2024-01",
  "month_to": "2024-06",
  "limit": 20
}

// Top services for a provider
{
  "method": "get_provider_top_services",
  "npi": "1730491945",
  "limit": 10
}

// Top providers for a procedure code
{
  "method": "get_hcpcs_top_providers",
  "hcpcs_code": "99213",
  "limit": 10
}

// Provider aggregate summary
{
  "method": "get_provider_spending_summary",
  "npi": "1730491945"
}

Common Parameters:

  • npi_role: "billing" (default) or "servicing" — selects which NPI column to filter on

Architecture

The server uses a hybrid data access strategy optimized for performance and memory efficiency:

Cached Datasets - Small, frequently accessed data loaded into memory:

  • State formularies (CA, NY, OH, TX, IL) - Excel/CSV/JSON/Text parsing with TTL-based refresh

  • NADAC pricing (123 MB) - Weekly CSV download, cached for fast lookups

  • State enrollment (3.6 MB) - Monthly snapshots, cached for trend analysis

Streaming API - Large datasets queried on-demand via CMS DKAN API:

  • Federal Upper Limits (196 MB, 2.1M records)

  • Drug Rebate Program (291 MB, ~3M records)

  • State Drug Utilization (192 MB, 5.3M records)

Memory Footprint: ~215 MB total for cached datasets, minimal for API queries

Performance Characteristics

Dataset

Access Method

Typical Response Time

State Formularies

In-memory cache

<100ms

NADAC Pricing

In-memory cache

<100ms (20-30s initial load)

State Enrollment

In-memory cache

<50ms

Federal Upper Limits

DKAN API streaming

1-2s

Drug Rebate Program

DKAN API streaming

1-2s

State Drug Utilization

DKAN API streaming

1-2s

Provider Spending

DuckDB on Parquet

300-700ms

Data Sources

Dataset

Update Frequency

Coverage

Authority

NADAC

Weekly

1.5M NDC codes

CMS

State Formularies

Daily-Monthly

43% of US Medicaid

State agencies

Federal Upper Limits

Monthly

2.1M records

CMS

Drug Rebate

Quarterly

~3M records

CMS

Drug Utilization

Quarterly

5.3M records

CMS

Enrollment

Monthly

All states

CMS

Provider Spending

Periodic

227M rows, 2018-2024

HHS T-MSIS

Query Examples

State Formulary Search with Automatic Pricing

// Find GLP-1 drugs in California
{
  "method": "search_state_formulary",
  "state": "CA",
  "generic_name": "semaglutide",
  "limit": 10
}
// Returns formulary data with automatic NADAC pricing integration

Multi-State Enrollment Comparison

{
  "method": "compare_state_enrollment",
  "states": ["CA", "TX", "NY", "FL"],
  "month": "2024-09"
}

Cross-State NDC Enrichment

// Illinois formulary with intelligent enrichment
{
  "method": "search_state_formulary",
  "state": "IL",
  "label_name": "OZEMPIC",
  "limit": 10
}
// Returns IL formulary enriched with NDC codes from CA/NY/OH (61.7% coverage)

Use Cases

Market Access & Strategy

  • State formulary coverage analysis and prioritization

  • Prior authorization landscape mapping

  • Competitive tier placement assessment

Pricing Intelligence

  • NADAC price trend analysis and forecasting

  • Multi-state pricing comparisons

  • Rebate program eligibility verification

Provider Analytics

  • Cross-payer provider analysis (Medicaid + Medicare provider-level data)

  • Medicaid-specific prescriber targeting by HCPCS code

  • Provider-level geographic hotspot identification

  • HCPCS utilization patterns across billing vs servicing NPIs

Policy & Economics

  • Medicaid expansion impact analysis

  • State enrollment forecasting and growth trends

  • Utilization pattern analysis by geography

Limitations

  • Individual beneficiary claims require CMS Data Use Agreement (T-MSIS/TAF)

  • Provider spending data requires local Parquet download (2.9 GB) — not served by the Node.js MCP server directly

Available Tools

1 tool
medicaid_infoC

Unified tool for Medicaid data operations: access enrollment trends, drug pricing (NADAC), quality measures, and program performance from data.medicaid.gov via Socrata SODA API. Provides state-level aggregates (NOT provider-level like Medicare).

ParametersJSON Schema
NameRequiredDescriptionDefault
methodYesThe operation to perform: get_nadac_pricing (drug pricing), compare_drug_pricing (multi-drug comparison), get_enrollment_trends (state enrollment), compare_state_enrollment (multi-state comparison), get_drug_rebate_info (rebate program), search_state_formulary (CA/NY/TX/OH/IL formularies), get_drug_utilization (state prescriptions), get_federal_upper_limits (FUL pricing), list_available_datasets (catalog), search_datasets (custom query)
stateNoState abbreviation (e.g., "CA", "TX", "NY") - required for get_enrollment_trends
statesNoArray of state abbreviations for compare_state_enrollment
ndc_codeNoNational Drug Code (11-digit) for get_nadac_pricing
drug_nameNoDrug name (partial match supported) for get_nadac_pricing or get_drug_rebate_info
price_dateNoSpecific pricing date (YYYY-MM-DD) for get_nadac_pricing - defaults to latest
start_dateNoStart date (YYYY-MM-DD) for time-range queries
end_dateNoEnd date (YYYY-MM-DD) for time-range queries
enrollment_typeNoType of enrollment data for enrollment methods
monthNoSpecific month (YYYY-MM) for compare_state_enrollment
ndc_codesNoArray of NDC codes for compare_drug_pricing
drug_namesNoArray of drug names for compare_drug_pricing
labeler_nameNoManufacturer name for get_drug_rebate_info
rebate_yearNoYear for get_drug_rebate_info
dataset_idNoDataset identifier for search_datasets
where_clauseNoSoQL WHERE clause for search_datasets
limitNoMaximum results to return (default: 100, max: 5000)
offsetNoPagination offset (default: 0)

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the data source and scope but fails to describe critical behavioral traits: whether operations are read-only or mutative, authentication requirements, rate limits, error handling, or response formats. The description adds minimal context beyond stating the API source, leaving significant gaps in understanding how the tool behaves.

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?

The description is appropriately concise with two sentences that efficiently convey the tool's scope and data source. It's front-loaded with the main purpose and avoids unnecessary details. However, it could be slightly more structured by explicitly listing the key operations or use cases.

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

Completeness2/5

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

Given the complexity (18 parameters, no annotations, no output schema), the description is incomplete. It covers the general purpose and scope but lacks essential context: behavioral traits, usage guidelines, output information, and practical constraints. For a multi-operation tool with many parameters, this minimal description leaves too many unanswered questions for effective agent use.

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 schema already documents all 18 parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema. It mentions general data types but doesn't explain parameter relationships, dependencies, or usage patterns. The baseline score of 3 reflects adequate coverage by the schema alone.

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 clearly states the tool's purpose as a 'unified tool for Medicaid data operations' that accesses specific data types (enrollment trends, drug pricing, quality measures, program performance) from a specific source (data.medicaid.gov via Socrata SODA API). It distinguishes scope by noting 'state-level aggregates (NOT provider-level like Medicare).' However, with no sibling tools, the differentiation aspect is less critical, and the description could be more specific about the exact operations.

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 description provides no explicit guidance on when to use this tool versus alternatives. It mentions the data source and scope but lacks information about prerequisites, performance characteristics, or typical use cases. With no sibling tools, there's no need to differentiate from alternatives, but the absence of any usage context or constraints leaves the agent without practical guidance.

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. Dates show when Glama detected each change.

  1. 1 tool updatev1.0.0
    • Changedmedicaid_info3 fields changed
      • changedInput schema / properties / method / description
        Previous value: -"The operation to perform: get_nadac_pricing (NADAC drug pricing lookup), compare_drug_pricing (multi-drug or temporal comparison), get_enrollment_trends (state monthly enrollment), compare_state_enrollment (multi-state comparison), get_drug_rebate_info (rebate program data), list_available_datasets (dataset catalog), search_datasets (custom SoQL query)"New value: +"The operation to perform: get_nadac_pricing (drug pricing), compare_drug_pricing (multi-drug comparison), get_enrollment_trends (state enrollment), compare_state_enrollment (multi-state comparison), get_drug_rebate_info (rebate program), search_state_formulary (CA/NY/TX/OH/IL formularies), get_drug_utilization (state prescriptions), get_federal_upper_limits (FUL pricing), list_available_datasets (catalog), search_datasets (custom query)"
      • changedInput schema / properties / method / enum
        Previous value: -[
        -  "get_nadac_pricing",
        -  "compare_drug_pricing",
        -  "get_enrollment_trends",
        -  "compare_state_enrollment",
        -  "get_drug_rebate_info",
        -  "list_available_datasets",
        -  "search_datasets"
        -]New value: +[
        +  "get_nadac_pricing",
        +  "compare_drug_pricing",
        +  "get_enrollment_trends",
        +  "compare_state_enrollment",
        +  "get_drug_rebate_info",
        +  "search_state_formulary",
        +  "get_drug_utilization",
        +  "get_federal_upper_limits",
        +  "list_available_datasets",
        +  "search_datasets"
        +]
      • changedInput schema / properties / method / examples
        Previous value: -[
        -  "get_nadac_pricing",
        -  "get_enrollment_trends",
        -  "compare_state_enrollment"
        -]New value: +[
        +  "get_nadac_pricing",
        +  "search_state_formulary",
        +  "get_drug_rebate_info"
        +]
  2. 1 tool update
    • First observedmedicaid_info

TDQS

B3.1/5.0
Disambiguation5/5

With only one tool, there is no ambiguity or overlap between tools, as there are no other tools to compare it against. The tool's purpose is clearly defined as a unified interface for Medicaid data operations.

Naming Consistency5/5

Since there is only one tool, naming consistency is inherently perfect. The tool name 'medicaid_info' follows a clear and consistent pattern, though no pattern can be established across multiple tools.

Tool Count2/5

A single tool for a server named 'Medicaid MCP Server' suggests a very thin surface. While it unifies multiple data operations, the scope of Medicaid data (enrollment, drug pricing, quality measures) likely warrants more granular tools for better agent usability and flexibility.

Completeness2/5

The tool covers multiple aspects (enrollment, pricing, quality) in a unified way, but this approach may lead to gaps in specific operations like filtering, updating, or detailed queries. For a Medicaid data domain, a single tool is likely insufficient for comprehensive coverage, as agents might need more targeted actions.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    C
    maintenance
    A comprehensive MCP server that provides access to U.S. FDA public datasets via the openFDA API, enabling querying of drug adverse events, labeling, recalls, approvals, shortages, NDC directory, and medical device regulatory data.
    10
    21
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    Provides unified access to drug formulary data from US ACA marketplace health insurance plans, enabling drug search, coverage details, restriction info, and plan comparison across thousands of plans.
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables searching the CMS Open Payments dataset for physician, company, product, and research payments using structured filters, with annual dataset discovery through the official DKAN API.
    11
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/openpharma-org/medicaid-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server