An MCP (Model Context Protocol) server for EDAM ontology mapping, concept suggestion, and text segmentation. This server provides tools to:
- Map descriptions to EDAM concepts: Find the most appropriate EDAM ontology concepts for metadata or free text descriptions with confidence scores
- Suggest new concepts: Generate suggestions for new EDAM concepts when no suitable match exists
- Segment text: Extract topics and keywords from text for improved mapping accuracy
Documentation here.
# Clone the repository
git clone [email protected]:edamontology/edammcp.git
cd edammcp
# Install with uv (recommended)
uv sync --dev
# Or install manually
uv sync
uv pip install -e .# Test the basic structure (fast)
uv run python examples/simple_test.py
# Run the full example (downloads ML models on first run)
# Run the mapper
uv run python examples/basic_usage_mapper.py
# Run the suggester
uv run python examples/basic_usage_suggester.py
# Run the segmentation example
uv run python examples/basic_seg.py
# Start the MCP server
uv run edam-mcpFor examples on how to run the functions, please check basic-usage.md.
- Ontology Mapping: Semantic search and matching of descriptions to existing EDAM concepts
- Confidence Scoring: Provide confidence levels for mapping results
- Concept Suggestion: Generate suggestions for new EDAM concepts when no match is found
- Hierarchical Placement: Suggest appropriate placement within the EDAM ontology hierarchy
- Text Segmentation: Segment and analyze text to extract topics and keywords for mapping
# Run the server directly
uv run python -m edam_mcp.main
# Or use the installed script
uv run edam-mcpThe server exposes four main tools:
-
map_to_edam_concept- Maps descriptions to existing EDAM concepts- Input: Description text, context, confidence threshold
- Output: List of matched concepts with confidence scores
- Example: "sequence alignment tool" β "Sequence alignment" (confidence: 0.85)
-
suggest_new_concept- Suggests new concepts when no match is found- Input: Description text, concept type, parent concept
- Output: List of suggested new concepts with hierarchical placement
- Example: "quantum protein folding" β "Quantum Protein Folding" (suggested as child of "Sequence alignment")
-
segment_text- Segment text into topic and keywords using NLP- Input: Raw text to be segmented
- Output: Topic summary and list of keywords extracted from the text
- Example: "spaCy is a popular library for efficient Natural Language Processing" β topic: "library spacy language", keywords: ["spacy", "library", "natural language processing"]
-
get_workflow_summary- Get comprehensive summary of the EDAM mapping workflow for copilot planning- Input: (No parameters required)
- Output: Workflow summary with available functions and their descriptions
# Install in Claude Desktop or other compatible MCP clients
# Add to your MCP configuration file:
{
"mcpServers": {
"edam-mcp": {
"command": "uvx",
"args": ["--from", "git+https://github.com/edamontology/edammcp", "edam-mcp"],
"env": {
"EDAM_SIMILARITY_THRESHOLD": "0.7"
}
}
}
}Alternately, if you plan to develop the code and test it from your MCP client at the same time:
# Install in Claude Desktop or other compatible MCP clients
# Add to your MCP configuration file:
{
"mcpServers": {
"edam-mcp": {
"command": "uv",
"args": [
"--directory",
"/path/to/repo/edammcp",
"run",
"edam-mcp"
],
"env": {
"EDAM_SIMILARITY_THRESHOLD": "0.7"
}
}
}
}edam_mcp/
βββ __init__.py
βββ main.py # Main server entry point
βββ config.py # Configuration management
βββ models/ # Pydantic models (organized by functionality)
β βββ __init__.py
β βββ mapping.py # Mapping request/response models
β βββ suggestion.py # Suggestion request/response models
β βββ segmentation.py # Text segmentation models
β βββ workflow.py # Workflow summary models
βββ ontology/ # EDAM ontology handling
β βββ __init__.py
β βββ loader.py # Ontology loading and parsing
β βββ matcher.py # Concept matching logic
β βββ suggester.py # New concept suggestion logic
βββ tools/ # MCP tools
β βββ __init__.py
β βββ mapping.py # Mapping tool implementation
β βββ suggestion.py # Suggestion tool implementation
β βββ segment_text.py # Text segmentation tool
β βββ workflow.py # Workflow summary tool
βββ utils/ # Utility functions
βββ __init__.py
βββ context.py # Context utilities
βββ text_processing.py # Text preprocessing
βββ similarity.py # Similarity calculation
# Install development dependencies
uv sync --dev
# Run tests
uv run pytest
# Lint & Format code
uv run pre-commit install # Run only first time
uv run pre-commit run --all-files- Create a new tool function in the appropriate module under
tools/ - Create corresponding request/response models in
models/(organized by functionality) - Register the tool in
main.pyusing the@mcp.tooldecorator - Export models in
models/__init__.py - Write tests for the new functionality
The server can be configured through environment variables:
EDAM_ONTOLOGY_URL: URL to the EDAM ontology file (default: official EDAM OWL file)EDAM_SIMILARITY_THRESHOLD: Minimum confidence threshold for mappings (default: 0.7)EDAM_MAX_SUGGESTIONS: Maximum number of suggestions to return (default: 5)
This project is licensed under the MIT License - see the LICENSE file for details.