PhenotypeLibrary MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
PhenotypeLibrary MCP Server
A Model Context Protocol (MCP) server for the Phenotype Library / Concept Library API.
This server provides access to clinical code lists, phenotypes, ontology terms, and other research metadata from the SAIL Databank Concept Library.
Features
Phenotypes: Search and retrieve phenotype definitions, codelists, and version history
Concepts: Search and retrieve clinical code lists (concepts), codelists, and version history
Ontology: Search ontology terms (MONDO, MeSH, SNOMED CT, ICD-10, etc.)
Collections: Browse collections of phenotypes/concepts
Tags: Browse tags for categorization
Data Sources: Access data source metadata
Templates: Browse phenotype templates
Related MCP server: SNOMED CT MCP Server
Installation
# Install from source
pip install -e .
# Or install with development dependencies
pip install -e ".[dev]"Configuration
Create a .env file with your configuration:
# API Configuration
PHENOTYPELIBRARY_BASE_URL=https://conceptlibrary.saildatabank.com/api/v1/
PHENOTYPELIBRARY_TIMEOUT=30.0
# Optional: Authentication (for private data)
PHENOTYPELIBRARY_USERNAME=your_username
PHENOTYPELIBRARY_PASSWORD=your_passwordAvailable Domains
SAIL (default):
https://conceptlibrary.saildatabank.com/api/v1/HDRUK:
https://phenotypes.healthdatagateway.org/api/v1/Demo:
https://conceptlibrary.demo-dev.saildatabank.com/api/v1/ADP:
https://conceptlibrary.saildatabank.com/ADP/api/v1/Gateway:
https://conceptlibrary.serp.ac.uk/api/v1/
Deployment
Render (Web Service)
Connect your GitHub repository to Render
Create a new Web Service
Use the
render.yamlconfiguration file (or manually configure):Build Command:
pip install -e .Start Command:
uvicorn phenotypelibrary_mcp.server:app --host 0.0.0.0 --port $PORTHealth Check Path:
/health
Add environment variables:
PHENOTYPELIBRARY_BASE_URL(optional, defaults to SAIL)PHENOTYPELIBRARY_TIMEOUT(optional, defaults to 30.0)PHENOTYPELIBRARY_USERNAME(optional, for private data)PHENOTYPELIBRARY_PASSWORD(optional, for private data)
MCP Endpoint
Once deployed, the MCP server will be available at:
SSE Endpoint:
https://your-app.onrender.com/mcp/sseHealth Check:
https://your-app.onrender.com/health
Docker
# Build the image
docker build -t phenotypelibrary-mcp .
# Run the container
docker run -p 8000:8000 \
-e PHENOTYPELIBRARY_BASE_URL=https://conceptlibrary.saildatabank.com/api/v1/ \
phenotypelibrary-mcpDocker Compose
docker-compose up -dUsage
Running the Server
# Run with stdio transport (for MCP clients like Cursor, Claude Desktop)
python -m phenotypelibrary_mcp.server
# Or use the entry point
phenotypelibrary-mcp
# Run with SSE transport (for HTTP-based MCP clients)
python -m phenotypelibrary_mcp.server --transport sse --host 0.0.0.0 --port 8000Using with MCP Inspector
# Test with MCP Inspector (SSE transport)
npx @modelcontextprotocol/inspector https://phenotypelibrarymcp.onrender.com/mcp/sseUsing with MCP Clients
Add to your MCP client config (Cursor, Claude Desktop, etc.):
{
"mcpServers": {
"phenotypelibrary": {
"url": "https://phenotypelibrarymcp.onrender.com/mcp/sse"
}
}
}For stdio transport (local development):
{
"mcpServers": {
"phenotypelibrary": {
"command": "python",
"args": ["-m", "phenotypelibrary_mcp.server"]
}
}
}Available Tools
Phenotypes
search_phenotypes- Search phenotypes with filtersget_phenotype_detail- Get detailed phenotype informationget_phenotype_codelist- Get clinical codes for a phenotypeget_phenotype_versions- Get version history
Concepts
search_concepts- Search concepts (clinical code lists)get_concept_detail- Get detailed concept informationget_concept_codelist- Get clinical codes for a conceptget_concept_versions- Get version history
Ontology
search_ontology- Search ontology termsget_ontology_node- Get specific ontology node by termget_ontology_groups- Get all ontology groupsget_ontology_type- Get ontology type details
Collections & Tags
get_collections- List all collectionsget_collection_detail- Get collection detailsget_tags- List all tagsget_tag_detail- Get tag details
Data Sources & Templates
get_data_sources- List data sourcesget_data_source_detail- Get data source detailsget_templates- List templatesget_template_detail- Get template detailsget_template_versions- Get template version history
Example Usage
# Search for asthma phenotypes
result = await search_phenotypes(search="asthma")
# Get phenotype detail
detail = await get_phenotype_detail("PH1")
# Get codelist for a phenotype
codelist = await get_phenotype_codelist("PH1")
# Search ontology for diabetes terms
ontology = await search_ontology(search="diabetes")
# Get specific ontology node
node = await get_ontology_node("MONDO:0005148")Resources
The server also exposes resources:
phenotype://{phenotype_id}- Phenotype detailsconcept://{concept_id}- Concept detailsontology://{term}- Ontology node details
Prompts
Pre-built prompts for common tasks:
phenotype_search_prompt(condition)- Search phenotypes for a conditionconcept_search_prompt(condition)- Search concepts for a conditionontology_search_prompt(term)- Search ontology for a term
API Response Handling
The Concept Library API returns lists for many detail endpoints. This server automatically handles these responses:
Detail endpoints (
get_phenotype_detail,get_concept_detail, etc.): Returns the first item from the listCodelist endpoints (
get_phenotype_codelist,get_concept_codelist): Wraps the list in{"codes": [...]}Version endpoints (
get_phenotype_versions,get_concept_versions,get_template_versions): Wraps the list in{"versions": [...]}Ontology groups (
get_ontology_groups): Wraps the list in{"groups": [...]}
All ID parameters are automatically stripped of whitespace to prevent URL encoding issues.
Development
# Run tests
pytest
# Lint
ruff check .
# Format
ruff format .License
GPL-3.0 - See LICENSE file for details.
References
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Public read-only MCP access to digital learning concepts, semantic relationships, and citations.
Read-only AgentiScript concept search, catalog, authenticity, license, and approved asset discovery.
NIH Clinical Tables Search Service MCP.
UMLS MCP — wraps the NLM UMLS Terminology Services REST API (uts-ws.nlm.nih.gov/rest)
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables querying and browsing SNOMED CT medical terminology concepts, including search, details, and hierarchy navigation via MCP tools.3MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides SNOMED CT clinical terminology lookup via any FHIR R4 terminology server supporting SNOMED CT and ECL. Offers tools for searching by term, fetching by code, and navigating the concept hierarchy.21Apache 2.0
- AlicenseCqualityDmaintenanceMCP server for retrieving clinical standard content from the CDISC Library, supporting controlled terminology, ADaM, SDTM, CDASH, SEND metadata, and search.317MIT
- AlicenseNot gradedqualityBmaintenanceEnables life-science research by providing search and retrieval across linked publications, clinical trials, drugs, genes, regulatory approvals, and patents through MCP clients.1Apache 2.0