Gigwa-MCP
Gigwa-MCP is an MCP server that drives a Gigwa genotyping-data platform in plain language, covering import, discovery/export, QC/diversity analysis and import-quality auditing.
Connect & inspect: verify connectivity/version, list databases/projects/runs, switch Gigwa servers at runtime, list variant sets, sequences and export formats.
Import data: load DArTseq SNP/Silico xlsx reports (correct 2-row genotype calling), plain VCF, and per-individual metadata; optionally genome-anchor DArTseq tags via minimap2; validate metadata before importing.
Manage imports: poll progress with a token or abort a running import.
Search & export (read-only): count/search variants server-side with region/MAF/missing filters, export a variant set or filtered/selected subset (VCF, PLINK, FLAPJACK, VCF.gz…), track and fetch async exports.
Metadata discovery: dump per-sample callsets, fetch germplasm attributes, list metadata fields/values, and filter individuals by metadata.
QC: call rate, heterozygosity outliers, duplicate/clonal accessions, MAF/missingness filter reporting.
Diversity & population genetics: diversity summary (MAF/He/Ho/PIC), PCA, kinship (VanRaden GRM), pairwise Fst, per-group diversity, core-collection selection, structure clustering (PCA+K-means) and UPGMA trees.
Audit: scan an instance or single run for genotype-encoding import artifacts, ranking runs BROKEN/SUSPECT/OK.
All read-only analyses compute in Python (scikit-allel/numpy/scipy) and write CSVs/Newick under
./gigwa_results/<module>/, never modifying Gigwa.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Gigwa-MCP import DArTseq report and run diversity analysis"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Gigwa MCP Server
An MCP server that drives a local or remote Gigwa installation over its REST API. It lets an MCP client (Codex CLI / Claude Desktop / Claude Code) run the whole genotyping workflow in plain language: connect → import genotype data & metadata → run QC and diversity analyses → audit databases for import artifacts. Built for genomic-resources teams and genebanks, but works with any Gigwa instance.
Import DArTseq SNP/Silico xlsx reports (with correct 2-row genotype calling) or plain VCF, plus per-individual metadata.
Analyse read-only: genotypes are pulled out of Gigwa and all statistics are computed in Python (scikit-allel / numpy / scipy). Nothing is written back.
Audit an existing instance to find databases that were imported badly.
Every analysis returns a chat summary and writes full tables as CSV under
./gigwa_results/<database>/.
Table of contents
Related MCP server: Cloud Life Sciences API MCP Server
Overview
Gigwa is a web platform for storing and querying genotyping data. Loading data into it and getting analyses out is normally manual (massaging xlsx into Gigwa's import format, clicking through the web UI, uploading .dart/.vcf, exporting VCFs, running pop-gen tools separately).
This server exposes Gigwa as a set of MCP tools. You talk to your MCP client in natural language; it picks the matching tool and fills in the arguments. There is no chat API of its own, meaning the "interface" is the tool list below plus your prompts.
The analysis tools are read-only: they extract genotypes (via async VCF export or
paged BrAPI allelematrix), compute everything in Python, and write CSVs locally. They
never modify the data in Gigwa.
Features
Import pipeline
Tool | What it does |
| Switch the active Gigwa server at runtime (credentials from the environment, never the chat) |
| Verify connectivity/auth and report the server version |
| List databases → projects → runs on the instance |
| Call genotypes from DArTseq SNP/Silico xlsx report(s) → VCF and import (optionally genome-anchored via |
| Import a |
| Align DArT tag sequences to a reference genome to infer each marker's chromosome/position |
| Validate an individual-metadata TSV without importing |
| Import per-individual attributes into a database |
| Poll a running import by its progress token |
| Cancel a running import (or other process) by its progress token |
Discovery, search & export (read-only)
Tool | What it does |
| List every run with its exact BrAPI |
| List the chromosomes/contigs of a variant set (valid |
| Count variants matching region / MAF / missing-data filters, server-side (no download) |
| Search variants server-side and write the matching list ( |
| List the export formats this build actually offers, with variant-type/ploidy limits |
| Export a variant set — or a filtered/selected subset — to a file; |
| Status of this session's running export (started with |
| Download a completed export once |
| Dump per-sample (callset) metadata — names + |
| Pull server-stored per-individual attributes ( |
| List individual-metadata field names and their distinct values |
| Select individuals by metadata field/value filters (feeds |
QC & diversity (read-only)
Tool | What it does |
| Per-sample & per-marker call rate; flag low-call samples/markers |
| Per-sample Ho; flag outliers (contamination / off-type / selfed) |
| Pairwise IBS → group duplicate/clonal accessions |
| Report markers that MAF / missingness filters would remove |
| Per-marker MAF, He, Ho, PIC, Fis + dataset means |
| PCA of population structure; variance explained + PC coords (optional |
| VanRaden genomic relationship (kinship) matrix |
| Pairwise Weir & Cockerham Fst between groups |
| Per-population He, Ho, Fis, MAF, % polymorphic + (rarefied) allelic richness |
| Greedy allele-coverage core: smallest accession set capturing the most diversity |
| Lightweight ancestry with PCA + K-means, pseudo-F suggests K (no ADMIXTURE binary) |
| UPGMA dendrogram of accessions from IBS distance, written as Newick ( |
Every QC & diversity tool also accepts region ("chrom" or "chrom:start-end", 1-based;
from list_sequences) to restrict the analysis to one genomic window.
Import-quality audit
Tool | What it does |
| Scan a whole instance (or one run) for genotype-encoding artifacts left by a bad import; rank runs BROKEN / SUSPECT / OK |
How it works
MCP client (Claude Desktop / Code)
│ natural language → tool call
▼
gigwa_mcp (this server, stdio)
│ GigwaClient: token auth, multipart upload, async progress, BrAPI v2
▼
Gigwa REST API ──► genotypes (async VCF export ‖ paged search/allelematrix)
│
▼
scikit-allel / numpy / scipy → chat summary + CSV under ./gigwa_results/<module>/Analyses load genotypes through gigwa_mcp/analysis/genotypes.py:load_genotypes, which
has two backends:
method="vcf"(default) : exports the whole variant set once via async VCF and caches it on disk for reuse. Best for small/medium sets and when you will run several tools on the same run.method="allelematrix": pages the genotype matrix via BrAPIsearch/allelematrix, honouring a server-sidemax_markerssubset and sizing pages to the server's per-response cell cap, and caches the result in-process per(variant set, caps)so repeat tool calls reuse it. Best for large datasets where a full export is wasteful (see Performance & scaling).
Variant sets are addressed by their BrAPI variantSetDbId, of the form
MODULE§projectNumber§run (e.g. MyDatabase§1§run1). list_content shows them.
Requirements
Python ≥ 3.10
uv(provides theuvxcommand) is required if you launch the server withuvx gigwa-mcp(the recommended MCP-client setup below). Not needed if youpip/pipx-install the package and point your client at the resulting executable instead. Install it withcurl -LsSf https://astral.sh/uv/install.sh | sh(macOS/Linux) orpip install uv, then make sureuvxis on yourPATH(see the note below).A reachable Gigwa server (local or remote). Credentials are optional for public data; the default ICARDA connection is anonymous.
Optional: the minimap2 CLI on
PATHfor DArTseq genome-anchoring of very large genomes (otherwise the in-processmappybinding is used).Optional: the
[viz]extra (matplotlib) to run the plotting recipes / regenerate the example figures.
Core Python dependencies (installed automatically): mcp, httpx, pandas, openpyxl,
numpy, python-dotenv, scikit-allel, scipy, mappy.
Starting with 1.9.2, mappy is installed automatically only on non-Windows platforms
(including Linux and macOS). Windows installations skip it. Reference mapping still
requires a usable minimap2 CLI or mappy backend; use Linux/Docker when neither is
available. Other tools do not require mappy. Native Windows installation of the full
dependency set has not yet been verified.
Installation
Two steps: get the server, then point your MCP client at it. The client launches it for you — you never run it by hand. With no configuration it connects to the public ICARDA instance anonymously, so you can try everything before setting up credentials.
Try it first (no install)
gigwa-mcp is listed in the Glama MCP directory,
where you can browse its tools and run it live in the in-browser MCP Inspector — no setup
or credentials needed. Glama also generates a ready-to-paste config for common clients; under
the hood it runs uvx gigwa-mcp, exactly like the steps below.
1. Get it
Pick one. uvx is the simplest — it downloads and runs the published package on demand, with no install step and nothing to update.
Route | Command | Notes |
uvx (recommended) |
| Needs uv. Pin a release with |
pip |
| Into a venv you manage; |
pipx |
| Isolated environment, managed for you. |
Docker |
| Multi-arch |
From source |
| For development; see below. |
MCPB bundle | Desktop clients that support MCPB. Linux x86-64 + Python 3.13 only. |
A dedicated virtual environment, if you prefer an explicit path to point your client at:
python3 -m venv "$HOME/.local/share/gigwa-mcp-venv"
"$HOME/.local/share/gigwa-mcp-venv/bin/python" -m pip install gigwa-mcp
"$HOME/.local/share/gigwa-mcp-venv/bin/gigwa-mcp" --helpFrom source, for development or to run an unreleased checkout:
git clone https://github.com/gkanogiannis/Gigwa-MCP.git
cd Gigwa-MCP
python3 -m venv venv
venv/bin/python -m pip install -e ".[dev]" # drop -e and [dev] for a plain install
venv/bin/gigwa-mcp --helpThe server looks for .env in its working directory and parent directories, not beside
its executable — so with a source checkout, launch it from the repository root (see the Codex
example below) or set the variables in your client config.
If your client reports
Executable not found in $PATH: "uvx", theuvinstaller putuvxin~/.local/bin(or~/.cargo/bin) and the app launching your client cannot see it. Restart the app after installing, use the absolute path fromcommand -v uvx, or install withpipx install gigwa-mcpand usegigwa-mcpas the command instead.
2. Point your client at it
Client | Command |
Claude Code |
|
Codex CLI |
|
Claude Desktop and other JSON configs | see the snippet below |
Add credentials with -e, or leave them out to use the public ICARDA instance:
claude mcp add gigwa --scope user \
-e GIGWA_URL=http://localhost:8080/gigwa \
-e GIGWA_USER=your_user -e GIGWA_PASS=your_password \
-- uvx gigwa-mcpIn plain words: gigwa is the name you are giving this tool; --scope user makes it
available in all your projects (--scope project shares it with your team through a
.mcp.json in the repo); everything after -- is the command that actually starts the
server. Values passed with -e are stored in your client's configuration, and a literal
password also lands in your shell history — a .env file or inherited environment variables
avoid both. See Configuration.
Check it worked. In Claude Code type /mcp and look for gigwa; with Codex run
codex mcp get gigwa. Registration alone does not test connectivity, so ask
"Is my Gigwa up, and what version?" to make a real tool call. Then try "List the
databases."
For a different install route, swap the command after --: an absolute path for pip or
pipx (command -v gigwa-mcp), or, for a source checkout, env --chdir so the server finds
the repository's .env:
codex mcp add gigwa -- env --chdir="$(pwd)" "$(pwd)/venv/bin/gigwa-mcp"JSON config (Claude Desktop, or any client configured by file):
{
"mcpServers": {
"gigwa": {
"command": "uvx",
"args": ["gigwa-mcp"],
"env": {
"GIGWA_URL": "http://localhost:8080/gigwa",
"GIGWA_USER": "your_user",
"GIGWA_PASS": "your_password"
}
}
}
}Use "command": "/abs/path/to/venv/bin/gigwa-mcp" with no args for a virtual-environment
install. Every tool call authenticates on its own, so there is no per-chat "connect" step. To
drive several servers, either register one entry each (gigwa-local, gigwa-remote) and name
the one you mean in the prompt, or switch at runtime with gigwa_connect — pre-set a
GIGWA_USER_<PROFILE> / GIGWA_PASS_<PROFILE> pair per server so no secret is typed into the
chat.
Installing from the MCPB bundle
MCPB desktop extensions install by opening the file in a desktop client that supports the format. Download GigwaMCP.mcpb from the latest release, or a specific version from the releases page. It is a release asset rather than a file in the repository because it is ~86 MB.
The bundle carries CPython 3.13 Linux x86-64 native libraries and needs a matching system
with Python 3.13 on PATH — Python itself is not bundled, and its manifest launches python3,
so that command must resolve to 3.13. Upstream documents Claude Desktop MCPB support for macOS
and Windows, which this Linux bundle cannot serve; a successful mcpb pack does not verify
desktop-client compatibility. It does not include your .env credentials.
Codex CLI cannot import MCPB files. On a compatible Linux machine, extract the bundle into a fresh directory (to avoid mixing old and new dependencies) and register its Python module:
curl -LO https://github.com/gkanogiannis/Gigwa-MCP/releases/latest/download/GigwaMCP.mcpb
mkdir -p "$HOME/.local/share/gigwa-mcp-bundle"
unzip GigwaMCP.mcpb -d "$HOME/.local/share/gigwa-mcp-bundle"
codex mcp add gigwa \
--env "PYTHONPATH=$HOME/.local/share/gigwa-mcp-bundle:$HOME/.local/share/gigwa-mcp-bundle/venv/server/lib" \
-- python3.13 -m gigwa_mcpFor Codex the uvx route above is usually simpler.
Run with Docker
Run the server as a container instead of uvx/pipx. It speaks stdio either way, so your
MCP client starts it with docker run -i exactly as it would start uvx gigwa-mcp.
Pull the prebuilt image (published to the GitHub Container Registry, multi-arch
linux/amd64 + linux/arm64):
docker pull ghcr.io/gkanogiannis/gigwa-mcp:latest…or build it yourself:
docker build -t gigwa-mcp .The examples below use the local tag gigwa-mcp; swap in
ghcr.io/gkanogiannis/gigwa-mcp:latest to run the prebuilt image instead.
The image starts in stdio mode by default. To serve Streamable HTTP instead, explicitly set a port and publish it:
docker run -d --rm -p 8184:8184 -e GIGWA_MCP_PORT=8184 \
-e GIGWA_URL -e GIGWA_USER -e GIGWA_PASS gigwa-mcpMCP client config (Claude Desktop / Claude Code) — use docker as the command:
{
"mcpServers": {
"gigwa": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "GIGWA_URL", "-e", "GIGWA_USER", "-e", "GIGWA_PASS",
"-v", "/host/data:/data",
"gigwa-mcp"
],
"env": {
"GIGWA_URL": "http://host.docker.internal:8080/gigwa",
"GIGWA_USER": "your_user",
"GIGWA_PASS": "your_password"
}
}
}
}-iis required (stdio);--rmcleans up the container on exit.The bare
-e GIGWA_URLform forwards each value from theenvblock above into the container, so credentials stay in your client config, not in the image.
Files (volume mount). Mount a host directory at /data (the container's working
directory). Put import inputs there and reference them by their in-container path, e.g.
/data/report_snps.xlsx and /data/reference.sr.mmi. Analysis outputs are written to
/data/gigwa_results/<module>/, which appears in your mounted host directory.
Reaching Gigwa. A Gigwa running on your host is not at localhost from inside the
container:
macOS / Windows: use
http://host.docker.internal:8080/gigwa(works out of the box).Linux: add
"--add-host=host.docker.internal:host-gateway"toargsand use the same URL, or use"--network", "host"and pointGIGWA_URLathttp://localhost:8080/gigwa.Remote Gigwa: just set
GIGWA_URLto its address — no extra networking flags needed.
Configuration
Connection settings come from the environment, optionally seeded from a .env file in
the working directory or any parent (cp .env.example .env and edit):
GIGWA_URL=http://localhost:8080/gigwa
GIGWA_USER=your_user
GIGWA_PASS=your_password
# GIGWA_TIMEOUT=120 # optional, seconds — read/request timeout
# GIGWA_CONNECT_TIMEOUT=10 # optional, seconds — TCP connect onlyGIGWA_URL is the Gigwa base URL without the /rest suffix (it is appended
automatically). The target Gigwa may be local or remote. .env files are gitignored;
keep credentials out of version control.
Zero config. Every setting is optional — with no environment at all, the server
connects anonymously to the public ICARDA instance (https://gigwa.icarda.org:8443/gigwa),
so it works out of the box for a first look (a notice is printed to stderr). Set GIGWA_URL
to point at your own server.
Anonymous access. GIGWA_USER/GIGWA_PASS are optional — omit both to connect
as Gigwa's anonymous user, which can perform the public/read-only operations a given
instance exposes (discovery, list_content/list_variant_sets, search_callsets,
count_variants, and the read-only analyses on public data). Set both to authenticate
(required for import/write operations and private databases); setting only one is an error.
Switching servers mid-conversation. The gigwa_connect tool re-points every subsequent
tool at a different Gigwa server without a restart — e.g. "connect to
https://other.example:8443/gigwa". The new connection is verified with a live round-trip
before it takes effect (a failure rolls back to the previous one), and the change lasts for
the session (env config is restored on restart). Credentials never pass through the chat:
to reach a server that needs credentials, pre-set a named profile in the environment and
reference it by name — gigwa_connect(url, profile="prod") reads GIGWA_USER_PROD /
GIGWA_PASS_PROD. Use gigwa_connect(url, anonymous=true) to force unauthenticated access.
The default GIGWA_USER/GIGWA_PASS are reused only when reconnecting to the configured
GIGWA_URL — switching to a different server without a profile connects anonymously, so
your home credentials are never sent to another host by accident.
# A named credential profile for gigwa_connect(url, profile="prod")
GIGWA_USER_PROD=your_user
GIGWA_PASS_PROD=your_passwordQuick start
You talk to your MCP client in plain language; it calls the matching tool and fills in arguments (paths, thresholds, module names) from what you say. A typical first session:
You ask | Tool called |
"Is my Gigwa up, and what version?" |
|
"Connect and list the databases." |
|
"Import |
|
"Now run call-rate QC and a PCA on that run." |
|
"Scan the whole instance for badly imported databases." |
|
More example prompts:
You ask | Tool called |
"Load this VCF into project |
|
"Validate then import this individual-metadata TSV." |
|
"Find duplicate / clonal accessions." |
|
"Flag heterozygosity outliers (contamination / off-types)." |
|
"Which markers would a MAF 5% / 50%-missing filter drop?" |
|
"Give me per-marker MAF, He, Ho, PIC." |
|
"Compute the kinship matrix." |
|
"Compute Fst between these two groups of accessions." |
|
"Compare diversity (He/Ho/allelic richness) across my populations." |
|
"Pick a core collection of ~10% that captures the most diversity." |
|
"How many genetic clusters are in this collection?" |
|
"Build a UPGMA tree of the accessions." |
|
Tool reference
All variant-set tools take variant_set_db_id (MODULE§projectNumber§run). QC/diversity
tools also accept output_dir (defaults to ./gigwa_results/<module>/), the scaling
args max_markers / method ("vcf" | "allelematrix"), and region
("chrom" / "chrom:start-end"); see Performance & scaling.
Connection & import
Tool | Key arguments | Returns / writes |
|
| switches the active server (verified); creds from env ( |
| (none) | server version + auth check |
| (none) | database → project → run hierarchy |
|
| imports a DArTseq report; marker/sample counts + final status |
|
| imports a |
|
|
|
|
| validation issues (no import) |
|
| imports per-individual attributes |
|
| current async-job status |
|
| requests cancellation of a running process |
Discovery, search & export
Tool | Key arguments | Returns / writes |
| (none) | every run's exact |
|
| chromosomes/contigs (valid |
|
| server-side match count (no download) |
| same filters as |
|
| (none) | the instance's export handlers + type/ploidy limits |
|
| writes the export file; |
| (none) | status of this session's export |
|
| writes the completed export |
|
|
|
|
|
|
|
| metadata fields + distinct values |
|
| matching individual identifiers |
QC & diversity (output files listed in Output files)
Tool | Key arguments | Flags / interprets |
|
| samples/markers below threshold |
|
| Ho outliers; warns if cohort mean Ho implausibly high |
|
| duplicate/clone groups; warns on degenerate clustering |
|
| counts monomorphic / low-MAF / high-missing markers |
| (none) | dataset means; warns on strongly negative Fis |
|
| variance explained + PC1/PC2 outliers |
|
| mean off-diagonal, top related pairs, inbreeding diagonal |
|
| pairwise Fst |
|
| per-group He/Ho/Fis/MAF/%poly/allelic richness |
|
| core set + % of diversity captured |
|
| suggested K (pseudo-F) + per-K table; warns on degenerate clustering |
|
| UPGMA Newick ( |
Audit
Tool | Key arguments | Returns / writes |
|
| ranked BROKEN/SUSPECT/OK + |
Prompts & resources
Besides tools, the server exposes MCP prompts and resources (visible in clients that support them, and in directories like glama.ai).
Prompts — reusable, argument-driven workflows that chain the right tools for a task:
Prompt | Arguments | What it walks you through |
|
| import a DArTseq/VCF dataset, then the standard QC + audit |
|
| summary → PCA/structure → kinship → tree (+ per-group Fst) |
|
| full QC suite + a go/no-go verdict for downstream analysis |
| (none) | server info → list content/variant sets → instance-wide audit |
|
| sequences → count/search variants → region-filtered diversity |
Resources — read-only endpoints a client can fetch:
Resource | Contents |
| categorised catalog of all tools with their EDAM operation/topic tags |
| configured connection info (target URL + auth mode); no network call |
Skills
The repo also ships Agent Skills (the open SKILL.md standard)
under skills/ — task-oriented guides that teach an agent how to drive the tools
above. They mirror the five workflow prompts and are discoverable on the
LobeHub Skills Marketplace and other SKILL.md directories.
The capability stays in the MCP server; the skills just sequence and explain the tools.
Skill | Mirrors prompt | What it does |
|
| import DArTseq/VCF, then the full QC + audit and a clean/not-clean judgement |
|
| diversity + structure + relatedness (PCA, structure, kinship, tree; optional by-group/Fst) |
|
| full QC suite on an imported run → go/no-go verdict |
|
| no-arg instance survey + health check |
|
| variant density + local diversity within one region |
See skills/README.md for the layout, prerequisites, and how to validate
or install them.
Usage scenarios
A. Import a DArTseq report, genome-anchored. Map the tag sequences once, inspect, then import reusing the positions:
"Where do these DArT markers sit on the X genome at
reference.sr.mmi?" →map_dartseq_to_reference"Looks good, importreport_snps.xlsxintoMYDBreusing that mapping." →import_dartseq(..., positions_csv=...)
B. Vet an instance you inherited. Before trusting any analysis, triage every run for encoding artifacts:
"Scan my whole Gigwa for databases that were imported badly." →
audit_import_qualityRuns are ranked BROKEN / SUSPECT / OK with reasons, and the full table lands inimport_quality_scan.csv.
C. Genebank cleaning. Classic data-cleaning sweep on one run:
"Check call rates, flag heterozygosity outliers, and find duplicate accessions in
MYDB§1§run1." →qc_call_rate→qc_heterozygosity→qc_duplicate_accessions.
D. Diversity & structure study.
"Give me a diversity summary, a PCA, the number of clusters, and a UPGMA tree for
MYDB§1§run1." →diversity_summary→diversity_pca→diversity_structure→diversity_tree.
E. Build a core collection.
"Pick a core of ~10% of accessions that captures the most allelic diversity." →
diversity_core_collection(fraction=0.1).
F. Population comparisons from metadata. Provide a metadata TSV with a grouping column
(e.g. country, population):
"Using
meta.tsvgrouped bypopulation, compare per-group diversity and compute pairwise Fst." →diversity_by_group(metadata_tsv="meta.tsv", group_column="population")→diversity_fst(...).
Output files
Each analysis writes one or more CSVs (Newick for the tree) under
./gigwa_results/<module>/ (the audit writes to ./gigwa_results/):
File | Written by | Contents |
|
| per-sample / per-marker call rate + flags |
|
| per-sample Ho, z-score, flag |
|
| IBS pairs ≥ threshold, grouped |
|
| per-marker MAF, missingness, would-remove flags |
|
| per-marker MAF, He, Ho, PIC |
|
| per-sample PC coords (+ optional |
|
| samples × samples GRM |
|
| Fst for every group pair |
|
| per-group He/Ho/Fis/MAF/%poly/allelic richness |
|
| rank, accession, cumulative allele coverage |
|
| per-sample cluster + PC coords |
|
| UPGMA tree (Newick) |
|
| one row per run: status + diagnostics + reasons |
|
| matching variants (id, chrom, pos, ref, alt) |
|
| server-stored per-individual attributes; join on |
|
| per-sample (callset) attributes |
|
| per-marker chrom/pos/strand/mapq/status |
Visualizing results
The tools output tables, not images, which keeps them composable. The figures below were
produced from a synthetic dataset by docs/make_example_figures.py (run
pip install -e ".[viz]" && python docs/make_example_figures.py to regenerate). The same
recipes work on the real CSVs the tools write.
PCA: pca_coords.csv

import pandas as pd, matplotlib.pyplot as plt
df = pd.read_csv("gigwa_results/MYDB/pca_coords.csv")
groups = df["group"] if "group" in df else pd.Series("all", index=df.index)
for g, sub in df.groupby(groups):
plt.scatter(sub.PC1, sub.PC2, s=20, label=g)
plt.xlabel("PC1"); plt.ylabel("PC2"); plt.legend(); plt.savefig("pca.png")Population structure: structure_clusters.csv

df = pd.read_csv("gigwa_results/MYDB/structure_clusters.csv")
plt.scatter(df.PC1, df.PC2, c=df.cluster, cmap="tab10", s=20)
plt.xlabel("PC1"); plt.ylabel("PC2"); plt.title("K-means clusters"); plt.savefig("structure.png")Kinship: kinship_matrix.csv

g = pd.read_csv("gigwa_results/MYDB/kinship_matrix.csv", index_col=0)
plt.imshow(g.values, cmap="viridis"); plt.colorbar(label="relatedness"); plt.savefig("kinship.png")Per-group diversity: diversity_by_group.csv

d = pd.read_csv("gigwa_results/MYDB/diversity_by_group.csv").set_index("group")
d[["he", "ho", "allelic_richness"]].plot.bar(); plt.tight_layout(); plt.savefig("by_group.png")Core-collection coverage: core_collection.csv

c = pd.read_csv("gigwa_results/MYDB/core_collection.csv")
plt.plot(c["rank"], c["coverage_fraction"] * 100)
plt.xlabel("core size"); plt.ylabel("% alleles captured"); plt.savefig("core.png")UPGMA tree: tree.nwk

tree.nwk is standard Newick; open it directly in FigTree
or iTOL, or render in Python:
from Bio import Phylo # pip install biopython
Phylo.draw(Phylo.read("gigwa_results/MYDB/tree.nwk", "newick"))Performance & scaling
Small/medium runs: the default
method="vcf"exports once and caches; running several tools on the same run reuses the cached genotypes.Large runs (hundreds of thousands of markers): pass
method="allelematrix"with amax_markerscap (e.g. 2000-20000) so genotypes are sampled server-side instead of exporting a multi-GB VCF. Statistics are estimated from the sample.Many samples (thousands): the server caps each
allelematrixresponse at ~10,000 cells, so at N samples a response holds ~10000/Nmarkers, i.e. requests scale withmax_markers. Keepmax_markersmodest on high-sample-count sets.O(samples²) tools:
diversity_kinship,qc_duplicate_accessions, anddiversity_treebuild a samples × samples matrix (and the kinship CSV is written in full). Subsample markers and expect large output / slower runs beyond a few thousand accessions.The
audit_import_qualitytool is bounded bymax_markers×max_samplesper run, so it is cheap and roughly constant-cost even across a whole production instance.
Limitations & disadvantages
Read-only analysis. QC/diversity/audit never write results back to Gigwa; you get CSVs locally. (Import tools do write to Gigwa.)
No built-in plotting. Tools emit CSV/Newick; use the recipes above (matplotlib/Bio.Phylo) to make figures.
diversity_structureis a lightweight heuristic. It is PCA + K-means with a pseudo-F (Calinski-Harabasz) K suggestion; there is no true admixture model. On weakly or continuously structured data pseudo-F tends towardk_max; the per-K table is the real output and the tool warns when clustering is degenerate. For formal ancestry use a dedicated tool (ADMIXTURE / sNMF) on an exported VCF.Diploid-biallelic assumptions in places (IBS dosage 0/1/2, collapsed-token decode).
Grouping uses a metadata TSV, not server attributes. Some Gigwa builds do not expose BrAPI germplasm/sample/attribute endpoints, so
diversity_fst/diversity_by_grouptake groups fromgroups_jsonor a metadata TSV rather than querying Gigwa.VCF export downloads the whole variant set regardless of
max_markers; usemethod="allelematrix"to subsample large sets.Genome anchoring needs minimap2 + a reference, and streaming very large indexes is I/O-bound.
Single interactive session — one operation at a time. This is a per-user stdio server, not a concurrent/multi-user service. It drives Gigwa through one shared HTTP client, auth token and in-process genotype cache, which are not designed for parallel tool calls; long tools do run in a worker thread (so the connection stays responsive and streams progress), but heavy compute is still GIL-bound and effectively serialized — runs are meant to happen sequentially, and large matrices are held in RAM.
Troubleshooting
Auth / "Missing required environment variable(s)". Ensure
GIGWA_URL,GIGWA_USER,GIGWA_PASSare set (env or.env).GIGWA_URLmust omit the/restsuffix.VCF import rejected / "not bgzipped". Gigwa needs BGZF, not plain gzip. Recompress:
gunzip -c f.vcf.gz | bgzip > f.bgz.vcf.gz(htslibbgzip).Implausible ~95% heterozygosity after a DArT import. That is Gigwa's built-in DArT parser mis-calling the 2-row format. Use
import_dartseq(it calls genotypes in Python and imports a standard VCF) instead of importing the raw DArT report (see below).diversity_fst/diversity_by_groupreport "no groups matched". Check thatid_columnvalues in your TSV match the accession names (or callset ids) in the run.Large set feels slow. Use
method="allelematrix"+ a smallermax_markers, and avoid the O(samples²) tools on many thousands of accessions.
DArTseq notes
DArTseq SNP reports use the classic 2-rows-per-marker layout (a reference-allele row and a
SNP-allele row, each cell 1/0/-); Silico-DArT reports are 1 row per clone (dominant
presence/absence). import_dartseq does the genotype calling in Python and emits a
standard VCF, imported through Gigwa's verified VCF path:
(ref=1, alt=0) -> 0/0 (ref=0, alt=1) -> 1/1
(ref=1, alt=1) -> 0/1 otherwise -> ./. (missing / no allele detected)This deliberately bypasses Gigwa's built-in DArT parser, which might mis-call the 2-row format (there are cases that it imports reference homozygotes as heterozygous, producing implausible ~95% heterozygosity). SNP and Silico use different allele models; import them as separate runs unless you specifically intend to combine them.
Genomic positions (optional)
DArTseq markers have no genomic coordinates, so by default they are placed on a single
Unmapped contig at sequential positions. If you have a reference genome FASTA, the marker
tag sequences (AlleleSequence, ~69 bp) can be aligned to it with minimap2 to infer real
chromosome/position/strand:
map_dartseq_to_reference(snp_xlsx, reference_fasta)→ adartseq_positions.csvreport (uniquely mapped / multi / unmapped), for inspection.import_dartseq(..., reference_fasta=...)→ imports uniquely-mapped markers genome-anchored (minus-strand alleles complemented, output coordinate-sorted, one marker per genomic site); unmapped markers stay onUnmapped.import_dartseq(..., positions_csv=...)→ reuse adartseq_positions.csvfrom a previous run instead of re-aligning. Recommended for large genomes: align once, inspect, then import without paying the alignment cost again.
reference_fasta may be a FASTA (.fa/.fa.gz) or a prebuilt minimap2 .mmi index. By
default the minimap2 CLI backend is used when available: it streams over multi-part
indexes with bounded RAM, so very large (multi-gigabase) genomes work on modest machines.
The in-process mappy backend (backend="mappy") loads the whole index into RAM instead.
Prebuild an index once (tuned for the ~69 bp tags) and reuse it:
minimap2 -x sr -d reference.sr.mmi reference.fasta # build once
# then pass reference.sr.mmi as reference_fastaProject layout
gigwa_mcp/
__main__.py # python -m gigwa_mcp → stdio server
config.py # .env / env loading (GIGWA_URL/USER/PASS/TIMEOUT)
client.py # GigwaClient: auth, multipart upload, progress, BrAPI calls
exports.py # selection export options, response handling, safe downloads
identifiers.py # individual/sample/callset identifier resolution
server.py # MCPServer instance + get_client()
importers/
dartseq.py # DArTseq xlsx → standard VCF (2-row genotype calling)
refmap.py # minimap2 tag → reference mapping
analysis/
genotypes.py # load_genotypes (VCF / allelematrix backends), GenotypeMatrix
stats.py # pure pop-gen stats (MAF, He, PIC, IBS, GRM, allelic richness …)
genebank.py # core-collection + UPGMA helpers
results.py # output-dir resolution + CSV writing
tools/ # @mcp.tool() wrappers: connection, genotype, metadata, qc,
# diversity, audit
scripts/ # run_import_audit.py, run_qc_diversity_validation.py (generic)
docs/ # make_example_figures.py + img/ (README figures)
skills/ # Agent Skills (SKILL.md) mirroring the 5 prompts (for LobeHub etc.)
tests/ # pytest suite (mocked client + synthetic fixtures)Testing
pip install -e ".[dev]"
pytesttest_client.py covers auth/token-refresh, multipart assembly and progress polling with a
mocked transport; test_dartseq_convert.py checks the conversion against synthetic
SNP/Silico fixtures; test_stats.py / test_genebank.py verify the pop-gen and genebank
statistics against hand-computed values; test_genotypes.py exercises VCF parsing +
callset-name mapping with a mock client. The suite needs no live Gigwa server.
Changelog
The three most recent releases in detail; older ones in brief. See the
releases page or git log for
commit-level history.
v1.9.2 — Windows dependency compatibility
mappyis no longer installed automatically on Windows, where it has no wheels and used to makepip install gigwa-mcpfail outright. Linux and macOS are unchanged.Reference mapping reports an actionable error when
mappyis absent; the minimap2 CLI remains available as a backend, and no other tool needs it.
v1.9.1 — export and container reliability
Selection exports accept both Gigwa response styles — a queued download URL, or the file returned immediately. Immediate files are written atomically and skip progress polling.
Docker defaults to clean stdio again; HTTP requires an explicit
GIGWA_MCP_PORT, and entrypoint diagnostics go to stderr.Capped VCF and allele-matrix analyses sample the same first N markers in canonical Gigwa search order, so results from the two backends are directly comparable.
Individual/sample resolution preserves hyphenated accession names, and grouping reports identifiers it could not match instead of dropping them silently.
v1.9.0 — MCP SDK v2, selection-aware export & metadata endpoints
Migrated to the MCP Python SDK v2 (
mcp>=2.1,<3); the 1.x line is upstream maintenance mode. Tools, prompts and resources are unchanged.Selection-aware export (@GuilhemSempere, PR #2):
export_genotypesgains region, variant-type, MAF and missing-data filters plusindividuals/metadata_fieldsselection.wait=Falsereturns a download URL forget_export_progressandfetch_export_file, andlist_export_formatsreports what the instance actually offers.Native metadata endpoints (same PR):
list_metadata_valuesandfilter_individuals_by_metadatause the endpoints behind Gigwa's own attribute filters, so per-individual attributes are found on builds where BrAPI returns none.germplasm_metadata.csvgained asample_namecolumn — join on that, notgermplasm_name. Gigwa's individual id is not the name the analysis tools give a sample, so the old join could silently mis-group samples.fetch_export_filerejects download URLs that do not match the configured Gigwa origin, so the session's bearer token cannot be sent elsewhere.
Earlier releases
v1.8.0 —
search_callsetswrites per-samplesample_metadata.csv;get_germplasm_metadatafalls back to the callset level;gigwa_server_inforeports account permissions; SDK pinned tomcp<2.v1.7.0 — Streamable HTTP transport (
--port) with DNS-rebinding and allowed-host protection; stdio stays the default. Contributed by @guignonv (PR #1).v1.6.0 —
gigwa_connectre-points the session at another Gigwa instance mid-conversation, verified before it takes effect. Credentials resolve from the environment, never from the chat.v1.5.0 — five Agent Skills in
skills/mirroring the workflow prompts.v1.4.16 — anonymous access when
GIGWA_USER/GIGWA_PASSare both omitted; fast-failGIGWA_CONNECT_TIMEOUT;serverInforeports the package version.v1.3.4 —
TOOL_CATALOGwith EDAM annotations and thecatalog://toolsresource;notifications/progressfrom long-running tools; five prompts and two resources.v1.2.0 — server-side
count_variants/search_variants, aregionfilter on every analysis tool,list_variant_sets/list_sequences/export_genotypes, andabort_import(21 → 28 tools).v1.1.0 — Docker support: a multi-stage
Dockerfilefordocker run -i.v1.0.0 — initial release: 21 tools covering import, QC, diversity and the import-quality audit.
License & contributing
Released under the Apache License 2.0 © 2026 Anestis Gkanogiannis anestis@gkanogiannis.com (see also NOTICE).
Issues and pull requests are welcome. Please run pytest before submitting, keep new
analysis logic in pure, unit-tested helpers under gigwa_mcp/analysis/, and avoid
committing data, credentials, or result files (these are gitignored).
Available Tools
35 toolsabort_importA
Abort a running import (or other long process), given its progress token.
Asks Gigwa to cancel the process identified by progress_token (the token returned
by import_dartseq / import_vcf when run with wait=False). Returns whether
the abort request was accepted; poll get_import_progress afterwards to confirm it
stopped.
Inputs: progress_token (required). Returns: result
audit_import_qualityA
Scan a Gigwa instance for databases imported with genotype-encoding artifacts.
With no variant_set_db_id this audits every run on the instance; pass one to
audit a single variant set. For each run it pulls a bounded genotype sample (up to
max_markers markers × max_samples callsets) via paged BrAPI
search/allelematrix — cheap and constant-cost regardless of how large the variant
set is, so it is safe to run across a whole production instance without exporting
multi-GB VCFs. The aggregate genotype-class fractions it needs are estimated tightly
from the sample (a true zero hom-alt class stays zero; a rare-but-real one shows up).
It flags two import failure modes plus two weaker signals:
BROKEN — cohort mean Ho above
het_threshold(DArT 2-row mis-call), or homozygous-alt genotypes far below their HWE expectation given the alt-allele frequency (lost hom-alt class; the HWE test avoids false positives on low-MAF / mostly-monomorphic panels where near-zero hom-alt is genuine).SUSPECT — call rate above
complete_call_rate(no missing data, often missing forced to 0/0), monomorphic fraction abovemonomorphic_threshold, or AD/DP depth fields present but uniformly zero (a VCF synthesised from genotype calls with fabricated depth/likelihoods — the same converter often miscalls GT too).
Writes import_quality_scan.csv (one row per run) under output_dir (default
./gigwa_results/) and returns a summary ranked worst-first. Read-only — it never
modifies Gigwa.
Inputs: output_dir, max_markers, max_samples, het_threshold, +3 more. Returns: result
count_variantsA
Count variants matching filters, computed server-side (nothing is downloaded).
Fast way to size a query before pulling data. Filter by genomic region
(reference_name + optional start/end, from list_sequences), minor-
allele frequency (min_maf/max_maf) and/or max_missing_data (0–1 fraction).
With no filters this returns the total variant count of the set. variant_set_db_id
is a BrAPI variantSetDbId (from list_variant_sets / list_content).
Inputs: variant_set_db_id (required), end, start, max_maf, +3 more. Returns: result
diversity_by_groupA
Per-population diversity: He, Ho, Fis, MAF, % polymorphic, allelic richness.
Define groups the same way as diversity_fst — either groups_json
{group: [names]} or metadata_tsv + group_column. For each group computes
n, % polymorphic markers, mean MAF, Nei's He, observed Ho, Fis (1−Ho/He), mean
observed allelic richness, and rarefied allelic richness (rarefied to the
smallest group's gene-copy count so unequal group sizes are comparable). Writes
diversity_by_group.csv.
Inputs: variant_set_db_id (required), method, region, id_column, +5 more. Returns: result
diversity_core_collectionA
Select a core collection that maximises captured allelic diversity.
Greedy allele-coverage selection (Core-Hunter style): repeatedly add the accession
that contributes the most not-yet-captured marker-alleles. Pick the core size
directly, or as fraction of all accessions (default 10%). Writes
core_collection.csv (rank, accession, cumulative allele coverage) and reports the
fraction of total allelic diversity the core captures.
Inputs: variant_set_db_id (required), size, method, region, +3 more. Returns: result
diversity_fstA
Pairwise Weir & Cockerham Fst between groups of samples.
Define the groups one of two ways:
groups_json— a JSON object mapping each group name to a list of accession names (or callset ids), e.g.{"north": ["112","156"], "south": ["11","42"]}.metadata_tsv+group_column— read groups from a metadata TSV (the same file format used byimport_metadata), keyed onid_column(defaultindividual) and grouped bygroup_column.
Writes fst_pairwise.csv with the Fst for every group pair. (Server-side BrAPI
attributes are not used for grouping — that endpoint is unavailable on the target
Gigwa 2.12 build.)
Inputs: variant_set_db_id (required), method, region, id_column, +5 more. Returns: result
diversity_kinshipA
VanRaden genomic relationship (kinship) matrix.
Computes G = ZZ'/(2 Σp(1-p)) from alt dosage. Writes the full matrix as
kinship_matrix.csv (samples × samples) and reports the most-related pairs
and the diagonal (self-relationship / inbreeding) range. For large sets pass
method="allelematrix" + max_markers to avoid a full VCF export.
Inputs: variant_set_db_id (required), method, region, top_pairs, +2 more. Returns: result
diversity_pcaA
Principal component analysis of population structure.
Runs PCA on the alt-allele dosage matrix (monomorphic markers dropped, missing
mean-imputed, Patterson scaling). Writes pca_coords.csv (per-sample PC
coordinates) and reports variance explained plus any PC1/PC2 outlier samples
(beyond outlier_sd SD). Pass metadata_tsv + group_column to add a
group column (population label per sample) for colouring the PC plot. For large
sets pass method="allelematrix" + max_markers to avoid a full VCF export.
Inputs: variant_set_db_id (required), method, region, id_column, +6 more. Returns: result
diversity_structureA
Lightweight population-structure clustering (PCA + K-means, in-Python).
Reduces the alt-dosage matrix with PCA (Patterson scaling), then runs K-means for
K in k_min..k_max and picks the K with the highest pseudo-F (Calinski-Harabasz)
between/within variance ratio — a clear maximum when groups are well separated.
Writes structure_clusters.csv (sample, assigned cluster at the best K, PC coords)
and reports the chosen K with cluster sizes. (No external ADMIXTURE binary — computed
entirely in Python, consistent with the rest of the analysis layer.)
Inputs: variant_set_db_id (required), k_max, k_min, method, +3 more. Returns: result
diversity_summaryA
Per-marker diversity statistics (MAF, He, Ho, PIC) and dataset means.
He is Nei's gene diversity (1 - Σpᵢ²), Ho is observed heterozygosity, PIC is
polymorphism information content. Writes diversity_markers.csv. For large sets
pass method="allelematrix" + max_markers to sample server-side.
Inputs: variant_set_db_id (required), method, region, output_dir, +1 more. Returns: result
diversity_treeA
UPGMA dendrogram of accessions from IBS allele-sharing distance (Newick).
Builds a pairwise IBS similarity matrix, converts to distance (1 − IBS), and writes a
UPGMA tree as tree.nwk (standard Newick, loadable in FigTree / iTOL / ape). Marker
subsampling (max_markers) keeps it tractable on large sets.
Inputs: variant_set_db_id (required), method, region, output_dir, +1 more. Returns: result
export_genotypesA
Export a variant set — or a filtered/selected subset of it — to a file.
With none of the filter/selection parameters set, exports the whole set via Gigwa's
plain per-format export (format one of VCF (default), PLINK or
FLAPJACK; availability varies by build — check list_export_formats for what
this instance actually offers, and each format's variant-type/ploidy restrictions).
Passing any of region, selected_variant_types, min_maf/max_maf,
max_missing_data, individuals or metadata_fields instead drives Gigwa's
selection-aware export — the same endpoint the Gigwa web UI uses for a filtered
download — which additionally accepts any format the server advertises, including the
bgzipped "VCF.gz". keep_on_server leaves a copy in the user's Gigwa temp-output
area after this downloads it (default False).
For large sets this can take a while; raise timeout (seconds), or set
wait=False to return immediately once the export is kicked off instead of blocking
for the whole thing. A server that queues the work returns a download URL; check progress
with get_export_progress and, once it reports complete, retrieve the file with
fetch_export_file (that URL, plus output_path). wait=False always goes
through the selection-aware endpoint, even with no filters set. Some Gigwa builds
return the completed bytes immediately; in that case they are written to
output_path and no progress/fetch step is needed.
Inputs: output_path (required), variant_set_db_id (required), wait, format, +9 more. Returns: result
fetch_export_fileA
Download a completed export — the URL export_genotypes(..., wait=False) returned
— once get_export_progress reports it complete.
Inputs: output_path (required), download_url (required). Returns: result
filter_individuals_by_metadataA
Select individuals whose stored metadata matches the given field/value filters.
filters_json is a JSON object mapping each metadata field name (see
list_metadata_values) to a list of acceptable values, e.g. {"GroupK4": ["cA"]}.
Multiple fields combine with AND; multiple values for one field combine with OR.
Returns the matching individual-level identifiers, ready to pass directly to
export_genotypes's individuals parameter. Diversity groups_json instead
matches analysis sample names; obtain those from get_germplasm_metadata's
sample_name column. Gigwa's export resolves each individual to all of its samples
across runs server-side (verified against the Gigwa server source), including when an
individual has more than one sample.
Inputs: filters_json (required), variant_set_db_id (required). Returns: result
get_export_progressA
Report the status of the current session's most recent export (started with
export_genotypes(..., wait=False)).
Unlike imports, an export isn't tracked by a token you pass around — Gigwa ties it to the session's own auth token, so there is exactly one "current export" per connection and this takes no arguments.
Inputs: no named parameters. Returns: result
get_germplasm_metadataA
Fetch server-stored per-individual metadata (germplasm attributes) for a database.
Reads the attributes already stored in Gigwa (imported earlier via import_metadata
or a BrAPI source) for the module of variant_set_db_id and writes
germplasm_metadata.csv — one row per accession, with attribute columns.
Which column to join on. germplasm_name is Gigwa's individual id, which on
real data does not match the sample names the analysis tools use. Join on the
sample_name column instead: it is the name diversity_fst /
diversity_by_group match against (via metadata_tsv, which expects tab-
separated input — convert the CSV first). Where one individual carries several samples
the column holds them ;-joined and needs splitting first. It is blank when the
callsets could not be read.
For the sample/callset level itself — raw callSetName, sampleDbId and per-sample
additionalInfo — use search_callsets instead.
Inputs: variant_set_db_id (required), output_dir. Returns: result
get_import_progressA
Report the current status of a running import, given its progress token.
Inputs: progress_token (required). Returns: result
gigwa_connectA
Switch the active Gigwa server at runtime — no restart needed.
Re-points every subsequent tool (and the gigwa:// resources) at url for the rest of the session. Credentials are never passed through the chat: they are resolved from the environment — a named profile reads GIGWA_USER_/GIGWA_PASS_; anonymous=True sends none. With neither, the default GIGWA_USER/GIGWA_PASS are used only when reconnecting to the configured GIGWA_URL — switching to any other server without a profile connects anonymously, so your home credentials are never transmitted to a different host unasked. The new connection is verified with a live round-trip before this returns; on failure the previous connection is restored.
Inputs: url (required), profile, anonymous. Returns: result
gigwa_server_infoA
Check connectivity to the configured Gigwa server.
Generates an auth token with the configured credentials and reports the server URL and (best-effort) version. Use this first to confirm the connection works before importing data.
Inputs: no named parameters. Returns: result
import_dartseqA
Import DArTseq data from xlsx report(s) into Gigwa.
Converts the DArTseq SNP and/or Silico-DArT xlsx report(s) to a standard VCF —
doing the 2-row genotype calling in Python (so reference homozygotes are not
mis-imported as heterozygous, as Gigwa's built-in DArT parser does) — and
uploads it to create/append a database (module), project and run.
Provide at least one of snp_xlsx / silico_xlsx (absolute paths). SNP
and Silico use different allele models; importing both into the same run is
unusual — prefer separate runs unless you specifically intend to combine them.
If reference_fasta is given (a reference genome FASTA or a prebuilt
minimap2 .mmi index — an .mmi is loaded directly with no re-indexing,
preferred for large genomes), the SNP markers' tag sequences are aligned to it
and uniquely-mapped markers (mapq ≥ min_mapq) are imported genome-anchored
(real chromosome/position); the rest stay on an Unmapped contig. Without it,
all markers go on Unmapped.
positions_csv reuses a mapping already produced by
map_dartseq_to_reference (its dartseq_positions.csv) instead of
re-aligning — much faster when you've already inspected the mapping. Provide
either reference_fasta or positions_csv, not both.
Set clear_project_data=True to replace any existing data in the project,
skip_monomorphic=True to drop non-variant markers, and wait=False to
return immediately with a progress token instead of blocking until done.
Inputs: run (required), module (required), project (required), wait, +9 more. Returns: result
import_metadataA
Import individual metadata (per-individual attributes) into an existing Gigwa database.
The file is a TSV whose first column header equals metadata_type
(individual for individual metadata) and whose values match the
individual/sample names already present in the database. Remaining columns
become searchable attributes. By default the file is validated first; set
validate_first=False to skip that check.
Inputs: module (required), tsv_path (required), metadata_type, validate_first. Returns: result
import_vcfA
Import a VCF file (.vcf or .vcf.gz) into Gigwa.
Uploads the VCF to create/append a database (module), project and
run. technology is optional free-text (e.g. 'WGS', 'GBS'). Use
clear_project_data=True to replace existing project data and wait=False
to return a progress token instead of blocking.
Inputs: run (required), module (required), project (required), vcf_path (required), +5 more. Returns: result
list_contentA
List the databases, projects and runs currently hosted on the Gigwa server.
Each run's exact variant_set_db_id is printed alongside it — use that string
verbatim in other tools, do not assemble one by hand. In particular, the middle
segment is a numeric project index (1, 2, ...), not the project's name (e.g.
project 'refNB' still has id segment '1') — using the name there is a common mistake
and fails every downstream call with an opaque HTTP 500 rather than a clear error.
list_variant_sets gives the same ids in a flatter list, if preferred.
Inputs: no named parameters. Returns: result
list_export_formatsA
List the export formats this Gigwa build supports, with per-format compatibility info.
Queried live from the server's export-handler registry rather than a hardcoded list, so
it reflects exactly what this build/instance offers. For each format shows the variant
types it accepts and the ploidy levels it supports — check this before picking a
format for export_genotypes: several formats (e.g. EIGENSTRAT, FASTA, NEXUS,
PHYLIP, PCA, ASD, JUKES-CANTOR) are SNP-only and/or diploid-only, silently dropping
INDEL/MIXED sites or rejecting other-ploidy runs rather than erroring.
Inputs: no named parameters. Returns: result
list_metadata_valuesA
List the individual-metadata fields available for a database and their distinct values.
Backed by the endpoint the Gigwa web UI itself uses to populate its metadata-based
selection filters, so it works even on builds where get_germplasm_metadata's BrAPI
fallback returns no attributes. Use this to discover field names/values before calling
filter_individuals_by_metadata.
Inputs: variant_set_db_id (required). Returns: result
list_sequencesA
List the reference sequences (chromosomes/contigs) available in a variant set.
Use this to discover valid reference_name values for the region filters on
count_variants / search_variants / the QC & diversity tools.
Inputs: variant_set_db_id (required). Returns: result
list_variant_setsA
List every variant set (run) with its exact BrAPI variantSetDbId.
The other tools take a variant_set_db_id; this returns those ids directly (plus
name and variant/callset counts when the server provides them), complementing the
human-readable database/project/run view from list_content.
Inputs: no named parameters. Returns: result
map_dartseq_to_referenceA
Guess genomic positions for DArTseq SNP markers by aligning their tag sequences.
Aligns each marker's ~69 bp AlleleSequence tag to reference_fasta (a
reference genome FASTA, or a prebuilt minimap2 .mmi index) and reports the
inferred chromosome, position and strand of each SNP. Writes
dartseq_positions.csv (allele_id, chrom, pos, strand, mapq, ref, alt, status).
The result can be passed to import_dartseq (reference_fasta=) to import
the data genome-anchored instead of on an Unmapped contig.
backend: "auto" uses the minimap2 CLI when available (streams over
multi-part indexes → bounded RAM, best for large multi-gigabase genomes),
falling back to the in-process mappy binding. Markers are classified
unique (mapq ≥ min_mapq), multi (ambiguous), or unmapped.
Inputs: snp_xlsx (required), reference_fasta (required), preset, backend, +2 more. Returns: result
qc_call_rateA
Per-sample and per-marker call rate (missingness) QC for a variant set.
Flags samples/markers below the given thresholds. Writes
call_rate_samples.csv and call_rate_markers.csv and returns a summary
with the overall call rate and the worst offenders. variant_set_db_id is a
BrAPI variantSetDbId (from list_content / BrAPI variantsets). For large
production sets pass method="allelematrix" with max_markers (e.g. 20000)
to estimate from a server-side marker subset instead of a full VCF export.
region ("chrom" or "chrom:start-end", 1-based; from list_sequences)
restricts the analysis to one genomic window — available on every QC/diversity tool.
Inputs: variant_set_db_id (required), method, region, output_dir, +3 more. Returns: result
qc_duplicate_accessionsA
Detect duplicate / clonal accessions via pairwise identity-by-state (IBS).
Computes IBS allele-sharing similarity between every pair of samples and groups
pairs at or above similarity_threshold into duplicate sets — the core
genebank "cleaning" check for mislabelled duplicates and clones. By default
subsamples to the first max_markers in canonical Gigwa search order for speed (set to 0/None to
use all). Writes duplicate_pairs.csv and duplicate_groups.csv. For large
sets pass method="allelematrix" to fetch the marker subset without a full export.
Inputs: variant_set_db_id (required), method, region, output_dir, +2 more. Returns: result
qc_heterozygosityA
Per-sample observed heterozygosity QC, flagging outliers.
High Ho relative to the cohort suggests contamination or off-types; very low
Ho suggests selfed/inbred or duplicated material. Flags samples more than
outlier_sd standard deviations from the mean. Writes
heterozygosity_samples.csv. For large sets pass method="allelematrix" +
max_markers to avoid a full VCF export.
Inputs: variant_set_db_id (required), method, region, outlier_sd, +2 more. Returns: result
qc_maf_filterA
Report markers that would be filtered by MAF / missingness (no changes applied).
Computes per-marker minor-allele frequency and missing rate, and counts how many
markers are monomorphic, below maf_threshold, or above max_missing missing.
Writes marker_filter_stats.csv. This is a report only — it does not modify Gigwa.
For large sets pass method="allelematrix" + max_markers to sample server-side.
Inputs: variant_set_db_id (required), method, region, output_dir, +3 more. Returns: result
search_callsetsA
Dump per-sample (callset) metadata for a run: names + additionalInfo attributes.
Retrieves the run's callsets via BrAPI search/callsets and writes
sample_metadata.csv (one row per sample) with sample_name, callSetName,
sampleDbId, callSetDbId and every attribute present in the callsets'
additionalInfo (e.g. ICARDA_IG, SeedID, Country, Latitude, Longitude, SiteCode,
PopulationType).
sample_name is the same name the analysis tools use for the sample, so the file
joins to their outputs; callSetName keeps the server's raw label, which on some
builds is the more human-readable of the two.
This is the sample/callset-level counterpart to get_germplasm_metadata: use it
when the germplasm (accession) level exposes no attributes but the samples do.
Inputs: variant_set_db_id (required), output_dir. Returns: result
search_variantsA
Search variants matching filters server-side and write the matching list to CSV.
Same filters as count_variants (region / MAF / missing-data). Returns variant
metadata only (id, chrom, pos, ref, alt) — no genotypes are fetched — and writes
variant_search.csv. Use count_variants first to size the result; max_variants
caps how many are retrieved. For downstream genotype analysis on a filtered subset, use
the region/min_maf options on the QC/diversity tools instead.
Inputs: variant_set_db_id (required), end, start, max_maf, +5 more. Returns: result
validate_metadataA
Validate an individual-metadata file against a Gigwa database without importing.
metadata_type is the name of the ID column in the file that links rows to
genotype entities — for individual metadata this is the individual column
(the header must match exactly, case-sensitive). tsv_path is a TSV whose
first column header equals metadata_type.
Inputs: module (required), tsv_path (required), metadata_type. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 35 tools
Most tools are clearly separated by resource and action—import, export, QC, diversity, metadata, and server administration are distinct clusters. A few pairs (list_content vs list_variant_sets, diversity_pca vs diversity_structure) could be confused, but the descriptions provide enough context to disambiguate them.
Names are uniformly lower_snake_case and follow a predictable prefix convention: verb_resource for operations (list_*, import_*, export_*, get_*, search_*, count_*) and domain-prefixed nouns for analyses (qc_*, diversity_*). No camelCase or arbitrary synonyms appear, so the pattern is highly consistent.
With 35 tools this is a very large MCP surface, clearly above the 25+ threshold for 'too many'. Each tool is individually purposeful, but the sheer number makes selection harder and suggests the server would benefit from consolidation or splitting into focused sub-servers.
The server covers the core analytical lifecycle well: import, validate, list, filter, QC, diversity analysis, and export all have dedicated tools with progress and abort handling. Gaps are mostly administrative—no deletion/removal of databases/projects/runs and no metadata update/delete—but these are minor for the primary analysis use case.
Maintenance
Related MCP Connectors
MCP gateway federating 30 biomedical MCP servers behind one endpoint: gnomAD, ClinVar, HPO, VEP.
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
Related MCP Servers
- AlicenseCqualityDmaintenanceAn MCP server that enables single-cell RNA sequencing analysis through natural language, supporting data processing, visualization, and analysis tasks without requiring coding knowledge.5212BSD 3-Clause
- FlicenseNot gradedqualityDmaintenanceAn MCP Server that provides access to Google Cloud Life Sciences API, enabling users to run biomedical workloads in the cloud through natural language interactions.-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables scRNA-Seq analysis through natural language, providing tools for data preprocessing, clustering, and biological visualization. It supports both predefined function execution and a flexible code mode powered by a Jupyter backend for automated single-cell transcriptomics workflows.16BSD 3-Clause
- AlicenseNot gradedqualityDmaintenanceAn MCP server for the gget bioinformatics library that enables AI assistants to perform complex genomics queries, including gene sequence retrieval, BLAST alignments, and protein structure predictions.33MIT