A CEDAR MCP server
Project description
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
- Go to bioportal.bioontology.org
- Create an account or log in
- Navigate to: Account Settings → API Key
- Copy your API key
Running the CEDAR MCP Server
Option 1: Using UVX (Recommended)
Run directly without installation using uvx:
uvx cedar-mcp \
--cedar-api-key "your-cedar-key" \
--bioportal-api-key "your-bioportal-key"
Option 2: Using pip
Install from PyPI and run:
pip install cedar-mcp
cedar-mcp \
--cedar-api-key "your-cedar-key" \
--bioportal-api-key "your-bioportal-key"
Option 3: Using Environment Variables
Set environment variables instead of command-line arguments:
# Set environment variables
export CEDAR_API_KEY="your-cedar-key"
export BIOPORTAL_API_KEY="your-bioportal-key"
# Run with uvx
uvx cedar-mcp
# Or if installed via pip
cedar-mcp
Using with Claude Code
Add the CEDAR MCP server to Claude Code:
claude mcp add cedar-mcp --uvx \
--cedar-api-key "your-cedar-key" \
--bioportal-api-key "your-bioportal-key"
Using 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.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 |
|---|---|---|
CEDAR_MCP_CACHE_TTL_SECONDS |
86400 (24 hours) |
Time-to-live for cached BioPortal responses |
CEDAR_MCP_CACHE_DIR |
Platform-specific (see below) | Override the cache directory location |
Default cache locations:
- macOS:
~/Library/Caches/cedar-mcp - Linux:
$XDG_CACHE_HOME/cedar-mcpor~/.cache/cedar-mcp - Windows:
%LOCALAPPDATA%/cedar-mcp/cache
Development
Install Development Dependencies
pip install -r requirements-dev.txt
Running 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 --integration
License
This project is licensed under the MIT License — see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
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 cedar_mcp-1.0.0.tar.gz.
File metadata
- Download URL: cedar_mcp-1.0.0.tar.gz
- Upload date:
- Size: 132.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ff3f0333e22aaf39090f0f9907a1fb8410bf01e61c27471fc561633de63d7e5
|
|
| MD5 |
6a7d4abb2a2d103dc36b049b47926c12
|
|
| BLAKE2b-256 |
e89732d976324d4c4217f55d88c4eccdfa6045e1d4d2f1c79ef872d9a0151d42
|
Provenance
The following attestation bundles were made for cedar_mcp-1.0.0.tar.gz:
Publisher:
release.yml on musen-lab/cedar-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cedar_mcp-1.0.0.tar.gz -
Subject digest:
9ff3f0333e22aaf39090f0f9907a1fb8410bf01e61c27471fc561633de63d7e5 - Sigstore transparency entry: 1004505668
- Sigstore integration time:
-
Permalink:
musen-lab/cedar-mcp@6113e81064495e10cb0b4816ef6ea941471c36c2 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/musen-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6113e81064495e10cb0b4816ef6ea941471c36c2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cedar_mcp-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cedar_mcp-1.0.0-py3-none-any.whl
- Upload date:
- Size: 20.4 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 |
28ab4d0f0ca681233d42acf3d62d99b7bc9c40e10a2ac0e74eb5f21b444f59a1
|
|
| MD5 |
b34b30248aa31226b3a730c8fa3eec8d
|
|
| BLAKE2b-256 |
ef48aa5c6bb2deafa39255b0779d76cd937f38de3031557d2cda35e58bc63250
|
Provenance
The following attestation bundles were made for cedar_mcp-1.0.0-py3-none-any.whl:
Publisher:
release.yml on musen-lab/cedar-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cedar_mcp-1.0.0-py3-none-any.whl -
Subject digest:
28ab4d0f0ca681233d42acf3d62d99b7bc9c40e10a2ac0e74eb5f21b444f59a1 - Sigstore transparency entry: 1004505672
- Sigstore integration time:
-
Permalink:
musen-lab/cedar-mcp@6113e81064495e10cb0b4816ef6ea941471c36c2 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/musen-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6113e81064495e10cb0b4816ef6ea941471c36c2 -
Trigger Event:
push
-
Statement type: