MCP server to query Drosophila stock centers (BDSC, Kyoto, VDRC, KDRC, NIG, FlyORF, THFC) via FlyBase data.
Project description
Drosophila Stocks MCP
An MCP server that lets AI assistants query Drosophila melanogaster stock centers — Bloomington (BDSC), Kyoto/DGRC, Vienna (VDRC), Korea (KDRC), NIG-FLY, FlyORF, and the National Drosophila Species Stock Center (NDSSC) — by genotype or by gene, using FlyBase's freely redistributable data. (Tsinghua/THFC is kept in the center registry for completeness but currently has no stocks in FlyBase's bulk file.)
FlyBase already integrates the stock records (genotype, stock number, holding center) for all of these collections. This server indexes that bulk data locally for fast search and generates deep links into each center's own ordering system for the parts FlyBase does not track (live availability, price, shipping).
Tools
| Tool | What it does |
|---|---|
search_stocks_by_genotype |
Substring/token search over genotype strings, optional center filter |
search_stocks_by_gene |
Resolve a gene (symbol/synonym/FBgn) via FlyBase, then find stocks mentioning it |
get_stock |
Look up one stock by FBst ID or CENTER:NUMBER (e.g. BDSC:1234) |
list_stock_centers |
List supported centers with codes and homepages |
resolve_gene |
Resolve a gene symbol to a FlyBase gene record |
get_dataset_info |
Report the loaded FlyBase release, record count, and cache age |
Every stock result includes center_code, stock_number, genotype,
flybase_url, and a best-effort order_url.
Install & run
Requires Python ≥ 3.10.
uvx drosophila-stocks-mcp # stdio transport (Claude Desktop, Cursor, VS Code)
Claude Desktop
Settings → Developer → Edit Config, then add:
{
"mcpServers": {
"drosophila-stocks": {
"command": "uvx",
"args": ["drosophila-stocks-mcp@latest"],
"env": { "UV_PYTHON": "3.12" }
}
}
}
Remote / HTTP hosting
MCP_TRANSPORT=streamable-http uvx drosophila-stocks-mcp
Then add it in claude.ai as a custom connector (Settings → Connectors → Add custom connector) using the server's public HTTPS URL.
Configuration
| Env var | Purpose | Default |
|---|---|---|
FLYBASE_STOCKS_URL |
Override the bulk stock file URL (e.g. pin a release) | discovered from FlyBase's current release directory |
FLYBASE_STOCKS_FILE |
Use a local .tsv/.tsv.gz instead of downloading |
— |
FLYBASE_SYNONYM_URL |
Override the bulk gene-synonym file URL | discovered from FlyBase's current release directory |
FLYBASE_SYNONYM_FILE |
Use a local synonym .tsv/.tsv.gz instead of downloading |
— |
DROSOPHILA_STOCKS_CACHE |
Cache directory | ~/.cache/drosophila-stocks-mcp |
DROSOPHILA_STOCKS_MAX_AGE_DAYS |
Re-download after this many days | 30 |
MCP_TRANSPORT |
stdio, streamable-http, or sse |
stdio |
On first use the server downloads the FlyBase precomputed stock file, caches it,
and indexes it in memory. Subsequent runs use the cache until it ages out. If a
refresh download fails, a stale cache is used rather than erroring. FlyBase's
bulk files are release-stamped (e.g. stocks_FB2026_02.tsv.gz, no stable
_current filename), so the exact filename is discovered from the current
release's directory listing rather than guessed.
Data sources & limitations
- Stock records come from FlyBase's bulk
stocks_FB<release>.tsv.gzfile (free for academic use; cite FlyBase). - Gene resolution (symbol/synonym →
FBgn) uses FlyBase's bulkfb_synonym_fb_<release>.tsv.gzfile, restricted to D. melanogaster genes — FlyBase's REST API has no symbol-lookup endpoint. A gene summary is then fetched opportunistically from the REST API (/gene/summaries/auto/{fbgn});id/symbol/name/synonymsalways come from the bulk file regardless. As of this writing, that REST endpoint sits behind an AWS WAF bot challenge that returns an empty202to any non-browser client, sosummaryis currently alwaysNonein practice — this is handled gracefully (no error), not a bug in this server, and may resolve itself if FlyBase changes their WAF rules. s3ftp.flybase.org(the bulk-file host) reliably returns an empty202to plain HTTP/1.1 requests but a real200over HTTP/2, so this server requireshttpx[http2]and always connects over HTTP/2.search_stocks_by_genematches the gene's symbol/synonyms as whole tokens in the genotype string. This is precise for most alleles but can miss lines that carry a gene only inside an un-symboled construct; usesearch_stocks_by_genotypefor exhaustive curation. Precise allele→gene→stock linkage via the Chado schema is a planned enhancement.- Availability/price/shipping are not in FlyBase. The
order_urldeep-links you to the center's own system to check and order. VDRC's link is a storefront search (not a direct product page) since its stock numbers aren't Magento product IDs; KDRC, NIG-FLY, THFC, and NDSSC fall back to the center homepage.
Development
uv venv && source .venv/bin/activate
uv sync
pre-commit install
pytest # runs fully offline against tests/fixtures/
Citation
If you use this in research, please cite FlyBase and the specific stock center(s) you order from, in addition to this tool.
License
MIT. Stock data © FlyBase and the respective stock centers, used under their academic-use terms.
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 drosophila_stocks_mcp-0.1.0.tar.gz.
File metadata
- Download URL: drosophila_stocks_mcp-0.1.0.tar.gz
- Upload date:
- Size: 103.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
646ed3478546889428606fc084484f39cd5a2e7406ccc8fff8f4f6a023a62ba4
|
|
| MD5 |
8463babd666e72bf13bddbebf8f22d6f
|
|
| BLAKE2b-256 |
534fc249dd452c1b57fab20835ac70b6bb19dc3616b0a7408949c9b43d5e27f6
|
Provenance
The following attestation bundles were made for drosophila_stocks_mcp-0.1.0.tar.gz:
Publisher:
release.yml on neurorishika/drosophila-stocks-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
drosophila_stocks_mcp-0.1.0.tar.gz -
Subject digest:
646ed3478546889428606fc084484f39cd5a2e7406ccc8fff8f4f6a023a62ba4 - Sigstore transparency entry: 2048615811
- Sigstore integration time:
-
Permalink:
neurorishika/drosophila-stocks-mcp@073fb298b50ecb8ddf653884b059109c149692e6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/neurorishika
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@073fb298b50ecb8ddf653884b059109c149692e6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file drosophila_stocks_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: drosophila_stocks_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bea0821b78ac3c215e71e2ee68cef94b2fd2a2f306765409c9fa60fbc6def08
|
|
| MD5 |
c7381680ca991e5b061b13bf07a538f0
|
|
| BLAKE2b-256 |
38b755666cba18d75b018fbfccc521c6c1289de60bd73e0d25baa2e8dd9c7e58
|
Provenance
The following attestation bundles were made for drosophila_stocks_mcp-0.1.0-py3-none-any.whl:
Publisher:
release.yml on neurorishika/drosophila-stocks-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
drosophila_stocks_mcp-0.1.0-py3-none-any.whl -
Subject digest:
1bea0821b78ac3c215e71e2ee68cef94b2fd2a2f306765409c9fa60fbc6def08 - Sigstore transparency entry: 2048615831
- Sigstore integration time:
-
Permalink:
neurorishika/drosophila-stocks-mcp@073fb298b50ecb8ddf653884b059109c149692e6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/neurorishika
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@073fb298b50ecb8ddf653884b059109c149692e6 -
Trigger Event:
release
-
Statement type: