MCP Agents
Connect AI assistants to Patient Journey Intelligence using the Model Context Protocol (MCP) for standardized, secure access to medical tools and patient data.
Plug Healthcare Data into Any MCP-Compatible AI
Use Claude Desktop, custom MCP clients, or any MCP-compatible system to access clinical NLP, terminology servers, and patient data through a standardized protocol.
What is MCP?
Model Context Protocol (MCP) is an open standard developed by Anthropic that enables AI assistants to securely connect to external tools and data sources. Think of it as "USB for AI" – a universal interface that lets any MCP-compatible client (like Claude Desktop) access any MCP-compatible server.
Benefits for Healthcare AI:
- Standardization: One protocol works across all MCP-compatible tools and clients
- Security: Built-in authentication, encryption, and audit logging
- Composability: Mix and match tools from different providers
- Maintainability: Update tools independently without changing client code
Architecture
🏗️ MCP Architecture Overview
Three-Layer Architecture:
Sends requests to MCP servers using standardized protocol
Handles tool discovery, invocation, and result streaming
Exposes clinical NLP, terminology, and patient data as MCP tools
Setting Up MCP with Claude Desktop
Step 1: Install Claude Desktop
Download Claude Desktop from claude.ai/desktop (macOS or Windows).
Step 2: Configure MCP Server Connection
Create or edit the Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Add the Patient Journey Intelligence MCP server:
{
"mcpServers": {
"patient-journey": {
"command": "npx",
"args": [
"-y",
"@johnssnowlabs/mcp-server-patient-journey"
],
"env": {
"PJI_API_KEY": "your-api-key-here",
"PJI_API_URL": "https://your-instance.patient-journey.ai/api"
}
}
}
}
Step 3: Restart Claude Desktop
Close and reopen Claude Desktop. You should see a 🔨 (hammer) icon indicating MCP tools are available.
Step 4: Test the Connection
In Claude Desktop, try:
"What MCP tools are available?"
Claude should list the Patient Journey Intelligence tools like extract_clinical_entities, search_terminology, query_patient_data, etc.
Available MCP Tools
The Patient Journey Intelligence MCP server exposes the following tools. See the MCP Tools page for detailed schemas and examples.
extract_clinical_entities
Clinical NLP Extraction
Extract diagnoses, medications, procedures, lab results, and other clinical entities from free-text notes
search_terminology
Medical Terminology Lookup
Search SNOMED CT, RxNorm, LOINC, ICD-10, and other standard terminologies for codes and descriptions
query_patient_data
OMOP CDM Queries
Query patient demographics, conditions, medications, procedures, and observations from the OMOP CDM
build_cohort
Patient Cohort Builder
Define inclusion/exclusion criteria to identify patient populations for research or quality measurement
check_drug_interactions
Drug Interaction Checker
Identify potential adverse interactions between medications using RxNorm and clinical databases
calculate_clinical_measure
Quality Measure Calculator
Calculate HEDIS, CMS, and custom quality measures for patient populations
Example Agent Workflows
Example 1: Extract and Code Diagnoses
User Prompt in Claude Desktop:
"Here's a clinical note:\n\n'Patient presents with acute exacerbation of COPD. Currently experiencing increased dyspnea and productive cough with green sputum. No fever. Lung exam reveals diffuse wheezing bilaterally.'\n\nExtract the diagnoses and find their ICD-10 codes."
Claude's Tool Usage:
- Calls
extract_clinical_entitieson the note text - Receives:
["COPD exacerbation", "dyspnea", "productive cough"] - Calls
search_terminologyfor each diagnosis to find ICD-10 codes - Returns formatted results:
Diagnoses and ICD-10 Codes:
- COPD exacerbation → J44.1 (Chronic obstructive pulmonary disease with acute exacerbation)
- Dyspnea → R06.00 (Dyspnea, unspecified)
- Productive cough → R05.9 (Cough, unspecified)
Example 2: Check Drug Interactions
User Prompt:
"A patient is taking warfarin 5mg daily. The physician wants to add ibuprofen 400mg TID for back pain. Are there any interactions?"
Claude's Tool Usage:
- Calls
check_drug_interactionswith medications:["warfarin", "ibuprofen"] - Receives interaction alert:
{
"severity": "major",
"description": "NSAIDs like ibuprofen may increase anticoagulant effect of warfarin, increasing bleeding risk",
"recommendation": "Consider alternative analgesic (e.g., acetaminophen) or monitor INR closely if ibuprofen is necessary"
}
- Returns clear explanation to user with clinical recommendation
Example 3: Build Research Cohort
User Prompt:
"I need to identify all patients diagnosed with Type 2 Diabetes between 2020-2023 who are currently on metformin and have an HbA1c > 8% in the last 3 months."
Claude's Tool Usage:
- Calls
build_cohortwith criteria:
{
"inclusion": [
{"condition": "Type 2 Diabetes", "date_range": "2020-01-01 to 2023-12-31"},
{"medication": "metformin", "status": "active"},
{"observation": "HbA1c", "value": ">8%", "date_range": "last 3 months"}
]
}
- Receives cohort ID and patient count:
{"cohort_id": "cohort_12345", "patient_count": 247} - Returns summary and offers to export or analyze the cohort further
Custom MCP Client Development
You can build your own MCP clients to integrate Patient Journey Intelligence into custom applications.
Python Example
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
# Connect to Patient Journey Intelligence MCP server
server_params = StdioServerParameters(
command="npx",
args=["-y", "@johnssnowlabs/mcp-server-patient-journey"],
env={
"PJI_API_KEY": "your-api-key",
"PJI_API_URL": "https://your-instance.patient-journey.ai/api"
}
)
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
# Initialize connection
await session.initialize()
# List available tools
tools = await session.list_tools()
print(f"Available tools: {[tool.name for tool in tools]}")
# Extract clinical entities from a note
result = await session.call_tool(
"extract_clinical_entities",
arguments={
"text": "Patient diagnosed with hypertension and started on lisinopril 10mg daily.",
"entity_types": ["PROBLEM", "DRUG"]
}
)
print(f"Extracted entities: {result.content}")
TypeScript Example
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
// Create transport to MCP server
const transport = new StdioClientTransport({
command: "npx",
args: ["-y", "@johnssnowlabs/mcp-server-patient-journey"],
env: {
PJI_API_KEY: "your-api-key",
PJI_API_URL: "https://your-instance.patient-journey.ai/api"
}
});
// Create client and connect
const client = new Client({
name: "custom-healthcare-agent",
version: "1.0.0"
}, {
capabilities: {}
});
await client.connect(transport);
// Search medical terminology
const result = await client.callTool({
name: "search_terminology",
arguments: {
query: "diabetes mellitus",
terminology: "SNOMED_CT",
limit: 5
}
});
console.log("Search results:", result.content);
Authentication & Security
🔑 API Key Authentication
MCP server authenticates to platform using API keys with configurable permissions (read-only, read-write, admin)