mcp-ashigaru
An MCP server that enables autonomous code development by pulling GitHub issues, fixing them in a sandboxed environment, running tests, opening PRs, and promoting to production upon human approval.
README
mcp-ashigaru
Kagetora's dispatchable dev-runner corps. An MCP server that lets Kagetora drive
Claude Code as a headless dev sub-agent across the crunchtools fleet: pull a GitHub
issue, fix it in an unprivileged sandbox, run the repo's gates, open a PR — and, on
explicit human approval, promote to production. The goal is light development from a
phone: text Kagetora "work <repo> #N," review what comes back, approve, ship.
Named for the ashigaru (足軽) — the foot-soldiers a daimyo dispatched into the field. Kagetora is the commander; these are the units it sends.
Status: alpha / under active construction. See Roadmap for what's live vs. pending.
Architecture
Three roles, deliberately kept apart so the component that can be talked into something bad has the least authority, and the component with authority can't be talked into anything:
you (phone) ──Signal──▶ Kagetora ──▶ airlock gateway ──▶ mcp-ashigaru ──▶ wrapper scripts ──▶ agent container
(the boss) (foreman, LLM) (single secured (this repo — (deterministic; (Claude Code,
endpoint) thin tool surface) hold the creds) sealed sandbox)
| Role | What it is | Authority |
|---|---|---|
| Kagetora | The foreman (Hermes agent, Signal interface). Decides what work happens, holds the approval gates. | An LLM → persuadable → holds no dangerous powers directly. |
| mcp-ashigaru | This server. A thin MCP surface (work_ticket/status/promote). |
Translates intent → wrapper invocations. No arbitrary command surface. |
| Wrapper scripts | Deterministic bash (work-ticket.sh, promote.sh). |
Hold the GitHub token, run podman gates, do git/gh. Not an LLM → can't be prompt-injected. |
| Agent container | Claude Code (claude -p), sealed. |
Edits code only. Only a Claude token — no GH token, no podman socket, no prod secrets. |
Reached by Kagetora through the airlock gateway (added as a backend in the
kagetora profile), so the same single-endpoint + defense pipeline that fronts the
rest of the fleet also fronts this. Part of the Ashigaru dev-runner platform —
see the fleet spec for the full design (pool of ashigaru-1..5, code/webapp
profiles, the merge-train, web previews).
Tools
| Tool | Purpose |
|---|---|
work_ticket(repo, issue, brief, model) |
Start a run: clone repo, fix issue #issue, run the repo's gates, open a PR. brief is a maintainer-supplied summary of the issue (airlock-filtered; the sub-agent never reads the raw GitHub issue). model optionally pins the starting model tier. Runs the escalation ladder internally (below). Returns a run_id. |
status(run_id) |
On-demand digest: phase, recent agent actions, which model tier the run reached, live CI/build checks for the PR, and the PR URL. This is what Kagetora answers from when you ask "what's the status of the builds?" |
promote(repo, pr) |
Squash-merge a reviewed PR to ship via the repo's pipeline. Trust-based — no approval token; authorized by your Signal instruction to Kagetora, acting on airlock-filtered content. |
Model escalation (cost-tiered intelligence)
Every run starts cheap and escalates only when the work proves hard. The gate is the arbiter — never the agent's self-assessment.
Tier 1 Sonnet ──▶ gate ─pass─▶ PR
└─fail─▶
Tier 2 Opus (failure fed back) ──▶ gate ─pass─▶ PR
└─fail─▶
Tier 3 Opus, high/xhigh effort ──▶ gate ─pass─▶ PR
└─fail─▶ escalate to human (Kagetora pings you)
Most routine fixes land at Sonnet prices; only sticky bugs spend Opus tokens.
The diff + gate failure from each tier is fed to the next so it iterates rather than
starting cold. status reports which tier a run reached.
Security model
- Unprivileged sandbox. Everything runs as the
devrunneruser on lotor with rootless podman — no root, no sudo, no path to production, prod secrets, or other services. Blast radius = devrunner's sandbox. - Capability starvation for the agent. The coding agent's container holds only a Claude token. No GitHub token (can't push or touch other repos), no podman socket, no prod creds. Its entire reach is "edit files in this one checkout."
- Deterministic wrappers hold the keys. git/gh, podman gates, and deploy live in fixed bash scripts that can't be prompt-injected — not in the LLM surface and not in the agent.
- Production promotion is trust-based, not token-gated. It is authorized by the maintainer's Signal instruction to Kagetora — designed for phone-driven ops — acting on airlock-filtered content. Defense in depth comes from that filtered content lane plus the fact that a squash-merge is revertable and host rollout is a separate step, not from an out-of-band token the agent would have to hold.
Run
mcp-ashigaru-crunchtools --transport streamable-http --host 0.0.0.0 --port 8020
# or: python -m mcp_ashigaru --transport streamable-http --port 8020
Deployed on lotor as a systemd unit run under the devrunner user, on the
crunchtools network, so it inherits the unprivileged sandbox and can reach
devrunner's rootless podman socket to launch agent containers and run gates.
Build & deploy pipeline
- Image is built and pushed by GHA only — never hand-pushed.
quay.io/crunchtools/mcp-ashigaru(+ ghcr) via.github/workflows/container.yml, dual-push per the crunchtools constitution. A localpodman pushto the registry is not part of the flow. - The repo is public. Required because crunchtools is a GitHub Free org, and Free orgs cannot expose org-level Actions secrets (
QUAY_USERNAME/QUAY_PASSWORD) to private repos — the secrets list as "available" via the API but arrive empty at runtime. Public repos get them. (No secrets live in this repo; tokens are runtime env on lotor.) - Deploy pulls the GHA-built image on lotor and runs it as the
devrunnersystemd unit; addingdev-runner/ashigaruas a backend in thekagetoragateway profile makes it reachable from your phone.
Design decisions & gotchas (the record)
- Gate is the arbiter, not the agent. Maiden run (ROTV #475): the agent produced a confident, plausible fix that failed CI — caught before prod. That's the system working: an agent whose mistakes are reliably gated, with a human holding the prod key.
- Tool scoping is a reliability lever, not just a security one. Giving the agent
Bashin a no-podman container let it launch a build command that hung until timeout (and--output-format jsonbuffers, so a kill left zero output). Scope tools to exactly what the task needs (Read,Edit,Write,Glob,Grepfor a code fix); denials are instant. - Observability via
--output-format stream-json --verbose. Streams one event per action (file reads, edits, reasoning), so progress is visible live and a timeout still leaves partial output. Thestatustool summarizes this on demand — pull, not push; Kagetora pings only on milestone transitions. ./run.sh testis NOT safe on the prod host. ROTV's gate uses--network=host --privileged -p 8080and needs prod seed data — it's for an isolated dev box. The PR's GitHub Actions CI is the prod-safe gate.
Roadmap (what's in place)
- [x] Unprivileged
devrunnersandbox + rootless podman on lotor - [x] Headless Claude Code on subscription token, in a container, validated
- [x] This server scaffolded (
work_ticket/status/promote), GHA → quay (public) - [x] Model-escalation model specced
- [ ]
work-ticket.shwrapper implementing the Sonnet→Opus ladder + event persistence - [ ]
statuswired to live CI/build checks;promote.shgated deploy - [ ] Deploy on lotor (devrunner systemd unit) + add to the
kagetoragateway profile - [ ] Dogfood: iterate on
mcp-ashigaruwithmcp-ashigaru - [ ] The pool (
ashigaru-1..5),webapppreviews, merge-train (see fleet spec)
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。