atlas_mcp
Enables use of locally hosted LLMs via Ollama for AI-powered search and conversation over FHIR clinical documents, supporting local-first deployment.
Enables use of OpenAI's models (e.g., GPT-4) as the LLM provider for AI-powered search and conversation over FHIR clinical documents.
Provides persistent storage and vector search capabilities using PostgreSQL with pgvector extension, enabling semantic retrieval and document management for FHIR resources.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@atlas_mcpWhat medications is patient P123 currently taking?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
atlas_mcp
An MCP server that brings AI-powered search and conversation to your FHIR clinical documents.
What It Does
atlas_mcp is a developer-focused MCP server for working with FHIR data. It lets you embed FHIR resources, search them with semantic retrieval, and talk to an AI agent that can answer questions with citations from your clinical documents.
AI agent that understands and queries FHIR documents
Semantic search with cross-encoder reranking for accuracy
Multi-turn conversations with session memory
Local-first LLM support (Ollama), plus cloud options (OpenAI, Anthropic, Bedrock)
Key Features
Native FHIR resource handling and metadata extraction
Vector embeddings plus access to full documents
Built-in validation and HIPAA-aware prompts
YAML + environment configuration for easy setup
Quick Start (5 Minutes)
1) Clone and Install
git clone https://github.com/rsanandres/atlas_mcp.git
cd atlas_mcp
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt2) Set Up PostgreSQL + pgvector
createdb hc_ai
psql -U postgres -d hc_ai -f scripts/setup_db.sql3) Configure Environment
cp env.example .env
# Edit .env and set DB_PASSWORD at minimum4) Start Ollama (Local-First)
ollama pull mxbai-embed-large:latest
ollama pull llama3
ollama serve5) Run the Server
# stdio transport (Claude Desktop, Cursor)
python server.py
# HTTP transport
python server.py --transport streamable-http --port 8000Architecture
flowchart TB
subgraph clients [MCPClients]
Claude[Claude Desktop]
Cursor[Cursor IDE]
Custom[Custom Client]
end
subgraph server [AtlasMcpServer]
MCP[MCP Protocol Layer]
Tools[Tool Registry]
Agent[LangGraph Agent]
Reranker[Cross-Encoder Reranker]
Session[Session Store]
end
subgraph backends [Backends]
LLM[LLM Provider]
PG[(PostgreSQL + pgvector)]
Embed[Embedding Service]
end
clients --> MCP
MCP --> Tools
Tools --> Agent
Tools --> Reranker
Tools --> Session
Agent --> LLM
Agent --> PG
Reranker --> PG
Embed --> PGAvailable Tools
Agent tools
agent_query,agent_clear_session,agent_health
Retrieval tools
rerank,rerank_with_context,batch_rerank
Session tools
session_append_turn,session_get,session_update_summary,session_clear
Embeddings tools
ingest,embeddings_health,db_stats,db_queue,db_errors
Example Use Cases
Querying patient records: “What medications is patient P123 taking?”
Lab results analysis: “Show abnormal lab values from the last 30 days.”
Clinical notes search: “Find notes mentioning diabetes management.”
Medication history: “Has this patient been prescribed blood thinners?”
Configuration
Tool Configuration
Enable/disable tools in config.yaml:
tools:
agent_query:
enabled: true
rerank:
enabled: true
ingest:
enabled: falseLLM Providers (Local-First)
Ollama:
LLM_PROVIDER=ollama,LLM_MODEL=llama3OpenAI:
LLM_PROVIDER=openai,OPENAI_API_KEY,OPENAI_MODEL=gpt-4o-miniAnthropic:
LLM_PROVIDER=anthropic,ANTHROPIC_API_KEY,ANTHROPIC_MODEL=claude-3-5-sonnet-20241022Bedrock:
LLM_PROVIDER=bedrock,AWS_REGION,LLM_MODEL=haiku|sonnet|opus
Environment Variables
See env.example for all options. Core requirements:
Variable | Description | Default |
| PostgreSQL host |
|
| PostgreSQL port |
|
| Database name |
|
| Database password | (required) |
|
|
|
|
|
|
Debug Logging
HC_AI_DEBUG=trueTimeouts
AGENT_TIMEOUT=60
RERANK_TIMEOUT=30Connecting to MCP Clients
Claude Desktop
{
"mcpServers": {
"atlas": {
"command": "python",
"args": ["/path/to/atlas_mcp/server.py"],
"env": {}
}
}
}Cursor IDE
{
"atlas": {
"command": "python",
"args": ["/path/to/atlas_mcp/server.py"]
}
}Example Usage
result = await client.call_tool("agent_query", {
"query": "What medications is patient P123 currently taking?",
"session_id": "session-001",
"patient_id": "P123"
})Requirements
Python 3.11+
PostgreSQL 14+ with pgvector
Ollama (or cloud LLM credentials)
Disclaimer
This project is HIPAA-aware, but it is not HIPAA-certified. It is intended for development and testing only. You are responsible for compliance and security if you use it in production.
Author
Created by @rsanandres. Issues and feedback welcome. Pull requests are reviewed.
License
MIT License. See LICENSE.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/rsanandres/atlas_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server