MCP server for the NIH UMLS (Unified Medical Language System) API
Project description
NIH UMLS MCP Server
An MCP (Model Context Protocol) server that provides access to the NIH UMLS (Unified Medical Language System) API. This server enables AI models to search medical terminology, look up concept definitions, explore relationships between medical concepts, and map codes between different medical coding systems.
Overview
The Unified Medical Language System (UMLS) integrates biomedical terminology from many sources and provides a mapping structure among these vocabularies. It includes over 200 source vocabularies and classification systems, containing millions of names for medical concepts.
This MCP server exposes the UMLS REST API functionality through standardized MCP tools, making it easy for AI assistants to:
- Search for medical concepts and terminology
- Get detailed concept information and definitions
- Explore relationships between concepts (parent/child hierarchies)
- Map codes between different medical coding systems (e.g., ICD-10 ↔ SNOMED CT)
- Look up specific codes from vocabularies like ICD-10, SNOMED, RxNorm, LOINC, etc.
Prerequisites
- UMLS API Key: You need a UMLS API key to use this server. To obtain one:
- Visit https://uts.nlm.nih.gov/uts/signup-login
- Create an account or sign in
- Go to "My Profile" and generate an API key
- The key is free for users who agree to the UMLS license terms
Installation
Option 1: Install from source
# Clone the repository
git clone https://github.com/feordin/nih-umls-mcp.git
cd nih-umls-mcp
# Install the package
pip install -e .
Option 2: Install with uv (recommended for MCP usage)
# Using uvx (no installation needed)
uvx nih-umls-mcp
Configuration
The server requires your UMLS API key to be set as an environment variable:
export UMLS_API_KEY="your-api-key-here"
Configuring with Claude Desktop
To use this server with Claude Desktop, add the following to your Claude Desktop configuration file:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"nih-umls": {
"command": "python",
"args": ["-m", "nih_umls_mcp.server"],
"env": {
"UMLS_API_KEY": "your-api-key-here"
}
}
}
}
Or if using uvx:
{
"mcpServers": {
"nih-umls": {
"command": "uvx",
"args": ["nih-umls-mcp"],
"env": {
"UMLS_API_KEY": "your-api-key-here"
}
}
}
}
Available Tools
The server provides the following MCP tools:
1. search_umls
Search for medical concepts, terms, or codes in the UMLS.
Parameters:
query(string, required): Search term, medical concept, or codesearch_type(string, optional): Type of search - "exact", "words" (default), "leftTruncation", "rightTruncation", "normalizedString", "approximate"page_size(integer, optional): Number of results (1-25, default: 10)
Example:
Search for "diabetes mellitus" to find relevant concepts
2. get_concept
Get detailed information about a specific UMLS concept using its CUI (Concept Unique Identifier).
Parameters:
cui(string, required): Concept Unique Identifier (e.g., "C0009044")
Example:
Get details for concept C0009044 (Closed Fracture)
3. get_definitions
Get all definitions for a concept from various medical vocabularies.
Parameters:
cui(string, required): Concept Unique Identifier
Example:
Get definitions for diabetes mellitus concept
4. get_concept_relations
Get relationships between concepts (parent concepts, child concepts, related terms).
Parameters:
cui(string, required): Concept Unique Identifierpage_size(integer, optional): Number of results (1-25, default: 10)
Example:
Get parent and child concepts for diabetes mellitus
5. crosswalk_codes
Map a medical code from one coding system to equivalent codes in other systems.
Parameters:
source(string, required): Source vocabulary (e.g., "ICD10CM", "SNOMEDCT_US", "RXNORM", "LOINC")code(string, required): The code to maptarget_source(string, optional): Specific target vocabulary to filter resultspage_size(integer, optional): Number of results (1-25, default: 10)
Common vocabulary abbreviations:
ICD10CM- ICD-10 Clinical ModificationICD9CM- ICD-9 Clinical ModificationSNOMEDCT_US- SNOMED CT US EditionRXNORM- RxNorm (medications)LOINC- Logical Observation Identifiers Names and CodesCPT- Current Procedural TerminologyHCPCS- Healthcare Common Procedure Coding SystemICD10PCS- ICD-10 Procedure Coding SystemNDC- National Drug Code
Example:
Map ICD-10 code E11.9 (Type 2 diabetes without complications) to SNOMED CT
6. get_source_concept
Get information about a specific code from a particular medical vocabulary.
Parameters:
source(string, required): Source vocabulary abbreviationcode(string, required): The code in that vocabulary
Example:
Get information about ICD-10 code E11.9
Usage Examples
Example 1: Finding a Medical Concept
User: "What is the UMLS concept for Type 2 Diabetes?"
AI uses search_umls:
- query: "Type 2 Diabetes Mellitus"
- search_type: "words"
Returns CUI C0011860 with name "Diabetes Mellitus, Non-Insulin-Dependent"
Example 2: Code Mapping
User: "What is the SNOMED code for ICD-10 code E11.9?"
AI uses crosswalk_codes:
- source: "ICD10CM"
- code: "E11.9"
- target_source: "SNOMEDCT_US"
Returns SNOMED code 44054006 and other equivalent codes
Example 3: Understanding Relationships
User: "What are the subtypes of diabetes?"
AI first uses search_umls to find diabetes CUI, then uses get_concept_relations
to explore child concepts and related terms.
Development
Running Tests
pip install -e ".[dev]"
pytest
Project Structure
nih-umls-mcp/
├── src/
│ └── nih_umls_mcp/
│ ├── __init__.py
│ ├── server.py # MCP server implementation
│ └── umls_client.py # UMLS API client
├── pyproject.toml
└── README.md
API Rate Limits
The UMLS API has rate limits:
- Maximum 20 requests per second per IP address
- The server doesn't currently implement rate limiting, so be mindful of usage patterns
Troubleshooting
"UMLS_API_KEY environment variable is required"
- Ensure you've set the
UMLS_API_KEYenvironment variable - Check that the key is valid by testing it at https://documentation.uts.nlm.nih.gov/umls-api-interactive.html
HTTP 401 Unauthorized
- Your API key may be invalid or expired
- Regenerate your API key from your UTS profile
HTTP 404 Not Found
- The CUI or code you're looking up doesn't exist in the UMLS
- Check the spelling and format of identifiers
Resources
- UMLS REST API Documentation
- UMLS Metathesaurus Browser
- Model Context Protocol Documentation
- UMLS License Information
License
MIT License - see LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nih_umls_mcp-0.3.0.tar.gz.
File metadata
- Download URL: nih_umls_mcp-0.3.0.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bb86c3054b1a20b0d3b22fd1c198becb8bf7d896866ada4be49ba6692c2e8ab
|
|
| MD5 |
c3d62bc7eefa212f5e2902bce806542c
|
|
| BLAKE2b-256 |
356427885632662ecb40d4fe17c4449ecc814f1ee06ad594b8f7e9e4d0f82eab
|
Provenance
The following attestation bundles were made for nih_umls_mcp-0.3.0.tar.gz:
Publisher:
publish.yml on feordin/nih-umls-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nih_umls_mcp-0.3.0.tar.gz -
Subject digest:
9bb86c3054b1a20b0d3b22fd1c198becb8bf7d896866ada4be49ba6692c2e8ab - Sigstore transparency entry: 1108638057
- Sigstore integration time:
-
Permalink:
feordin/nih-umls-mcp@f6793cb24133faa2eb6842827eab78132685978c -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/feordin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f6793cb24133faa2eb6842827eab78132685978c -
Trigger Event:
release
-
Statement type:
File details
Details for the file nih_umls_mcp-0.3.0-py3-none-any.whl.
File metadata
- Download URL: nih_umls_mcp-0.3.0-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c69194c8c87ebe30c7a0343bd600736311b92a9bb4bb4d2beb18c005aa1cc0cb
|
|
| MD5 |
ce4902c875e6eaca2cd1a71f2024698d
|
|
| BLAKE2b-256 |
4b51c9859ff62bea5db8dfbe6b8f75c04c3111f03b82ae29d1b2707edad23e5b
|
Provenance
The following attestation bundles were made for nih_umls_mcp-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on feordin/nih-umls-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nih_umls_mcp-0.3.0-py3-none-any.whl -
Subject digest:
c69194c8c87ebe30c7a0343bd600736311b92a9bb4bb4d2beb18c005aa1cc0cb - Sigstore transparency entry: 1108638113
- Sigstore integration time:
-
Permalink:
feordin/nih-umls-mcp@f6793cb24133faa2eb6842827eab78132685978c -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/feordin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f6793cb24133faa2eb6842827eab78132685978c -
Trigger Event:
release
-
Statement type: