Comprehensive Python SDK, MCP server, and compliance test suite for GA4GH specifications
Project description
ai4gh
Comprehensive Python SDK, MCP server, and compliance test suite for GA4GH (Global Alliance for Genomics and Health) specifications.
Features
- Unified SDK: Single Python package covering 14 GA4GH specifications
- MCP Server: Full Model Context Protocol surface with 13 tools, 14 resources, 5 prompts
- Compliance Testing: Per-spec test suites with JSON/HTML/JUnit reporting
- Plugin Architecture: Install only the specs you need via pip extras
- Async-First: All network operations are async (httpx + tenacity)
- CLI:
ai4ghcommand for compliance testing, MCP serving, and configuration
Quick Run (no install)
# Run directly with uvx — no install needed
uvx ai4gh --help
uvx ai4gh mcp serve
uvx ai4gh test beacon https://beacon.example.org
Installation
# Core only
pip install ai4gh
# With specific specs
pip install "ai4gh[beacon,drs]"
# Everything
pip install "ai4gh[all]"
# Development
uv sync --extra dev
Quick Start
Python SDK
from ai4gh.specs.drs.client import DRSClient
async with DRSClient(base_url="https://drs.example.org") as client:
obj = await client.get_object("drs://example/abc123")
print(obj.name, obj.size)
Beacon Query
from ai4gh.specs.beacon.client import BeaconClient
async with BeaconClient(base_url="https://beacon.example.org") as client:
result = await client.query("BRCA1")
print(result)
MCP Server
# Start MCP server on stdio
ai4gh mcp serve
Compliance Testing
# Run compliance tests
ai4gh test beacon https://beacon.example.org
# JSON report
ai4gh test drs https://drs.example.org --format json -o report.json
# HTML report
ai4gh test beacon https://beacon.example.org --format html -o report.html
# List available test suites
ai4gh list-specs
Configuration
# Show current config
ai4gh config show
# Initialize config file
ai4gh config init
GA4GH Specifications Covered
| Spec | Plugin | Phase | Status |
|---|---|---|---|
| Beacon v2 | ai4gh[beacon] |
Tier 1 | Done |
| DRS v1.4 | ai4gh[drs] |
Tier 1 | Done |
| htsget v1.3 | ai4gh[htsget] |
Tier 1 | Done |
| refget v2 | ai4gh[refget] |
Tier 1 | Done |
| Phenopackets v2 | ai4gh[phenopackets] |
Tier 1 | Done |
| VRS v2.0 | ai4gh[vrs] |
Tier 1 | Done |
| WES v1.1 | ai4gh[wes] |
Tier 2 | Done |
| TES v1.1 | ai4gh[tes] |
Tier 2 | Done |
| TRS v2.0.1 | ai4gh[trs] |
Tier 2 | Done |
| Data Connect v1 | ai4gh[data-connect] |
Tier 2 | Done |
| Passports v1 | ai4gh[passports] |
Tier 3 | Done |
| DUO | ai4gh[duo] |
Tier 3 | Done |
| Crypt4GH v1 | ai4gh[crypt4gh] |
Tier 3 | Done |
| Pedigree v1 | ai4gh[pedigree] |
Tier 3 | Done |
| Cat-VRS v1 | (in vrs) | Tier 3 | Done |
| VA-Spec v1 | (in vrs) | Tier 3 | Done |
MCP Server
The MCP server exposes GA4GH operations as tools for AI agents (Claude Code, Cursor, etc.).
Tools (13)
drs_get_object- Get a DRS object by IDbeacon_query- Query a Beacon v2 serverhtsget_reads- Get read data from htsgetrefget_sequence- Get reference sequence by checksumvrs_compute_id- Compute VRS identifierphenopacket_validate- Validate a Phenopacketwes_submit_run- Submit workflow to WEStes_create_task- Create TES tasktrs_search_tools- Search TRS registrydata_connect_search- Query via Data Connectpassport_decode- Decode GA4GH Passport JWTduo_match- Check DUO compatibilitypedigree_validate- Validate pedigree structure
Resources (15)
ga4gh://specs- Specification indexga4gh://specs/{spec_id}- Individual spec metadata (14 specs)
Prompts (5)
find_variants- Search for genetic variants across beaconspatient_summary- Generate clinical summary from Phenopacketrare_disease_search- Search federated rare disease dataworkflow_submit- Submit bioinformatics workflowcompliance_report- Generate compliance report
Claude Code / MCP Integration
Add to your Claude Code MCP config (.claude/settings.json):
{
"mcpServers": {
"ai4gh": {
"command": "uvx",
"args": ["ai4gh", "mcp", "serve"]
}
}
}
All 13 tools become available to Claude as MCP tools. No install required.
Architecture
ai4gh/
core/ # Config, auth, transport, plugin system
specs/ # Per-spec plugins (client + models)
beacon/ # Beacon v2
drs/ # Data Repository Service
htsget/ # Streaming reads/variants
refget/ # Reference sequences
phenopackets/ # Clinical phenotype exchange
vrs/ # Variant representation
wes/ # Workflow execution
tes/ # Task execution
trs/ # Tool registry
data_connect/ # SQL-like data queries
passports/ # Federated auth (JWT)
duo/ # Data use ontology
crypt4gh/ # File encryption
pedigree/ # Family relationships
cat_vrs/ # Categorical variants
va_spec/ # Variant annotation
mcp/ # MCP server (tools, resources, prompts)
compliance/ # Compliance test suites + report generation
cli/ # Typer CLI
Development
# Install with dev dependencies
uv sync --extra dev
# Run tests
uv run pytest
# Run tests with coverage
uv run pytest --cov=ai4gh --cov-report=term-missing
# Lint
uv run ruff check .
# Type check
uv run mypy src/
# Build
uv run hatch build
License
Apache-2.0
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 ai4gh-1.0.0.tar.gz.
File metadata
- Download URL: ai4gh-1.0.0.tar.gz
- Upload date:
- Size: 242.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3adeb08998108b34428f8b53d2b9583debc9cc73d55cd80da76e0f270cfe6a46
|
|
| MD5 |
4526dbd7b4c417c9bb75bbb298c6288a
|
|
| BLAKE2b-256 |
00c37a05ba47d4521fcc4a87785647c360644c5c94fa9299eeba71926110eac2
|
Provenance
The following attestation bundles were made for ai4gh-1.0.0.tar.gz:
Publisher:
ci.yml on susheel/ai4gh
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai4gh-1.0.0.tar.gz -
Subject digest:
3adeb08998108b34428f8b53d2b9583debc9cc73d55cd80da76e0f270cfe6a46 - Sigstore transparency entry: 947365680
- Sigstore integration time:
-
Permalink:
susheel/ai4gh@7e8071e4d2daab2edf3b7e2342916487d7a15797 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/susheel
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@7e8071e4d2daab2edf3b7e2342916487d7a15797 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ai4gh-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ai4gh-1.0.0-py3-none-any.whl
- Upload date:
- Size: 73.9 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 |
efc7f543216da5e54b199e320f1408f4ec46251a257deb5c98dd6cf83a4c0458
|
|
| MD5 |
cb17a8d7e8b8160ad84971875bfc5d76
|
|
| BLAKE2b-256 |
45d5b1fc134426eb8b0d03f1033fa0f1d32e0b671570876a32faa7f5056c7de9
|
Provenance
The following attestation bundles were made for ai4gh-1.0.0-py3-none-any.whl:
Publisher:
ci.yml on susheel/ai4gh
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai4gh-1.0.0-py3-none-any.whl -
Subject digest:
efc7f543216da5e54b199e320f1408f4ec46251a257deb5c98dd6cf83a4c0458 - Sigstore transparency entry: 947365682
- Sigstore integration time:
-
Permalink:
susheel/ai4gh@7e8071e4d2daab2edf3b7e2342916487d7a15797 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/susheel
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@7e8071e4d2daab2edf3b7e2342916487d7a15797 -
Trigger Event:
release
-
Statement type: