Medicaid MCP Server
Provides access to Medicaid public data including drug pricing (NADAC), state enrollment trends, federal upper limits, drug rebate information, and utilization statistics through a hybrid CSV caching and DKAN API approach.
README
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)
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)
- Production-Ready - Type-safe implementation, error handling, rate limiting, efficient caching
Installation
npm install @openpharma/medicaid-mcp-server
Or from source:
git clone https://github.com/openpharma-org/medicaid-mcp-server.git
cd medicaid-mcp-server
npm install
Usage
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"medicaid": {
"command": "node",
"args": ["/path/to/medicaid-mcp-server/src/index.js"]
}
}
}
Other MCP Clients
node /path/to/medicaid-mcp-server/src/index.js
API Reference
Unified Tool: medicaid_info
The server provides a single tool with multiple methods:
State Formulary Search
{
"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 namegeneric_name: Generic drug namendc: 11-digit NDC coderequires_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 codelimit: Max results (default: 10)
Enrollment Trends
{
"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",
"ndc": "00002143380",
"limit": 10
}
State Drug Utilization
{
"method": "get_state_drug_utilization",
"state": "CA",
"drug_name": "OZEMPIC",
"year": 2024,
"quarter": 4,
"limit": 10
}
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 |
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 |
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)
Testing
# Test Illinois formulary (cross-state enrichment)
node test-illinois-formulary.js
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
Policy & Economics
- Medicaid expansion impact analysis
- State enrollment forecasting and growth trends
- Utilization pattern analysis by geography
Limitations
- Provider-level utilization data not available (use Medicare MCP for provider analytics)
- Individual beneficiary claims require CMS Data Use Agreement (T-MSIS/TAF)
- No HCPCS procedure-level analysis (state-level aggregate data only)
Development
# Install dependencies
npm install
# Run tests
npm test
# Start server
npm start
License
MIT
Author
OpenPharma Organization
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.