PhenotypeLibrary MCP Server
Provides access to the ADP deployment of the SAIL Databank Concept Library API, enabling search and retrieval of phenotypes, concepts, codelists, ontology terms, collections, tags, data sources, and templates.
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:
python server.pyHealth 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_ALLOWED_HOSTS(comma-separated Host values the transport accepts; includes your deployed domain, e.g.phenotypelibrarymcp.onrender.com)MCP_ALLOWED_ORIGINS(optional, comma-separated browser Origin values)MCP_ENABLE_DNS_REBINDING_PROTECTION(optional,trueby default; setfalseto disable Host/Origin validation)
MCP Endpoint
Once deployed, the MCP server will be available at:
Streamable HTTP Endpoint:
https://your-app.onrender.com/mcpHealth Check:
https://your-app.onrender.com/health
Docker Compose
Deprecated — Docker files were removed from this project; use the pip
install + python server.py flow above instead.
Usage
Running the Server
# Streamable HTTP transport (binds $HOST/$PORT, defaults 0.0.0.0:8000)
python server.py
# Or use the console script
phenotypelibrary-mcpLocal testing note: DNS rebinding protection is on by default and only accepts hosts listed in
MCP_ALLOWED_HOSTS(default:phenotypelibrarymcp.onrender.com). For local testing, setMCP_ALLOWED_HOSTS=localhost:*,127.0.0.1:*.
Using with MCP Inspector
# Test with MCP Inspector (streamable HTTP transport)
npx @modelcontextprotocol/inspector http://localhost:8000/mcpUsing with MCP Clients
Add to your MCP client config (Cursor, Claude Desktop, etc.):
{
"mcpServers": {
"phenotypelibrary": {
"url": "https://phenotypelibrarymcp.onrender.com/mcp"
}
}
}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")API Response Handling
The Concept Library API returns varying response shapes. client.list()
normalizes them all to a single form:
Bare JSON array → wrapped into
{"count": N, "next": null, "previous": null, "results": [...]}Paged mapping (
page/total_pages/data) →databecomesresultsDRF-style mapping (
count/next/previous/results) → passed through as-is
Detail endpoints return a single-item list; the tools unwrap it to the item.
All ID parameters are stripped of whitespace, and concept IDs get a C prefix
(normalized via PhenotypeLibraryClient.normalize_concept_id).
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.
Public MCP endpoint for collaborative research and knowledge discovery.
Unofficial 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 gradedqualityCmaintenanceEnables term search, class lookup, and cross-ontology mappings across NCBO BioPortal's ~1,300 biomedical ontologies.77 npmMIT