How langcare/langcare-mcp-fhir works
LangCare is an MCP server that proxies AI-agent requests to FHIR R4 electronic medical records: clients invoke MCP tools, the server dispatches generic read/search/create/update operations, and provider-specific clients reach the configured FHIR backend. The repository also includes interactive MCP apps, a Python CLI, and a healthcare voice agent. The graph follows documented and excerpted wiring; unsampled subsystems are included only where their presence and role are documented, with evidence limits reflected in omitted links.
Main entry points: main.go Server Startup · tools FHIR Operations · server.go MCP Tool Server · transport HTTP and stdio
Components 19
MCP Server
- Configuration
internal/config/config.go - Server Startup
cmd/server/main.go - MCP Tool Server
internal/mcp/server.go - HTTP and stdio
internal/transport - HTTP Security
internal/middleware - Tool Registry
internal/tools/registry.go - PHI Audit Logging
internal/audit/logger.go
FHIR Access
- FHIR Operations
internal/tools - FHIR Client Factory
internal/fhir/client.go - FHIR Providers
internal/fhir/providers
Client Interfaces
- LangCare CLI
cli/langcare/cli.py - CLI MCP Client
cli/langcare/mcp_client.py - FHIR Explorer
apps/fhir-explorer/src/app.tsx - Patient Chart Review
apps/patient-chart-review/src/app.tsx
Voice Agent
- Voice Assistant
pipecat-agent/server/bot.py - Clinical Prompt
pipecat-agent/server/prompts/base_prompt.py - Voice Webhook
pipecat-agent/webhook/server.py
Other components
- AI Agent
- FHIR R4 EMR
Connections 24
- AI Agent → HTTP and stdio: calls MCP tools
README.md - Server Startup → Configuration: loads
cmd/server/main.go - Server Startup → FHIR Client Factory: creates
cmd/server/main.go - Server Startup → PHI Audit Logging: creates
cmd/server/main.go - Server Startup → Tool Registry: registers tools
cmd/server/main.go - Server Startup → MCP Tool Server: creates
cmd/server/main.go - Server Startup → HTTP and stdio: starts
cmd/server/main.go - HTTP and stdio → MCP Tool Server: serves
internal/transport/http.go - HTTP and stdio → HTTP Security: wraps with
internal/transport/http.go - MCP Tool Server → Tool Registry: dispatches through
internal/mcp/server.go - Tool Registry → FHIR Operations: registers
- FHIR Operations → FHIR Client Factory: calls FHIR methods
internal/tools/fhir_search.go - FHIR Operations → PHI Audit Logging: logs access
internal/tools/fhir_search.go - FHIR Client Factory → FHIR Providers: selects provider
internal/fhir/client.go - FHIR Providers → FHIR R4 EMR: proxies requests
README.md - LangCare CLI → CLI MCP Client: uses
cli/langcare/cli.py - CLI MCP Client → HTTP and stdio: sends HTTP requests
- FHIR Explorer → FHIR Operations: calls FHIR tools
README.md - Patient Chart Review → FHIR Operations: calls FHIR tools
apps/patient-chart-review/src/app.tsx - MCP Tool Server → FHIR Explorer: registers app resource
internal/mcp/server.go - MCP Tool Server → Patient Chart Review: registers app resource
internal/mcp/server.go - Voice Assistant → Clinical Prompt: uses prompt
pipecat-agent/server/bot.py - Voice Assistant → FHIR Operations: calls FHIR tools
pipecat-agent/server/bot.py - Voice Webhook → Voice Assistant: starts session