Agent Care is a Model Context Protocol (MCP) server that facilitates integration between AI assistants and Electronic Medical Record (EMR) systems like Cerner and Epic. It provides healthcare tools for interacting with FHIR data, accessing medical resources, and performing clinical analyses through Claude Desktop or Goose Desktop.
Clone the repository:
git clone [agentcare-mcp-github path]
cd agentcare-mcp
Install dependencies:
npm install
Build the project:
npm run build
Create environment configuration for your EMR system.
Create a .env
file with the following configuration:
OAUTH_CLIENT_ID="YOUR_CLIENT_ID"
OAUTH_CLIENT_SECRET="YOUR_CLIENT_SECRET"
OAUTH_TOKEN_HOST="https://authorization.cerner.com"
OAUTH_AUTHORIZE_PATH="/tenants/ec2458f2-1e24-41c8-b71b-0e701af7583d/protocols/oauth2/profiles/smart-v1/personas/provider/authorize"
OAUTH_AUTHORIZATION_METHOD="header"
OAUTH_TOKEN_PATH="/tenants/ec2458f2-1e24-41c8-b71b-0e701af7583d/hosts/api.cernermillennium.com/protocols/oauth2/profiles/smart-v1/token"
OAUTH_AUDIENCE="https://fhir-ehr.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d"
OAUTH_CALLBACK_URL="http://localhost:3456/oauth/callback"
OAUTH_SCOPES="user/Patient.read user/Condition.read user/Observation.read user/MedicationRequest.read user/AllergyIntolerance.read user/Procedure.read user/CarePlan.read user/CareTeam.read user/Encounter.read user/Immunization.read"
OAUTH_CALLBACK_PORT="3456"
FHIR_BASE_URL="https://fhir-ehr.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d"
PUBMED_API_KEY="your_pubmed_api_key"
CLINICAL_TRIALS_API_KEY="your_trials_api_key"
FDA_API_KEY="your_fda_api_key"
Create a .env
file with the following configuration:
OAUTH_CLIENT_ID="YOUR_CLIENT_ID"
OAUTH_CLIENT_SECRET=""
OAUTH_TOKEN_HOST="https://fhir.epic.com"
OAUTH_AUTHORIZE_PATH="/interconnect-fhir-oauth/oauth2/authorize"
OAUTH_AUTHORIZATION_METHOD="body"
OAUTH_TOKEN_PATH="/interconnect-fhir-oauth/oauth2/token"
OAUTH_AUDIENCE="https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4"
OAUTH_CALLBACK_URL="http://localhost:3456/oauth/callback"
OAUTH_SCOPES="user/Patient.read user/Observation.read user/MedicationRequest.read user/Condition.read user/AllergyIntolerance.read user/Procedure.read user/CarePlan.read user/CareTeam.read user/Encounter.read user/Immunization.read"
OAUTH_CALLBACK_PORT="3456"
FHIR_BASE_URL="https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4"
PUBMED_API_KEY="your_pubmed_api_key"
CLINICAL_TRIALS_API_KEY="your_trials_api_key"
FDA_API_KEY="your_fda_api_key"
To use Agent Care with Claude Desktop, modify the Claude Desktop configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/your-username/Desktop"
]
},
"agent-care": {
"command": "node",
"args": [
"/Users/your-username/path-to-agent-care/agent-care-mcp/build/index.js"
],
"env": {
"OAUTH_CLIENT_ID": "YOUR_CLIENT_ID",
"OAUTH_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
"OAUTH_TOKEN_HOST": "YOUR_TOKEN_HOST",
"OAUTH_TOKEN_PATH": "YOUR_TOKEN_PATH",
"OAUTH_AUTHORIZE_PATH": "YOUR_AUTHORIZE_PATH",
"OAUTH_AUTHORIZATION_METHOD": "YOUR_AUTH_METHOD",
"OAUTH_AUDIENCE": "YOUR_AUDIENCE",
"OAUTH_CALLBACK_URL": "YOUR_CALLBACK_URL",
"OAUTH_SCOPES": "YOUR_SCOPES",
"OAUTH_CALLBACK_PORT": "YOUR_PORT",
"FHIR_BASE_URL": "YOUR_FHIR_URL",
"PUBMED_API_KEY": "YOUR_PUBMED_KEY",
"CLINICAL_TRIALS_API_KEY": "YOUR_TRIALS_KEY",
"FDA_API_KEY": "YOUR_FDA_KEY"
}
}
}
}
You can test the MCP server using the MCP Inspector tool:
npm install -g @modelcontextprotocol/inspector
mcp-inspector build/index.js
Then open http://localhost:5173 in your browser.
Goose Desktop is an alternative to Claude Desktop that works with MCP servers and can be configured to use various AI models. Configure Goose Desktop to use Agent Care by adding it as an extension and specifying the path to the built server:
/Users/your-username/path-to-agent-care/agent-care-mcp/build/index.js
find_patient
- Search for patientsget_patient_observations
- Retrieve vital signsget_patient_conditions
- Get active conditionsget_patient_medications
- Get current medicationsget_patient_encounters
- Get clinical encountersget_patient_allergies
- Get allergies and intolerancesget_vital_signs
- Get vital signsget_lab_results
- Get laboratory resultsclinical_query
- Execute custom FHIR queriessearch-pubmed
- Search PubMed articlessearch-trials
- Find relevant clinical trialsdrug-interactions
- Check drug-drug interactionsIf you encounter port conflicts with port 3456 (used for OAuth callbacks), you can terminate the conflicting process:
kill -9 $(lsof -t -i:3456)
For sandbox/development environments:
portal
Password: portal
FHIRTWO
Password: EpicFhir11!
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.