Health Claims MCP Server
Healthcare MCP + A2A Server (Mock)
A sample project demonstrating the Model Context Protocol (MCP) and Agent-to-Agent (A2A) communication for the health insurance claims domain.
mcp_server/— FastMCP server exposing 8 healthcare toolsa2a/— Custom A2A protocol with 4 specialized agents that coordinate over JSON-RPC 2.0run_a2a.py— Standalone HTTP server that runs all agents together
All data is synthetic — no real PHI, no external calls.
Official A2A SDK: The
a2a-sdk(v1.0.1+) is now the official Python library for the A2A protocol. This project contains a custom implementation built for training purposes.
Project Structure
healthcare-mcp/
├── mcp_server/ # MCP server
│ ├── __init__.py
│ └── server.py # FastMCP with 8 healthcare tools
├── a2a/ # A2A protocol implementation
│ ├── __init__.py
│ ├── message.py # JSON-RPC 2.0 message types
│ ├── a2a_protocol.py # Protocol engine, registry, routing
│ └── agents.py # 4 healthcare domain agents
├── run_a2a.py # Standalone A2A HTTP server
├── test_a2a_communication.py # A2A protocol tests (40 tests)
├── diagrams/
│ ├── mcp.mmd # MCP Gateway architecture
│ └── a2a.mmd # A2A messaging pattern
├── requirements.txt
└── pytest.iniSetup
Prerequisites: Python 3.10+
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txtRunning the MCP Server
The MCP server exposes healthcare tools to any MCP-compatible client.
stdio (default — for MCP clients)
python mcp_server/server.pyStreamable HTTP
export MCP_TRANSPORT=streamable-http
export FASTMCP_HOST=127.0.0.1
export FASTMCP_PORT=8000
python mcp_server/server.pyEndpoint: http://127.0.0.1:8000/mcp
SSE
export MCP_TRANSPORT=sse
python mcp_server/server.pyMCP Environment Variables
Variable | Default | Description |
|
| Transport: |
|
| Bind host for HTTP transports |
|
| Bind port for HTTP transports |
|
| URL path for streamable-http endpoint |
| (none) | Optional mount path prefix |
Running the A2A Server
The A2A server starts all four healthcare agents and exposes them over HTTP. It uses a local MCP client that calls the MCP tool functions in-process — no separate MCP server required.
python run_a2a.pyThe server starts on http://127.0.0.1:8001 by default.
A2A Environment Variables
Variable | Default | Description |
|
| Bind host |
|
| Bind port |
A2A Endpoints
Method | Path | Description |
|
| Agent card — capabilities and metadata for discovery |
|
| List all registered agents |
|
| Receive an A2A JSON-RPC 2.0 message |
Example: Discover agents
curl http://127.0.0.1:8001/.well-known/agent.json | python -m json.toolExample: Send an A2A message
curl -s -X POST http://127.0.0.1:8001/ \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "check_member_eligibility",
"params": {"member_id": "M-1001"},
"id": "req-001",
"sender": "external-client",
"recipient": "claims-agent",
"type": "request"
}' | python -m json.toolMCP Tools
Claims
Tool | Parameters | Description |
|
| List claims, optionally filtered by |
|
| Full claim with member, provider, and adjudication amounts |
|
| Submit an inquiry ticket |
Benefits
Tool | Parameters | Description |
|
| Deductible and OOP balances for the member's plan |
|
| Cost-sharing estimate |
Providers & Authorizations
Tool | Parameters | Description |
|
| Search providers by specialty |
|
| Submit prior auth request |
|
| Fetch current status of a prior auth |
A2A Agent System
Agents
Agent | ID | Role |
|
| Patient coordinator — checks eligibility, finds providers |
|
| Claims processor — eligibility, claim history, cost estimates |
|
| Network manager — provider search |
|
| Benefits specialist — cost calculations |
Communication Flow
MemberAssistAgent
├─ A2A → ClaimsAgent: "check_member_eligibility"
│ ├─ MCP: list_member_claims, get_member_benefits
│ └─ MCP: get_claim_detail
│
└─ A2A → ProviderAdvocateAgent: "search_network_providers"
└─ MCP: search_providers
ClaimsAgent
└─ A2A → BenefitsAgent: "calculate_member_responsibility"
└─ MCP: estimate_member_responsibilityUsing agents in code
import asyncio
from a2a import A2AProtocol, MemberAssistAgent, ClaimsAgent, ProviderAdvocateAgent, BenefitsAgent
async def main():
protocol = A2AProtocol()
member_assist = MemberAssistAgent(protocol, mcp_client)
claims = ClaimsAgent(protocol, mcp_client)
provider_advocate = ProviderAdvocateAgent(protocol, mcp_client)
benefits = BenefitsAgent(protocol, mcp_client)
for agent in [member_assist, claims, provider_advocate, benefits]:
await agent.register()
protocol.register_handler("check_member_eligibility", claims.handle_check_member_eligibility)
protocol.register_handler("search_network_providers", provider_advocate.handle_search_network_providers)
protocol.register_handler("calculate_member_responsibility", benefits.handle_calculate_member_responsibility)
eligibility = await member_assist.check_eligibility("M-1001")
providers = await member_assist.find_providers("primary care", "55401")
asyncio.run(main())Tests
pytest -v # all 40 tests
pytest test_a2a_communication.py # A2A protocol tests onlySee TEST_GUIDE.md for test documentation and QUICKSTART.md for filtering commands.
Mock Data Reference
Members
ID | Name | Plan |
| Jordan Lee |
|
| Casey Patel |
|
Plans
ID | Name | Deductible | Remaining | OOP Max | Remaining | In-network Coinsurance |
| Optum Choice PPO | $1,500 | $420 | $5,000 | $2,100 | 20% |
| Optum Select HMO | $500 | $120 | $3,000 | $980 | 10% |
Providers
ID | Name | Specialty | Network | ZIP |
| Northside Primary Care | primary care | in-network | 55401 |
| Lakeview Ortho Clinic | orthopedics | in-network | 55111 |
| Metro Imaging Center | radiology | out-of-network | 55415 |
Claims
ID | Member | Provider | Status | Billed |
| M-1001 | PR-2001 | paid | $250.00 |
| M-1001 | PR-2003 | pending | $980.00 |
| M-1002 | PR-2002 | denied (prior auth required) | $1,350.00 |
Prior Authorizations
ID | Member | Status |
| M-1002 | approved |
Architecture Diagrams
File | Description |
MCP Gateway routing to domain servers | |
A2A messaging between agents |
Render with Mermaid Live Editor or any Mermaid-compatible viewer.
MCP Inspector
MCP Inspector is a browser-based tool for calling MCP tools interactively.
npm install
npm startNotes
All data is in-memory and resets on restart.
estimate_member_responsibilityuses mock multipliers (75% in-network, 60% out-of-network). Not a guarantee of payment.No PHI, no external API calls, no persistent storage.
The official A2A Python SDK is
a2a-sdk>=1.0.1. Thea2a/module in this project is a custom educational implementation of the same protocol patterns.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/immannan/healthcare-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server