MCP Connectors¶
OpenMed can discover remote MCP servers and expose their tools inside the same agent loop as the native tool registry. MCP is optional, user-configured, and separate from the built-in native tools.
No MCP servers are configured by default.
Native vs MCP¶
These capabilities already ship natively and do not require MCP:
- extraction and PII tooling such as
extract_entities,extract_pii, anddeidentify_text - terminology and literature tools such as
search_pubmed,search_icd10_codes,lookup_cpt_code,lookup_snomed_code, and HCC helpers - deterministic workflows
- built-in skills
Use MCP for external systems that are not already part of the native OpenMed surface, such as internal policy services, registries, payer tools, institutional knowledge hubs, or other organization-specific systems.
Configuration file¶
Default path:
Override it with:
OpenMed bootstraps the file automatically on first MCP-aware CLI or TUI use.
Schema:
{
"version": 1,
"servers": [
{
"id": "guidelines_hub",
"name": "Guidelines Hub",
"url": "https://example.com/mcp",
"enabled": true,
"timeout_seconds": 20,
"extra_headers": {}
}
]
}
Validation rules:
urlmust be HTTPSidmust start with a letter, use lowercase letters, digits, or underscores, and be at most 63 characterstimeout_secondsmust be between 1 and 120
Values in extra_headers are stored in this file as plain text. To keep a token out of the file, use the header override under Environment overrides.
CLI management¶
openmed mcp list
openmed mcp add guidelines_hub https://example.com/mcp --name "Guidelines Hub"
openmed mcp enable guidelines_hub
openmed mcp disable guidelines_hub
openmed mcp enable --all
openmed mcp disable --all
openmed mcp set-url guidelines_hub https://new-url.example.com/mcp
openmed mcp remove guidelines_hub
openmed mcp doctor
openmed mcp doctor --all
openmed mcp doctor guidelines_hub
add enables the new server. doctor checks enabled servers unless you name one or pass --all. It is the quickest way to confirm that a URL is actually a live JSON-RPC MCP endpoint rather than a marketing page or docs site.
The global --mcp-enabled flag enables every configured server before the command runs, and that change stays in the config file.
Environment overrides¶
For a server ID such as guidelines_hub, OpenMed checks:
OPENMED_MCP_GUIDELINES_HUB_ENABLEDOPENMED_MCP_GUIDELINES_HUB_URLOPENMED_MCP_GUIDELINES_HUB_HEADERS_JSON
Example:
export OPENMED_MCP_GUIDELINES_HUB_ENABLED=true
export OPENMED_MCP_GUIDELINES_HUB_URL=https://example.com/mcp
export OPENMED_MCP_GUIDELINES_HUB_HEADERS_JSON='{"Authorization":"Bearer ..."}'
How MCP tools appear¶
Discovered remote tools are namespaced as:
They are added to the agent's tool list during discovery. Characters a tool name cannot use are replaced, and a name longer than 64 characters is shortened.
Discovery and caching¶
OpenMed discovers tools from enabled servers at runtime and caches the result.
Cache behavior:
- cache file:
~/.config/openmed/mcp_tools_cache.json - override path:
OPENMED_MCP_TOOLS_CACHE_PATH - override TTL:
OPENMED_MCP_TOOLS_CACHE_TTL_SECONDS(default 3600)
The cache exists to reduce repeated startup/discovery overhead when MCP is enabled.
TUI usage¶
In the TUI:
- type
#to browse enabled MCP namespaces - run
/mcpto inspect configured servers, URLs, enabled state, and discovered-tool counts
If openmed mcp doctor reports that a server returned HTML, the configured URL is not the live MCP JSON-RPC endpoint.
Boundary notes¶
MCP is an extension surface, not a replacement for the native tool inventory.
Important trust boundary notes:
- remote MCP servers are user-configured and open-ended, so they are not counted among the built-in native tools
- OpenMed treats discovered MCP tools as PHI-gated, so
deidandstrictmodes refuse them. Infullmode, the agent can send clinical text to them. This is not a substitute for your own deployment, policy, or compliance controls - once you add a remote MCP server, its network, auth, retention, and privacy behavior become part of your real system boundary
You can add MCP servers and local skills. There is no CLI for registering new native medical backends.