OLS MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OLS MCP Server search for diabetes-related terms in the Human Phenotype Ontology"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OLS MCP Server
Large Language Models are notoriously bad at working with ontologies, often hallucinating terms or their identifiers. This server provides a reliable way to access and query ontologies, ensuring accurate and up-to-date information.

This repository contains a Model Context Protocol (MCP) server providing access to the Ontology Lookup Service (OLS) API. This server enables AI assistants to search for and retrieve ontological terms, concepts, and hierarchies from various biological and medical ontologies.
This server is designed to work seamlessly with AI assistants like Claude Desktop, allowing users to query ontologies using natural language. It supports a wide range of ontologies, including Gene Ontology (GO), Human Phenotype Ontology (HP), and many others.

Without (top part of image below) and with mcp server engaged (bottom of figure below):

Features
The OLS MCP Server provides the following tools:
๐ Search Terms: Search for terms across ontologies with flexible filtering
๐ Search Ontologies: Discover available ontologies and their metadata
โน๏ธ Get Ontology Information: Retrieve detailed information about specific ontologies
๐ฏ Get Term Information: Get comprehensive details about specific terms
๐ณ Get Term Children: Find direct child terms in ontological hierarchies
๐จโ๐ฉโ๐งโ๐ฆ Get Term Ancestors: Retrieve parent terms and ancestors
๐ค Find Similar Terms: Discover semantically similar terms using LLM embeddings
Related MCP server: mcp-ubergraph-query
Supported Ontologies
The server works with any ontology available through the EBI Ontology Lookup Service, including:
GO (Gene Ontology)
EFO (Experimental Factor Ontology)
HP (Human Phenotype Ontology)
MONDO (Monarch Disease Ontology)
ChEBI (Chemical Entities of Biological Interest)
UBERON (Uber-anatomy ontology)
And many more...
Installation
Prerequisites
Python 3.12 or higher
uv package manager
Install uv (if not already installed)
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"Install the OLS MCP Server
# Clone the repository
git clone https://github.com/seandavi/ols-mcp-server.git
cd ols-mcp-server
# Install dependencies
uv sync
# Install as a tool (optional)
uv tool install .Configuration
Claude Desktop Configuration
To use this server with Claude Desktop, add the following configuration to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"ols-mcp-server": {
"command": "uv",
"args": [
"tool",
"run",
"ols-mcp-server"
],
"env": {}
}
}
}Alternative Configuration (if installed as tool)
If you installed the server as a uv tool, you can use this simpler configuration:
{
"mcpServers": {
"ols-mcp-server": {
"command": "ols-mcp-server",
"args": [],
"env": {}
}
}
}Usage Examples
Once configured with Claude Desktop, you can use natural language to interact with the OLS API:
Searching for Terms
"Search for terms related to diabetes in the Human Phenotype Ontology"
"Find all terms containing 'apoptosis' in the Gene Ontology"
Getting Ontology Information
"Tell me about the Gene Ontology"
"What ontologies are available for chemical compounds?"
Exploring Term Hierarchies
"Show me the children of the term 'metabolic process' in GO"
"What are the ancestor terms for HP:0000118?"
Finding Similar Terms
"Find terms similar to 'heart development' in the Gene Ontology"
Development Setup
Setting up the Development Environment
Clone the repository:
git clone <repository-url> cd ols-mcp-serverInstall dependencies:
uv sync --extra devActivate the virtual environment:
source .venv/bin/activate # macOS/Linux # or .venv\Scripts\activate # Windows
Code Quality
# Format code
uv run ruff format
# Lint code
uv run ruff check
# Type checking
uv run mypy src/Adding New Features
Add new tools in
src/ols_mcp_server/server.pyusing the@mcp.tool()decoratorCreate models in
src/ols_mcp_server/models.pyfor structured responsesUpdate tests to cover new functionality
Update documentation as needed
API Documentation
The server interacts with the EBI Ontology Lookup Service API v2. Key endpoints:
Search:
https://www.ebi.ac.uk/ols4/api/searchOntologies:
https://www.ebi.ac.uk/ols4/api/v2/ontologiesTerms:
https://www.ebi.ac.uk/ols4/api/termsHierarchies:
https://www.ebi.ac.uk/ols4/api/v2/ontologies/{ontology}/classes/{term}/children
Troubleshooting
Common Issues
Server not found: Ensure the path to the server is correct in your Claude config
Permission errors: Make sure the server script is executable
Network errors: Check your internet connection and firewall settings
Python version: Ensure you're using Python 3.12 or higher
Contributing
Fork the repository
Create a feature branch:
git checkout -b feature-nameMake your changes
Run tests:
uv run pytestFormat code:
uv run ruff formatSubmit a pull request ]
Acknowledgments
EBI Ontology Lookup Service for providing the API
FastMCP for the MCP framework
The ontology communities for maintaining these valuable resources
Available Tools
7 toolsfind_similar_termsC
Find terms similar to the given term using LLM embeddings.
Args: term_iri: The IRI of the reference term ontology: The ontology identifier size: Maximum number of similar terms to return
Returns: JSON formatted list of similar terms
Inputs: term_iri (required), ontology (required), size. Returns: result
get_ontology_infoC
Get detailed information about a specific ontology.
Inputs: ontology_id (required). Returns: result
get_term_ancestorsC
Get ancestor terms (parents) of a specific term.
Args: term_iri: The IRI of the term ontology: The ontology identifier include_obsolete: Include obsolete entities size: Maximum number of results
Returns: JSON formatted list of ancestor terms
Inputs: term_iri (required), ontology (required), include_obsolete, size. Returns: result
get_term_childrenB
Get direct children of a specific term.
Args: term_iri: The IRI of the term ontology: The ontology identifier include_obsolete: Include obsolete entities size: Maximum number of results
Returns: JSON formatted list of child terms
Inputs: term_iri (required), ontology (required), include_obsolete, size. Returns: result
get_term_infoC
Get detailed information about a specific term.
Inputs: id (required). Returns: result
search_ontologiesC
Search for available ontologies.
Inputs: search, page, size. Returns: result
search_termsC
Search for terms across ontologies using the OLS search API.
Inputs: query (required), ontology, exact_match, include_obsolete, +1 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose with no ambiguity: find_similar_terms uses embeddings for similarity, get_ontology_info and get_term_info retrieve metadata, get_term_ancestors and get_term_children handle hierarchical relationships, and search_ontologies and search_terms perform different types of searches. The descriptions clearly differentiate their functions.
All tools follow a consistent verb_noun pattern with snake_case: find_similar_terms, get_ontology_info, get_term_ancestors, get_term_children, get_term_info, search_ontologies, and search_terms. The naming is predictable and readable throughout the set.
With 7 tools, this is well-scoped for an ontology server, covering core operations like searching, retrieving metadata, and exploring term hierarchies. Each tool earns its place without being excessive or insufficient for the domain.
The tool set provides strong coverage for ontology exploration, including search, metadata retrieval, and hierarchical navigation. A minor gap is the lack of update or management tools (e.g., create_term, update_ontology), but this is reasonable for a read-focused server, and agents can work effectively with the provided tools.
Maintenance
Related MCP Connectors
EBI OLS4 MCP โ Ontology Lookup Service.
Connect AI clients to biomedical data and tools.
Search and fetch Wikidata entities, execute SPARQL queries, and resolve external identifiers.
Web knowledge fetching tools for your agent.
Related MCP Servers
AlicenseAqualityBmaintenanceProvides AI agents with instant access to 10M+ OMOP medical vocabulary concepts for searching, mapping, and navigating clinical codes across SNOMED, ICD-10, RxNorm, LOINC, and more.11127 npm7MIT- AlicenseAqualityDmaintenanceEnables AI assistants to query the Ubergraph biomedical ontology SPARQL endpoint with tools for custom SPARQL queries, term lookup, search, and hierarchy traversal.4MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to search, explore, and interact with ontologies and semantic resources on AgroPortal via the OntoPortal ecosystem.-
- AlicenseNot gradedqualityCmaintenanceEnables querying and browsing ontologies from the EBI Ontology Lookup Service, including searching for terms, retrieving term details, and navigating ontology hierarchies via natural language.51 npmMIT