Model Context Protocol server for Galaxy bioinformatics platform
Project description
Galaxy MCP Server - Python Implementation
This is the Python implementation of the Galaxy MCP server, providing a Model Context Protocol server for interacting with Galaxy instances.
Features
- Complete Galaxy API integration through BioBlend
- Interactive Workflow Composer (IWC) integration
- FastMCP server for high-performance operation
- Type-annotated Python codebase
Requirements
- Python 3.12+
- BioBlend 1.5.0+
- MCP SDK 1.6.0+
- Requests 2.32.3+
Installation
From PyPI (Recommended)
# Install from PyPI
pip install galaxy-mcp
# Or using uv package manager
uv pip install galaxy-mcp
From Source
# Clone the repository
git clone https://github.com/galaxyproject/galaxy-mcp.git
cd galaxy-mcp/mcp-server-galaxy-py
# Install in development mode
pip install -e .
# Or using uv package manager
uv pip install -e .
Configuration
The server requires Galaxy credentials to connect to an instance. You can provide these via environment variables:
export GALAXY_URL=<galaxy_url>
export GALAXY_API_KEY=<galaxy_api_key>
Alternatively, create a .env file in the project root with these variables.
Usage
As a standalone MCP server
# Run the MCP server
galaxy-mcp
# The server will wait for MCP protocol messages on stdin
With MCP clients
# Use with MCP CLI tools
mcp connect galaxy-mcp
# Use with MCP developer tools
mcp dev galaxy-mcp
# Use with other MCP-compatible clients
your-mcp-client galaxy-mcp
See USAGE_EXAMPLES.md for detailed usage patterns and common examples.
Available MCP Tools
The Python implementation provides the following MCP tools:
connect: Establish connection to a Galaxy instancesearch_tools: Find Galaxy tools by nameget_tool_details: Retrieve detailed tool informationrun_tool: Execute a Galaxy tool with parametersget_tool_panel: Retrieve the Galaxy tool panel structureget_user: Get current user informationget_histories: List available Galaxy historieslist_history_ids: Get simplified list of history IDs and namesget_history_details: Get detailed information about a specific historyupload_file: Upload local files to Galaxyget_invocations: View workflow executionsget_iwc_workflows: Access Interactive Workflow Composer workflowssearch_iwc_workflows: Search IWC workflows by keywordsimport_workflow_from_iwc: Import an IWC workflow to Galaxy
Testing
The project includes a comprehensive test suite using pytest with mock-based testing.
Running Tests
# Install test dependencies
uv pip install -r requirements-test.txt
# Run all tests
uv run pytest
# Run with coverage report
uv run pytest --cov=main --cov-report=html
# Run specific test file
uv run pytest tests/test_history_operations.py
# Run tests with verbose output
uv run pytest -v
Test Structure
Tests are organized by functionality:
test_connection.py- Galaxy connection and authenticationtest_history_operations.py- History-related operationstest_dataset_operations.py- Dataset upload/downloadtest_tool_operations.py- Tool search and executiontest_workflow_operations.py- Workflow import and invocationtest_integration.py- End-to-end scenarios
See tests/README.md for more details on the testing strategy.
Development
Code Style Guidelines
- Use Python 3.12+ features
- Employ type hints where appropriate
- Follow PEP 8 style guidelines
Development Commands
- Lint the code:
ruff check . - Format the code:
ruff format . - Start the development server:
mcp dev main.py
License
Project details
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 galaxy_mcp-0.1.0.tar.gz.
File metadata
- Download URL: galaxy_mcp-0.1.0.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3582d748f6cdb43b964c4f6fe16e1a790d50f148b2056da5fc84cf18aa29e5dd
|
|
| MD5 |
9704686acd9a8022585fc35385173466
|
|
| BLAKE2b-256 |
4440a35e8c1cb80778efc4143023558593bafb5616f273c204c34a10d9483cec
|
File details
Details for the file galaxy_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: galaxy_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f343e9e22824dd61a6542caf12a60d3943c53167c6e53e50b9857e90796df561
|
|
| MD5 |
2309a0d698653fc9a1703bd0d8679bbe
|
|
| BLAKE2b-256 |
bcc248960552ea96cfd67e8e629b43ad7cf9316dba82be939ed1ebdc2d1f6e6e
|