sgserver
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
sgserver
Command-line toolkit and MCP server for the everyday work you would do in SnapGene: inspect plasmids, find restriction sites, digest, clone, run PCR, design primers, edit sequences, auto-annotate features, verify sequencing reads and find CRISPR guides.
It is built so that humans and AI agents use the same tools: every command
has --json output, and every operation is also exposed as an MCP tool.
Independent project. SnapGene is a trademark of GSL Biotech LLC. This repository contains no SnapGene software, data or licence. Features that use SnapGene's own programs call your installation (see SnapGene is optional).
Install
# CLI (+ MCP server)
uv tool install "sgserver[mcp] @ git+https://github.com/ikoshos-gland/sgserver"
# or from a clone
git clone https://github.com/ikoshos-gland/sgserver && cd sgserver
uv tool install --editable ".[mcp]"Requires Python ≥ 3.12. Then:
sg --help
sg conf # check installation & active capabilities (alias: sg doctor)
sg --json confRelated MCP server: aki-mcp-sv
Quick start
sg info plasmid.gb # length, topology, GC, features
sg sites plasmid.gb --max-cuts 1 # unique cutters
sg digest plasmid.gb -e BamHI -e EcoRV # fragments and ends
sg gel "cut=plasmid.gb" -e BamHI --out gel.png
sg orf plasmid.gb --min-aa 100
sg translate plasmid.gb 1653 2372
sg find plasmid.gb GGATCC # IUPAC letters workInsert a gene into a vector (full example)
Directional cloning of mCherry into pUC19 with EcoRI and BamHI:
# 1) primers with restriction-site tails (GCGC helps the enzyme bind)
sg primers mCherry.gb 1 711 --fwd-tail GCGCGAATTC --rev-tail GCGCGGATCC
# 2) amplify → 731 bp with the sites at the ends
sg pcr mCherry.gb GCGCGAATTCATGGTGAGCAAGGGCGAG GCGCGGATCCCTACTTGTACAGCTCGTCC --out amp.gb
# 3) clone
sg clone pUC19.gb amp.gb -m restriction -e EcoRI -e BamHI --out pUC19-mCherry.gbResult: 3,382 bp = 2,686 (pUC19) − 21 (removed fragment) + 717 (cut insert). Both sites are recreated and the downstream SalI/HindIII sites survive.
Pitfall. Do not write digested fragments to files and join them later: GenBank cannot store sticky ends, so the product comes out a few bp too long. Pass the whole plasmids and name the enzyme with
-e.
Commands
Group | Commands |
Read / convert |
|
Analysis |
|
Cloning / PCR |
|
Editing |
|
Validation |
|
Alignment |
|
Setup |
|
Cloning methods: restriction, goldengate, gibson, infusion,
ligation, gateway-bp, gateway-lr.
Positions are 1-based and inclusive; strand is 1 or -1.
For AI agents
JSON output
Put --json before the command:
sg --json digest plasmid.gb -e EcoRI -e BamHI{
"enzymes": ["EcoRI", "BamHI"],
"fragments": [
{"index": 1, "size_bp": 2665, "end_5": "5' overhang GATC", "end_3": "5' overhang AATT"},
{"index": 2, "size_bp": 21, "end_5": "5' overhang AATT", "end_3": "5' overhang GATC"}
],
"files": []
}Errors are {"error": "..."} with exit code 1. The same dictionaries come from
the Python API in sgserver.api.
MCP server
sg-mcp speaks MCP over stdio and exposes 25 tools (sg_info, sg_sites,
sg_digest, sg_clone, sg_pcr, sg_design_primers, sg_mutate,
sg_verify_read, ...). Add it to your client:
{
"mcpServers": {
"sgserver": {
"command": "sg-mcp",
"env": { "SG_MCP_ROOT": "/path/to/your/project" }
}
}
}Claude Code:
claude mcp add sgserver -e SG_MCP_ROOT=$PWD -- sg-mcpCodex / Gemini / others: use the JSON block above in their MCP settings.
Safety: every path an agent passes must resolve inside SG_MCP_ROOT
(default: the directory the server starts in); anything else is rejected. The
server uses local stdio only and opens no network port.
Skill
skills/sgserver/SKILL.md teaches an agent the
commands and the pitfalls. Copy the folder into your agent's skills directory
(e.g. ~/.claude/skills/).
SnapGene is optional
Works without SnapGene | Needs a SnapGene installation |
reading | writing |
|
|
|
|
|
|
SnapGene is looked up in /opt/gslbiotech/snapgene; set SNAPGENE_DIR to use
another location. The CLI-based features also need a valid SnapGene licence
(~/.snapgene/snapgene-license.lic). Nothing from SnapGene is copied into
this repository.
Validation
The tests use SnapGene's own sample project as an independent reference: it holds both the inputs of a cloning and the product SnapGene produced.
Test | Result |
pUC57 + mTAGBFP2, SalI/KpnI | 3,387 bp, sequence identical to SnapGene's |
pGGA + mCherry, BsaI (Golden Gate) | 2,848 bp, sequence identical to SnapGene's |
pUC19 feature detection | all 10 features SnapGene finds, no false positives |
BamHI + EcoRV digest | 496 + 6,739 bp (fragments sum to plasmid size) |
mEGFP translation |
|
uv run python -m pytest tests -qWithout SnapGene installed, the tests that need its sample files are skipped
and the synthetic-sequence tests (test_api.py, test_mcp.py) still run — this
is what CI does.
Known limits
With the SnapGene window open,
convert,mapandhistorymay silently do nothing; the error message reminds you.historyuses SnapGene's own export and falls back to pydna's parser, which can choke on ambiguous letters (N, R, Y).Output files are GenBank. They open in SnapGene with their features, but are not recorded in SnapGene's own cloning history.
Methylation: an overlap with Dam/Dcm is only a warning unless the enzyme's sensitivity is known (e.g. BamHI is unaffected by Dam, MboI is blocked, DpnI requires it).
.scftrace files cannot be read (Biopython does not support them); export them as FASTA from SnapGene first.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Secure Linux sandboxes for AI agents, as MCP tools.
Email inboxes, webhook URLs, mock APIs and 170+ tools for coding agents over one MCP connection.
661214 tools for AI agents over one MCP endpoint: image, video, audio, 3D, data, storage, mail, GPUs.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceProvides a deterministic set of 40 cross-platform command tools as an MCP server, replacing unsafe raw shell calls with structured JSON inputs and outputs for file system, process, network, and git operations.18 npmApache 2.0
- FlicenseNot gradedqualityAmaintenanceExposes 38 OAuth-gated tools over one MCP endpoint so web-based AI clients like Claude, ChatGPT, and Grok can read and edit local files, run whitelisted shell commands, search content, use Git, SQLite, browser automation, DevTools, clipboard, notifications, ports, and background jobs on your own machine. A strict command whitelist and folder restrictions keep the local operating surface governable and safe by default.-
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to perform everyday developer chores as MCP tools — organizing and batch-renaming files, searching contents, hashing, converting timestamps, encoding/decoding, converting CSV and JSON, OCR, clipboard and screenshot access, zipping, running allowlisted commands, and managing processes. Destructive actions default to dry-run previews, and commands, renames, and process kills are constrained by allowlists and PID-plus-name matching so agents stay safe.4MIT
- AlicenseNot gradedqualityAmaintenanceProvides MCP servers that wrap developer tools like git, npm, Docker, and test runners, returning schema-validated, token-efficient JSON so agents can use structured data directly.4 npmMIT