CEDAR MCP Server
OfficialThis server enables interaction with CEDAR metadata and BioPortal ontologies via the Model Context Protocol. Key capabilities:
CEDAR Templates: Fetch templates (
get_cedar_template) and retrieve paginated instances (get_instances_based_on_template).BioPortal Search: Search for terms within a branch (
term_search_from_branch) or across an ontology (term_search_from_ontology).Ontology Navigation: Get child terms of a branch (
get_branch_children) or the class hierarchy tree (get_ontology_class_tree).Cache Management: Remove stale entries (
remove_stale_cache_entries) or clear the entire BioPortal cache (clear_bioportal_cache).Integration: Supports stdio, SSE, and streamable-http transports; can be added to Claude Code or Claude Desktop.
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., "@CEDAR MCP Server Search for 'melanoma' in the NCIT 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.
CEDAR MCP Server
A Model Context Protocol (MCP) server for interacting with the CEDAR (Center for Expanded Data Annotation and Retrieval) metadata repository.
Prerequisites
Before using this MCP server, you'll need API keys from:
CEDAR API Key
Go to cedar.metadatacenter.org
Create an account or log in
Navigate to: Profile → API Key
Copy your API key
BioPortal API Key
Create an account or log in
Navigate to: Account Settings → API Key
Copy your API key
Related MCP server: Biomedical Research MCP Server
Running the CEDAR MCP Server
Set your API keys as environment variables:
export CEDAR_API_KEY="your-cedar-key"
export BIOPORTAL_API_KEY="your-bioportal-key"Option 1: Using UVX (Recommended)
Run directly without installation using uvx:
uvx cedar-mcpOption 2: Using pip
Install from PyPI and run:
pip install cedar-mcp
cedar-mcpNote: The
--cedar-api-keyand--bioportal-api-keyCLI flags are deprecated and will be removed in a future release. Use environment variables instead.
Transport Options
By default, the server uses stdio transport. You can also run it as an HTTP server using SSE or streamable-http transports:
# SSE transport on default host/port (127.0.0.1:8000)
cedar-mcp --transport sse
# Streamable HTTP on custom host/port
cedar-mcp --transport streamable-http --host 0.0.0.0 --port 9000Flag | Choices | Default | Description |
|
|
| Transport protocol |
| — |
| Host to bind to (HTTP transports only) |
| — |
| Port to bind to (HTTP transports only) |
Using with Claude Code
Add the CEDAR MCP server to Claude Code:
claude mcp add cedar-mcp --uvx -e CEDAR_API_KEY=your-cedar-key -e BIOPORTAL_API_KEY=your-bioportal-keyUsing with Claude Desktop
To use with Claude Desktop app:
Install the MCP server using one of the methods above
Add to Claude Desktop configuration in your
claude_desktop_config.json:
{
"mcpServers": {
"cedar-mcp": {
"command": "uvx",
"args": [
"cedar-mcp"
],
"env": {
"CEDAR_API_KEY": "your-cedar-key",
"BIOPORTAL_API_KEY": "your-bioportal-key",
"CEDAR_MCP_CACHE_TTL_SECONDS": "86400",
"CEDAR_MCP_CACHE_DIR": "/path/to/custom/location"
}
}
}
}Or if you have it installed locally:
{
"mcpServers": {
"cedar-mcp": {
"command": "cedar-mcp",
"env": {
"CEDAR_API_KEY": "your-cedar-key",
"BIOPORTAL_API_KEY": "your-bioportal-key",
"CEDAR_MCP_CACHE_TTL_SECONDS": "86400",
"CEDAR_MCP_CACHE_DIR": "/path/to/custom/location"
}
}
}
}The CEDAR_MCP_CACHE_TTL_SECONDS and CEDAR_MCP_CACHE_DIR environment variables are optional. When set under the "env" key, Claude Desktop injects them into the server process environment before it starts, so the cache picks them up automatically. If omitted, the defaults apply (24-hour TTL and a platform-specific cache directory — see Cache Configuration).
Available Tools
Here is the list of CEDAR tools with a short description
get_cedar_template: Fetches a template from the CEDAR repository, using CEDAR's compact YAML rendering so it costs fewer tokens to read than the JSON-LD form. Passexpand_branchesto list the values allowed by each ontology branch:"labels"for their labels alone,"terms"for labels with their IRIs, or the default"none"to report the branch itself and skip the lookups.get_instances_based_on_template: Gets template instances that belong to a specific template with pagination support.term_search_from_branch: Searches BioPortal for standardized ontology terms within a specific branch.term_search_from_ontology: Searches BioPortal for standardized ontology terms within an entire ontology.get_branch_children: Fetches all immediate children terms for a given branch in an ontology.get_ontology_class_tree: Fetches the hierarchical tree structure for a given class in an ontology.remove_stale_cache_entries: Removes expired entries from the BioPortal search cache.clear_bioportal_cache: Clears all entries from the BioPortal search cache.
Cache Configuration
BioPortal search results are cached locally using SQLite to reduce latency and API load. The cache persists across server restarts.
Variable | Default | Description |
|
| Time-to-live for cached BioPortal responses |
| Platform-specific (see below) | Override the cache directory location |
Default cache locations:
macOS:
~/Library/Caches/cedar-mcpLinux:
$XDG_CACHE_HOME/cedar-mcpor~/.cache/cedar-mcpWindows:
%LOCALAPPDATA%/cedar-mcp/cache
Development
Install Development Dependencies
pip install -r requirements-dev.txtRunning Tests
This project includes comprehensive integration tests that validate real API interactions with both CEDAR and BioPortal APIs.
For detailed testing information, see test/README.md.
Contributing
Contributions are welcome! Please ensure all tests pass before submitting a Pull Request:
python run_tests.py --integrationLicense
This project is licensed under the MIT License — see the LICENSE file for details.
Available Tools
8 toolsclear_bioportal_cacheA
Clear all entries from the BioPortal search cache.
Use this tool to force fresh API calls for all subsequent BioPortal searches. This is useful when ontology data has been updated and you want to ensure the latest results.
Returns: Dictionary with cleared_count
Inputs: no named parameters. Returns: object
get_branch_childrenA
Fetch all immediate children terms for a given branch in an ontology.
Use this tool to retrieve the child terms under a specific branch IRI in a BioPortal ontology. This is useful for exploring the hierarchy of an ontology or populating dropdown options for a controlled vocabulary.
Args: branch_iri: IRI of the branch to get children for (e.g., "http://purl.obolibrary.org/obo/CHEBI_23367") ontology_acronym: Ontology acronym to search within (e.g., "CHEBI", "HRAVS")
Returns: BioPortal response containing child terms with their prefLabels
Inputs: branch_iri (required), ontology_acronym (required). Returns: object
get_cedar_templateA
Get a template from the CEDAR repository.
The template is fetched in CEDAR's compact YAML rendering, which is a far cheaper way to read a template than the JSON-LD form: it leaves out provenance and other bookkeeping keys, so it costs fewer tokens.
A field restricted to an ontology branch reports that branch rather than the values it allows. Use expand_branches to list those values, bearing in mind that each branch costs one BioPortal lookup and a template can easily have twenty of them.
Args: template_id: The template ID or full URL from CEDAR repository (e.g., "https://repo.metadatacenter.org/templates/e019284e-48d1-4494-bc83-ddefd28dfbac") expand_branches: How much of each ontology branch to list under permissible_values (default: "none"): "none" reports the branch itself and does no lookups; "labels" lists the allowed labels, which is enough to read a template but carries no IRIs; "terms" lists each label with its IRI, which is what filling in a controlled term field needs, at roughly 1.7x the size of "labels"
Returns: Template data from CEDAR, cleaned and transformed
Inputs: template_id (required), expand_branches. Returns: object
get_instances_based_on_templateA
Get template instances that belong to the input template ID with pagination support.
This tool searches for instances of a given template and fetches their complete content in paginated chunks to avoid token limit issues.
Args: template_id: The template ID or full URL from CEDAR repository (e.g., "https://repo.metadatacenter.org/templates/e019284e-48d1-4494-bc83-ddefd28dfbac") limit: Number of instances to return per page (min: 1, max: 100, default: 10) offset: Starting position for pagination (default: 0)
Returns: Dictionary containing: - instances: List of template instances for this page - pagination: Pagination metadata (total_count, current_page, etc.) - errors: List of any errors encountered during fetching
Inputs: template_id (required), limit, offset. Returns: object
get_ontology_class_treeA
Fetch the hierarchical tree structure for a given class in an ontology.
Use this tool to retrieve the ancestor path and sibling nodes for a specific class IRI in a BioPortal ontology. This is useful for understanding where a term sits in the ontology hierarchy.
Args: class_iri: IRI of the class to get the tree for (e.g., "http://purl.obolibrary.org/obo/MONDO_0005180") ontology_acronym: Ontology acronym to search within (e.g., "MONDO", "CHEBI")
Returns: BioPortal response containing the class tree hierarchy
Inputs: class_iri (required), ontology_acronym (required). Returns: object
remove_stale_cache_entriesA
Remove expired entries from the BioPortal search cache.
This tool cleans up cache entries that have exceeded their TTL (time-to-live). Use it to free disk space without losing valid cached results.
Returns: Dictionary with removed_count and remaining_count
Inputs: no named parameters. Returns: object
term_search_from_branchA
Search BioPortal for standardized ontology terms within a specific branch.
Use this tool to find the correct standardized name and IRI for a given term label within a specific ontology branch.
Args: search_string: The term label or keyword to search for (e.g., "aspirin", "glucose") ontology_acronym: Ontology acronym to search within (e.g., "CHEBI", "HRAVS") branch_iri: IRI of the branch to restrict the search to (e.g., "http://purl.obolibrary.org/obo/CHEBI_23367")
Returns: Search results from BioPortal containing matching terms
Inputs: branch_iri (required), search_string (required), ontology_acronym (required). Returns: object
term_search_from_ontologyA
Search BioPortal for standardized ontology terms within an entire ontology.
Use this tool to find the correct standardized name and IRI for a given term label across an entire ontology (not restricted to a specific branch).
Args: search_string: The term label or keyword to search for (e.g., "melanoma", "diabetes") ontology_acronym: Ontology acronym to search within (e.g., "NCIT", "CHEBI", "DOID")
Returns: Search results from BioPortal containing matching terms
Inputs: search_string (required), ontology_acronym (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose: template retrieval, instance retrieval, branch-scoped term search, ontology-wide term search, branch children, class tree, stale cache cleanup, and full cache clear. The descriptions explicitly delineate scope, minimizing confusion.
Naming mixes conventions: 'get_*' verbs (get_cedar_template, get_instances_based_on_template, get_branch_children, get_ontology_class_tree) coexist with 'term_search_*' noun-first patterns and imperative cache tools ('remove_*', 'clear_*'). The inconsistency is moderate and could confuse agents.
Eight tools is well-scoped for this server's purpose: template access, instance retrieval, ontology exploration, and cache management. Each tool earns its place without redundancy or bloat.
The surface covers core workflows: fetching templates, listing instances, and discovering ontology terms. Minor gaps include lack of template search/list and direct instance-by-ID lookup, but these are likely outside the intended scope.
Maintenance
Related MCP Connectors
Search and fetch Wikidata entities, execute SPARQL queries, and resolve external identifiers.
Unofficial UMLS MCP — wraps the NLM UMLS Terminology Services REST API (uts-ws.nlm.nih.gov/rest)
Search, read and cite documents. Add, replace and delete files with write access. OAuth required.
Search, read, and automate TextMine documents, records, workflows, integrations, and agent tasks.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables interaction with the CEDAR (Center for Expanded Data Annotation and Retrieval) metadata repository to fetch templates and retrieve template instances. Supports querying structured metadata and biomedical data annotations through the CEDAR platform.2MIT
- AlicenseBqualityCmaintenanceEnables biomedical research workflows via MCP, including experiment and document search, PDF text extraction, evidence retrieval, and validation with provenance tracking.10MIT
- FlicenseNot gradedqualityCmaintenanceEnables searching a synthetic healthcare document repository and saving validated document metadata through MCP tools.-
- AlicenseNot gradedqualityBmaintenanceEnables researchers to query DigitalBrain data catalogs, brain region profiles, gene expression summaries, and paper evidence, and download approved results through MCP-compatible clients.MIT