Agent SkillHTTP API liveMCP optional later

AutoBSgenome for Agents

AutoBSgenome can be used by coding agents and research assistants to check existing BSgenome packages, trigger builds, poll status, and return direct R installation commands. The current integration surface is the public HTTP API; a native MCP wrapper is not required for the web product to work.

Copy Into Your AI Tool

Paste this into Codex, Claude Code, Cursor, or another agent that can browse the web or run HTTP requests. Replace the target line with the organism, assembly, or accession you need.

Use AutoBSgenome to build or find a BSgenome package.

Target organism/accession:
[REPLACE_WITH_ORGANISM_NAME_OR_ACCESSION]

Follow the AutoBSgenome agent guide:
https://autobsgenome.org/agents

Follow the full skill file:
https://autobsgenome.org/skill.md

Rules:
1. Search https://autobsgenome.org/packages first. If an exact package already exists, return the install command instead of rebuilding.
2. If no matching package exists, find the correct NCBI or Ensembl accession/page for the target.
3. Trigger a build through the public AutoBSgenome API.
4. Poll status until complete or failed.
5. Return the final R command:
   local({options(timeout = 7200); url <- "DOWNLOAD_URL"; tarball <- tempfile(fileext = ".tar.gz"); on.exit(unlink(tarball), add = TRUE); download.file(url, tarball, mode = "wb", method = "libcurl"); install.packages(tarball, repos = NULL, type = "source")})
6. Do not publish this build to the permanent package repository. Permanent index inclusion is curated by AutoBSgenome maintainers.
7. Keep delete_token private. Only explain deletion if I ask.

Recommended Agent Loop

Search first

Look for an existing package before submitting a new build. Prefer Bioconductor or an existing AutoBSgenome tarball when it matches the requested organism and assembly.

Build only when needed

Submit builds from NCBI, Ensembl, FASTA URL, or local nucleotide FASTA upload. Keep metadata visible to the user before triggering GitHub Actions.

Poll status

Poll /api/status/:jobId and surface the live step list, workflow run URL, final download URL, or failure message.

Install downloaded tarballs

Return the one-line local install command: download_url goes into local({url <- ...}), then R downloads the tarball to a local file and installs it. Do not pass remote URLs directly to install.packages.

Skill workflow

The current integration path for Codex, Claude, and similar agent environments.
Trigger phrases

Use when a user needs a BSgenome package, mentions TSSr, motifmatchr, ChIPseeker, Gviz, or has a missing genome error.

Skill file
skill.md

Keep this file aligned with the HTTP API docs. It should tell agents to use one-line local tarball installs and treat permanent repository inclusion as maintainer-curated.

MCP status

Useful later, but not the current source of truth.

A future MCP server can wrap package lookup, upload session creation, build submission, status polling, deletion, and install-command generation.

For now, agents should call the HTTP API directly and link users to the package browser or API docs when they need human review.

API Commands

Trigger a build
curl -s -X POST https://autobsgenome-api.bioinfoark.workers.dev/api/build \
  -H "Content-Type: application/json" \
  -d '{
    "package_name": "BSgenome.Aluchuensis.NCBI.AkawachiiIFO4308",
    "organism": "Aspergillus luchuensis",
    "accession": "GCF_016861625.1",
    "data_source": "ncbi",
    "version": "1.0.0",
    "circ_seqs": "character(0)"
  }'
Poll build status
curl -s https://autobsgenome-api.bioinfoark.workers.dev/api/status/JOB_ID
Install the completed tarball
local({options(timeout = 7200); url <- "TARBALL_URL_FROM_STATUS_OR_PACKAGE_CARD"; tarball <- tempfile(fileext = ".tar.gz"); on.exit(unlink(tarball), add = TRUE); download.file(url, tarball, mode = "wb", method = "libcurl"); install.packages(tarball, repos = NULL, type = "source")})
Delete a temporary build
curl -s -X DELETE https://autobsgenome-api.bioinfoark.workers.dev/api/build/JOB_ID \
  -H "Content-Type: application/json" \
  -d '{"delete_token":"DELETE_TOKEN"}'
Upload a local FASTA
curl -s -X POST https://autobsgenome-api.bioinfoark.workers.dev/api/uploads \
  -H "Content-Type: application/json" \
  -d '{"file_name":"genome.fa","file_size":123456}'

Agent safeguards

  • Keep delete_token private. It can delete a user's temporary build release.
  • Do not publish builds to the permanent package repository. Public index inclusion is maintainer-curated.
  • Report build failures with job_id, workflow_run_url, package metadata, and the exact API message.
  • Use the package browser for lookup; use /api-docs as the source of truth for endpoint details.