# MCP Server Status
## Current Status: ✅ PRODUCTION READY
**Last Updated**: 2025-12-17
**Version**: v2.15.0
## What's Working
### ✅ AWS IRIS Database
- **Host**: 13.218.19.254:32782 (Docker)
- **Namespace**: %SYS
- **Connection**: ✅ Working from public network
- **Data**:
- 51 FHIR DocumentReference resources with 1024-dim NV-CLIP embeddings
- 83 medical entities (symptoms, conditions, medications, etc.)
- 540 entity relationships
- 50 MIMIC-CXR chest X-rays with NV-CLIP embeddings
- ~5 agent memories with semantic embeddings
### ✅ MCP Server (fhir_graphrag_mcp_server.py)
- **Protocol**: Model Context Protocol (MCP) via JSON-RPC 2.0
- **Status**: ✅ Running and tested
- **Tools Available**: 14+ tools total
#### Search Tools (4)
- `search_fhir_documents` - Full-text search of clinical notes
- `search_knowledge_graph` - Entity-based GraphRAG search
- `hybrid_search` - Combined FHIR + GraphRAG with RRF fusion
- `search_medical_images` - NV-CLIP semantic image search
#### Data Retrieval (4)
- `get_document_details` - Retrieve full FHIR document with decoded clinical notes
- `get_entity_relationships` - Multi-hop graph traversal from seed entity
- `get_entity_statistics` - Knowledge graph statistics and distribution
- `get_memory_stats` - Agent memory system statistics
#### Agent Memory (2)
- `remember_information` - Store semantic memories (corrections, knowledge, preferences)
- `recall_information` - Semantic search over agent memories
#### Visualization Tools (5)
- `plot_entity_distribution` - Pie/bar chart of entity types
- `plot_symptom_frequency` - Top N symptoms bar chart
- `plot_patient_timeline` - Timeline of patient encounters
- `plot_entity_network` - Network graph of entity relationships
- `visualize_graphrag_results` - Interactive GraphRAG search results
### ✅ Streamlit Application (v2.15.0)
#### streamlit_app.py ⭐ MAIN APPLICATION
- **Port**: 8501
- **Status**: ✅ Running
- **URL**: http://13.218.19.254:8501
- **Architecture**: Agentic - Claude autonomously calls MCP tools
- **Features**:
- Claude tool use with autonomous decision-making
- Interactive Plotly charts render IN the chat
- Multi-turn tool use loop
- Auto memory recall before each query
- Interactive force-directed graph visualizations
- GraphRAG Details Panel with entity, graph, and tool sections
- App Settings with debug transparency toggles
- Memory editor in sidebar
- Medical image display with DICOM support
### ✅ LLM Configuration
- **Model**: Claude Sonnet 4.5 (global.anthropic.claude-sonnet-4-5-20250929-v1:0)
- **Provider**: AWS Bedrock (primary), OpenAI (fallback), NVIDIA NIM (fallback)
- **Region**: us-east-1
- **Temperature**: 0.3 (for medical accuracy)
- **Max Tokens**: 2000-4000
- **Tool Use**: ✅ Working (agentic chat)
### ✅ NVIDIA NIM Services
- **NV-CLIP**: Port 8002 (1024-dim multimodal embeddings)
- **SSH Tunnel**: `ssh -f -N -L 8002:localhost:8002 -i ~/.ssh/fhir-ai-key-recovery.pem ubuntu@13.218.19.254`
## Known Issues
### ⚠️ None Currently
All previously identified bugs have been fixed:
- ✅ Preset buttons work (fixed with pending_query pattern)
- ✅ Chat input no longer disappears after button clicks
- ✅ Tool use properly implemented (Claude autonomously decides)
- ✅ Charts render in chat conversation
- ✅ AWS connection working from public network
- ✅ NV-CLIP embeddings generating real 1024-dim vectors
- ✅ Memory search with semantic vector matching
- ✅ GraphRAG Details Panel with interactive Plotly graphs
## Architecture Summary
```
User Question (Streamlit UI v2.15.0)
↓
Auto Memory Recall (recall relevant past interactions)
↓
Claude Sonnet 4.5 (via AWS Bedrock/OpenAI/NIM)
↓
Decides which MCP Tools to call
↓
MCP Server (fhir_graphrag_mcp_server.py)
↓
AWS IRIS Database (13.218.19.254:32782)
├─ SQLUser.ClinicalNoteVectors (51 docs)
├─ SQLUser.Entities (83 entities)
├─ SQLUser.EntityRelationships (540 rels)
├─ VectorSearch.MIMICCXRImages (50 images)
└─ SQLUser.AgentMemoryVectors (~5 memories)
↓
Results returned to Claude
↓
Claude synthesizes natural language answer
↓
Display to user (with charts, graphs, images if applicable)
```
## Quick Start
### Start Main Application
```bash
cd mcp-server
streamlit run streamlit_app.py --server.headless true --server.port 8501
```
Then visit: http://localhost:8501
### Environment Variables
```bash
export AWS_PROFILE=AWS_ACCOUNT_ID_PowerUserPlusAccess
export IRIS_HOST=13.218.19.254
export IRIS_PORT=32782
export IRIS_NAMESPACE=%SYS
export IRIS_USERNAME=_SYSTEM
export IRIS_PASSWORD=SYS
export NVCLIP_BASE_URL=http://localhost:8002/v1
```
### Test MCP Server Standalone
```bash
# In Claude Desktop, add to config:
{
"mcpServers": {
"fhir-graphrag": {
"command": "python3",
"args": ["/path/to/medical-graphrag-assistant/mcp-server/fhir_graphrag_mcp_server.py"]
}
}
}
```
## Performance Metrics
- **Vector Search**: ~1.0s for 30 results
- **Text Search**: <20ms for 23 results
- **Graph Search**: <15ms for entity matches
- **Full Multi-Modal (RRF)**: ~0.24s
- **Fast Query (text+graph)**: ~6ms
- **Chart Generation**: <200ms for visualization tools
- **Claude Response**: 1-3 seconds for synthesis
- **End-to-End Query**: 2-5 seconds typical
## Security Notes
- ✅ AWS IRIS accessible from public network (required for demo)
- ⚠️ No authentication on Streamlit app (add for production)
- ⚠️ Database credentials via env vars (secure for production)
- ✅ Claude API via AWS Bedrock (credentials managed by AWS CLI)
## Version History
### v2.15.0 (December 2025)
- Enhanced details panel with entity, graph, and tool sections
- Interactive Plotly-based graph visualization
- Tool execution timeline with parameters and results
- App Settings with debug transparency toggles
- Mobile-responsive design with fallback displays
- Playwright MCP UX test suite for validation
### v2.14.0 (December 2025)
- Auto memory recall before each query for tool guidance
- Interactive force-directed graphs with streamlit-agraph
- Memory display in execution log
- NetworkX-powered graph layouts
### v2.13.0 (December 2025)
- Multiple LLM provider support (NIM > OpenAI > Bedrock fallback)
- OneDrive cloud backup integration
- Improved memory tool with correction guidance
### v2.12.0 (November 2025)
- Agent memory system with pure IRIS vectors
- Medical image search with NV-CLIP embeddings
- Memory editor UI in Streamlit sidebar
- Real NV-CLIP vectors (not mocks)
## References
- **MCP Specification**: https://modelcontextprotocol.io
- **Claude Tool Use**: https://docs.anthropic.com/claude/docs/tool-use
- **AWS Bedrock**: https://aws.amazon.com/bedrock/
- **Streamlit**: https://streamlit.io
- **Plotly**: https://plotly.com/python/
- **NVIDIA NIM**: https://developer.nvidia.com/nim