Name | ols-mcp JSON |
Version |
0.1.5
JSON |
| download |
home_page | None |
Summary | MCP for retrieving things from the Ontology Lookup Service |
upload_time | 2025-07-10 14:50:48 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.11 |
license | MIT License
Copyright (c) 2024 Justin Reese
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. |
keywords |
bioinformatics
mcp
ols
ontology
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# ols-mcp
A Model Context Protocol (MCP) server for retrieving information from the Ontology Lookup Service (OLS).
This package provides tools for searching ontologies, retrieving ontology details, and accessing ontology terms through a standardized MCP interface.
## Installation
### From PyPI
```bash
pip install ols-mcp
```
### From Source
```bash
# Clone the repository
git clone https://github.com/contextualizer-ai/ols-mcp.git
cd ols-mcp
# Install with uv (recommended)
uv sync --group dev
# Or with pip
pip install -e .
```
## Usage
### As MCP Server
The primary use case is as an MCP server that provides ontology search capabilities to AI agents and applications.
#### Claude Desktop Integration
Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json`):
```json
{
"mcpServers": {
"ols-mcp": {
"command": "ols-mcp",
"args": []
}
}
}
```
#### Claude Code Integration
```bash
claude mcp add ols-mcp
```
#### Goose Integration
```bash
goose session start --with-mcp "ols-mcp"
```
### Available Tools
The MCP server provides three main tools:
1. **`search_all_ontologies`** - Search across all ontologies in OLS
2. **`get_ontology_info`** - Get detailed information about a specific ontology
3. **`get_terms_from_ontology`** - Retrieve terms from a specific ontology
### Direct Python Usage
```python
from ols_mcp.tools import search_all_ontologies, get_ontology_info, get_terms_from_ontology
# Search for biological terms
results = search_all_ontologies("apoptosis", max_results=5)
# Get information about Gene Ontology
go_info = get_ontology_info("go")
# Get terms from a specific ontology
terms = get_terms_from_ontology("go", max_results=10)
```
### CLI Usage
#### Running the MCP Server
Run the MCP server directly:
```bash
ols-mcp
```
#### Testing Individual Tools
You can test the tools directly using Python:
```bash
# Search for biological terms across all ontologies
uv run python -c "from ols_mcp.tools import search_all_ontologies; print(search_all_ontologies('apoptosis', max_results=3))"
# Get information about Gene Ontology
uv run python -c "from ols_mcp.tools import get_ontology_info; print(get_ontology_info('go'))"
# Get terms from a specific ontology
uv run python -c "from ols_mcp.tools import get_terms_from_ontology; print(get_terms_from_ontology('go', max_results=3))"
```
#### MCP Protocol Testing
Test the MCP protocol directly:
```bash
# Test basic protocol handshake
make test-mcp
# Test extended protocol with tool calls
make test-mcp-extended
```
## Development
### Prerequisites
- Python 3.11+
- [uv](https://docs.astral.sh/uv/) (recommended) or pip
### Setup
```bash
# Clone the repository
git clone https://github.com/contextualizer-ai/ols-mcp.git
cd ols-mcp
# Install development dependencies
uv sync --group dev
```
### Available Make Targets
#### Development
- `make dev` - Install development dependencies
- `make install` - Install production dependencies only
- `make clean` - Clean build artifacts
#### Testing
- `make test-unit` - Run unit tests (fast, mocked)
- `make test-real-api` - Run integration tests against live OLS API
- `make test-mcp` - Test MCP protocol functionality
#### Code Quality and Maintenance
- `make format` - Format code with Black
- `make lint` - Run Ruff linter with fixes
- `make mypy` - Run type checking
- `make deptry` - Check for unused dependencies
- `make test-coverage` - Run all tests with coverage report
- `make test-integration` - Run integration tests
#### Build & Release
- `make build` - Build package distributions
- `make upload-test` - Upload to TestPyPI
- `make upload` - Upload to PyPI
- `make release` - Complete release workflow (test → build → upload)
#### Server Operations
- `make server` - Run the MCP server locally
- `make all` - Run complete CI pipeline
### Running Tests
```bash
# Run all tests
make test-coverage
# Run only unit tests (fast)
make test-unit
# Run integration tests against real OLS API
make test-real-api
# Run with specific pytest options
uv run pytest tests/ -v -k "test_search"
```
#### Code Quality Tools
The project uses modern Python tooling:
- **uv** - Fast Python package manager
- **ruff** - Fast Python linter and formatter
- **black** - Code formatting (alternative to ruff format)
- **mypy** - Static type checking
- **pytest** - Testing framework with coverage reporting
### Contributing
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Run the test suite: `make all`
5. Submit a pull request
### Release Process
Releases are automated via GitHub Actions:
1. Create and push a version tag:
```bash
git tag v0.1.4
git push origin v0.1.4
```
2. GitHub Actions will automatically:
- Run the full test suite
- Build the package
- Publish to PyPI
## Architecture
### Project Structure
```
ols-mcp/
├── src/ols_mcp/
│ ├── __init__.py
│ ├── main.py # FastMCP server setup
│ ├── api.py # OLS API wrapper functions
│ └── tools.py # MCP tools that wrap API functions
├── tests/
│ ├── test_api.py # Unit tests for API functions
│ ├── test_tools.py # Unit tests for MCP tools
│ └── test_integration.py # Integration tests with real OLS API
├── .github/workflows/ # CI/CD pipelines
├── Makefile # Development automation
└── pyproject.toml # Project configuration
```
### Key Components
- **`api.py`** - Low-level functions that interact with OLS REST API
- **`tools.py`** - Higher-level MCP tools that provide simplified interfaces
- **`main.py`** - FastMCP server that exposes tools via MCP protocol
## License
MIT
Raw data
{
"_id": null,
"home_page": null,
"name": "ols-mcp",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "bioinformatics, mcp, ols, ontology",
"author": null,
"author_email": "Justin Reese <justinreese@lbl.gov>",
"download_url": "https://files.pythonhosted.org/packages/a7/80/d857f3626b5bdb5c6dc7604aabdd3e014d1fcc7edb2f8175b627c214ec2a/ols_mcp-0.1.5.tar.gz",
"platform": null,
"description": "# ols-mcp\n\nA Model Context Protocol (MCP) server for retrieving information from the Ontology Lookup Service (OLS). \n\nThis package provides tools for searching ontologies, retrieving ontology details, and accessing ontology terms through a standardized MCP interface.\n\n## Installation\n\n### From PyPI\n\n```bash\npip install ols-mcp\n```\n\n### From Source\n\n```bash\n# Clone the repository\ngit clone https://github.com/contextualizer-ai/ols-mcp.git\ncd ols-mcp\n\n# Install with uv (recommended)\nuv sync --group dev\n\n# Or with pip\npip install -e .\n```\n\n## Usage\n\n### As MCP Server\n\nThe primary use case is as an MCP server that provides ontology search capabilities to AI agents and applications.\n\n#### Claude Desktop Integration\n\nAdd to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json`):\n\n```json\n{\n \"mcpServers\": {\n \"ols-mcp\": {\n \"command\": \"ols-mcp\",\n \"args\": []\n }\n }\n}\n```\n\n#### Claude Code Integration\n\n```bash\nclaude mcp add ols-mcp\n```\n\n#### Goose Integration\n\n```bash\ngoose session start --with-mcp \"ols-mcp\"\n```\n\n### Available Tools\n\nThe MCP server provides three main tools:\n\n1. **`search_all_ontologies`** - Search across all ontologies in OLS\n2. **`get_ontology_info`** - Get detailed information about a specific ontology\n3. **`get_terms_from_ontology`** - Retrieve terms from a specific ontology\n\n### Direct Python Usage\n\n```python\nfrom ols_mcp.tools import search_all_ontologies, get_ontology_info, get_terms_from_ontology\n\n# Search for biological terms\nresults = search_all_ontologies(\"apoptosis\", max_results=5)\n\n# Get information about Gene Ontology\ngo_info = get_ontology_info(\"go\")\n\n# Get terms from a specific ontology\nterms = get_terms_from_ontology(\"go\", max_results=10)\n```\n\n### CLI Usage\n\n#### Running the MCP Server\n\nRun the MCP server directly:\n\n```bash\nols-mcp\n```\n\n#### Testing Individual Tools\n\nYou can test the tools directly using Python:\n\n```bash\n# Search for biological terms across all ontologies\nuv run python -c \"from ols_mcp.tools import search_all_ontologies; print(search_all_ontologies('apoptosis', max_results=3))\"\n\n# Get information about Gene Ontology\nuv run python -c \"from ols_mcp.tools import get_ontology_info; print(get_ontology_info('go'))\"\n\n# Get terms from a specific ontology\nuv run python -c \"from ols_mcp.tools import get_terms_from_ontology; print(get_terms_from_ontology('go', max_results=3))\"\n```\n\n#### MCP Protocol Testing\n\nTest the MCP protocol directly:\n\n```bash\n# Test basic protocol handshake\nmake test-mcp\n\n# Test extended protocol with tool calls\nmake test-mcp-extended\n```\n\n## Development\n\n### Prerequisites\n\n- Python 3.11+\n- [uv](https://docs.astral.sh/uv/) (recommended) or pip\n\n### Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/contextualizer-ai/ols-mcp.git\ncd ols-mcp\n\n# Install development dependencies\nuv sync --group dev\n```\n\n### Available Make Targets\n\n#### Development\n- `make dev` - Install development dependencies\n- `make install` - Install production dependencies only\n- `make clean` - Clean build artifacts\n\n#### Testing\n- `make test-unit` - Run unit tests (fast, mocked)\n- `make test-real-api` - Run integration tests against live OLS API\n- `make test-mcp` - Test MCP protocol functionality\n\n#### Code Quality and Maintenance\n- `make format` - Format code with Black\n- `make lint` - Run Ruff linter with fixes\n- `make mypy` - Run type checking\n- `make deptry` - Check for unused dependencies\n- `make test-coverage` - Run all tests with coverage report\n- `make test-integration` - Run integration tests\n\n#### Build & Release\n- `make build` - Build package distributions\n- `make upload-test` - Upload to TestPyPI\n- `make upload` - Upload to PyPI\n- `make release` - Complete release workflow (test \u2192 build \u2192 upload)\n\n#### Server Operations\n- `make server` - Run the MCP server locally\n- `make all` - Run complete CI pipeline\n\n### Running Tests\n\n```bash\n# Run all tests\nmake test-coverage\n\n# Run only unit tests (fast)\nmake test-unit\n\n# Run integration tests against real OLS API\nmake test-real-api\n\n# Run with specific pytest options\nuv run pytest tests/ -v -k \"test_search\"\n```\n\n#### Code Quality Tools\n\nThe project uses modern Python tooling:\n\n- **uv** - Fast Python package manager\n- **ruff** - Fast Python linter and formatter\n- **black** - Code formatting (alternative to ruff format)\n- **mypy** - Static type checking\n- **pytest** - Testing framework with coverage reporting\n\n### Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Run the test suite: `make all`\n5. Submit a pull request\n\n### Release Process\n\nReleases are automated via GitHub Actions:\n\n1. Create and push a version tag:\n ```bash\n git tag v0.1.4\n git push origin v0.1.4\n ```\n\n2. GitHub Actions will automatically:\n - Run the full test suite\n - Build the package\n - Publish to PyPI\n\n## Architecture\n\n### Project Structure\n\n```\nols-mcp/\n\u251c\u2500\u2500 src/ols_mcp/\n\u2502 \u251c\u2500\u2500 __init__.py\n\u2502 \u251c\u2500\u2500 main.py # FastMCP server setup\n\u2502 \u251c\u2500\u2500 api.py # OLS API wrapper functions\n\u2502 \u2514\u2500\u2500 tools.py # MCP tools that wrap API functions\n\u251c\u2500\u2500 tests/\n\u2502 \u251c\u2500\u2500 test_api.py # Unit tests for API functions\n\u2502 \u251c\u2500\u2500 test_tools.py # Unit tests for MCP tools\n\u2502 \u2514\u2500\u2500 test_integration.py # Integration tests with real OLS API\n\u251c\u2500\u2500 .github/workflows/ # CI/CD pipelines\n\u251c\u2500\u2500 Makefile # Development automation\n\u2514\u2500\u2500 pyproject.toml # Project configuration\n```\n\n### Key Components\n\n- **`api.py`** - Low-level functions that interact with OLS REST API\n- **`tools.py`** - Higher-level MCP tools that provide simplified interfaces\n- **`main.py`** - FastMCP server that exposes tools via MCP protocol\n\n## License\n\nMIT\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2024 Justin Reese\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.",
"summary": "MCP for retrieving things from the Ontology Lookup Service",
"version": "0.1.5",
"project_urls": {
"Documentation": "https://github.com/justaddcoffee/ols-mcp#readme",
"Homepage": "https://github.com/justaddcoffee/ols-mcp",
"Issues": "https://github.com/justaddcoffee/ols-mcp/issues",
"Repository": "https://github.com/justaddcoffee/ols-mcp"
},
"split_keywords": [
"bioinformatics",
" mcp",
" ols",
" ontology"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "a22e4a90d95c70568fba4066b6318fdd8146e9d0012218c2190e90bbfcc7ca79",
"md5": "d8491e87d8f35e856b09aee5b874adb7",
"sha256": "06641b42eda82fa485592e8b69c187a508a7f80aef8c508ca1198b512b5d765f"
},
"downloads": -1,
"filename": "ols_mcp-0.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d8491e87d8f35e856b09aee5b874adb7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 9217,
"upload_time": "2025-07-10T14:50:47",
"upload_time_iso_8601": "2025-07-10T14:50:47.740659Z",
"url": "https://files.pythonhosted.org/packages/a2/2e/4a90d95c70568fba4066b6318fdd8146e9d0012218c2190e90bbfcc7ca79/ols_mcp-0.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "a780d857f3626b5bdb5c6dc7604aabdd3e014d1fcc7edb2f8175b627c214ec2a",
"md5": "682fbe0cb35c99adf89d407595c7131b",
"sha256": "7028123ac004a3845ea99c107b355610752dfe34ffd438fb0c315f4ee7491152"
},
"downloads": -1,
"filename": "ols_mcp-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "682fbe0cb35c99adf89d407595c7131b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 11703,
"upload_time": "2025-07-10T14:50:48",
"upload_time_iso_8601": "2025-07-10T14:50:48.511085Z",
"url": "https://files.pythonhosted.org/packages/a7/80/d857f3626b5bdb5c6dc7604aabdd3e014d1fcc7edb2f8175b627c214ec2a/ols_mcp-0.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-10 14:50:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "justaddcoffee",
"github_project": "ols-mcp#readme",
"github_not_found": true,
"lcname": "ols-mcp"
}