fhir-mcp-server-medagentbench
@mike-holcomb
An implementation of Model Context Protocol server for use with MedAgentBench (FHIR request generation)
Overview
What is fhir-mcp-server-medagentbench?
A Python-based MCP server that simulates FHIR API interactions for the MedAgentBench environment. Instead of making real HTTP requests, it returns a textual representation of the HTTP request that would have been made, enabling testing of MedAgentBench agents without a live FHIR endpoint.
How to use fhir-mcp-server-medagentbench?
Install with Poetry (requires Python >= 3.10). Set the FHIR_BASE_URL environment variable to your desired FHIR server base URL. Run fhir-mcp-server-medagentbench to start the server, which listens for MCP requests over standard input/output.
Key features of fhir-mcp-server-medagentbench
- Implements MCP handlers: list_resources, read_resource, list_tools, call_tool.
- Simulates FHIR operations: search_fhir, read_fhir, create_fhir_resource.
- No actual HTTP requests; returns textual request representations.
- Uses mcp-server library for MCP communication.
- Configured and packaged with Poetry.
- Includes asynchronous unit tests with pytest and pytest-asyncio.
Use cases of fhir-mcp-server-medagentbench
- Testing MedAgentBench agents without a live FHIR endpoint.
- Developing and debugging FHIR-based workflows offline.
- Validating simulated FHIR request generation for agent behavior.
FAQ from fhir-mcp-server-medagentbench
What does this server simulate?
It simulates FHIR operations by returning the HTTP request that would have been made (e.g., GET https://fhir.example.com/Patient/123 or a POST with body) instead of actually calling a FHIR API.
What runtime dependencies are required?
You need Python >= 3.10 and Poetry. The server depends on the mcp-server library and requires the FHIR_BASE_URL environment variable to be set.
Where does the data come from?
No external data is fetched. The server only returns textual request representations based on the configured FHIR_BASE_URL. There is no actual FHIR resource storage.
What transports or authentication are supported?
The server communicates over standard input/output for MCP. No authentication or specific transport options are mentioned.
Are there any known limitations?
Currently the simulated resources only include CapabilityStatement; the server does not make real network requests and only returns request strings.