Skip to main content

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 instance
  • search_tools: Find Galaxy tools by name
  • get_tool_details: Retrieve detailed tool information
  • run_tool: Execute a Galaxy tool with parameters
  • get_tool_panel: Retrieve the Galaxy tool panel structure
  • get_user: Get current user information
  • get_histories: List available Galaxy histories
  • list_history_ids: Get simplified list of history IDs and names
  • get_history_details: Get detailed information about a specific history
  • upload_file: Upload local files to Galaxy
  • get_invocations: View workflow executions
  • get_iwc_workflows: Access Interactive Workflow Composer workflows
  • search_iwc_workflows: Search IWC workflows by keywords
  • import_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 authentication
  • test_history_operations.py - History-related operations
  • test_dataset_operations.py - Dataset upload/download
  • test_tool_operations.py - Tool search and execution
  • test_workflow_operations.py - Workflow import and invocation
  • test_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

MIT

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

galaxy_mcp-0.1.0.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

galaxy_mcp-0.1.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

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

Hashes for galaxy_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3582d748f6cdb43b964c4f6fe16e1a790d50f148b2056da5fc84cf18aa29e5dd
MD5 9704686acd9a8022585fc35385173466
BLAKE2b-256 4440a35e8c1cb80778efc4143023558593bafb5616f273c204c34a10d9483cec

See more details on using hashes here.

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

Hashes for galaxy_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f343e9e22824dd61a6542caf12a60d3943c53167c6e53e50b9857e90796df561
MD5 2309a0d698653fc9a1703bd0d8679bbe
BLAKE2b-256 bcc248960552ea96cfd67e8e629b43ad7cf9316dba82be939ed1ebdc2d1f6e6e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page