switchyard
This server is a local-first MCP meta-harness for developer workflows that plans, routes, and orchestrates host-native AI task execution, while also providing continuous learning, auditing, and multi-agent swarm capabilities.
Task Planning & Decomposition: Break down complex coding tasks into subtasks with model tier assignments and parallel execution waves, using quick heuristic classification (no LLM call) to route tasks optimally.
Host-Native Execution: Delegate subtasks directly on the host shell via
host_spawnor external AI CLI providers (e.g., OpenCode, Aider), with support for file writes, surgical edit modes (rewrite, blocks, patch), and convergence quality gates.AI Swarm Orchestration: Plan and execute multi-agent swarms with various topologies (star, hierarchical, DAG, auto), including budget estimates, wave-based execution, and ability to resume failed runs from checkpoints.
Learning & Adaptive Memory: Store cross-session memory in a local SQLite database with full-text search; record task outcomes to continuously adapt routing thresholds; approve, reject, or merge learned agent drafts.
Workflow Blueprints & Task Packs: Export successful runs into replayable workflow blueprints, and use curated task packs for common patterns (e.g., security review, test-gap).
Telemetry & Auditing: Generate detailed run receipts (JSON, Markdown, HTML), inspect spend/quality/model performance, audit out-of-workspace writes, and monitor active subtasks.
Routing Safety & Controls: Enforce routing guards for tool calls, manage bypass exceptions, and preview/approve outside-workspace writes to maintain safety.
Provider Management: Automatically detect and list available AI CLI providers, with configuration of routing policies and exceptions.
Routes coding tasks to Amazon Q (Kiro) CLI as a secondary adapter, expanding provider options for task execution.
Routes coding tasks to GitHub Copilot CLI for execution, leveraging its free gpt-5-mini tier for low-complexity work.
Routes coding tasks to JetBrains Junie CLI, with medium-tier auto-routing by default for balanced performance.
Routes coding tasks to OpenAI Codex CLI, enabling host shell and execution capabilities for AI-assisted development.
Click on "Install 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., "@switchyardrefactor the login module and run tests on it"
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.
What is Threnody?
A local-first MCP meta-harness for developer workflows — small, auditable, and host-native, not a hosted swarm platform. Register it in Claude Code, Copilot CLI, Codex, Cursor, Junie, or OpenCode: Threnody plans and routes in MCP; the host shell executes via host_spawn / host_spawn_waves (Agent or Task subagents). When a handoff includes host_spawn_waves, spawn subagents — do not substitute direct edits on planned files.
execute_subtask is utility delegation only (opt-in): OpenCode, Aider, and local loopback endpoints — never other host CLIs. Same-host work returns HostNativeRequired with a spawn payload; host→host delegation returns HostDelegationBlocked. Claude Code is a router-only host by default.
On Claude Code, an opt-in mode (routing_policy.shells.claude-code.workflow_emit) emits tier-aware Dynamic Workflow scripts for fan-out plans — each agent() routes to its Threnody tier model, where a vanilla workflow runs every agent on the session model. Recurring shapes can be approved and saved as permanent /workflow commands.
For operators who want multi-agent coding without a permanent agent army, a second hosted control plane, or hidden coordination-token drift.
Related MCP server: Delegation MCP
Install
Requires: Python 3.10+ and macOS or Linux for the supported installation
paths. The full install.sh workflow expects at least one host AI CLI (gh,
claude, codex, cursor-agent, junie, or opencode); the packaged MCP
server can start without one for setup and diagnostics.
Claude Code plugin marketplace (recommended) — bundles the MCP server and nine routing skills, no shell restart:
claude plugin marketplace add timjensgrossinger/threnody
claude plugin install threnody@threnodyMCP package via uvx or pip — works with any MCP-aware host:
claude mcp add threnody -- uvx threnody-mcp
pip install threnody-mcp
threnody-mcpThe package entry point is a local stdio server. The packaged server can start
for setup and diagnostics without a host CLI; THRENODY_ALLOW_NO_HOST=1 is
only used by the full install.sh workflow to bypass its host-CLI check.
Full CLI install (adds ghc/ghcs/ghce aliases, syncs routing
instructions; restart shell after):
curl -fsSL https://raw.githubusercontent.com/timjensgrossinger/threnody/main/install.sh | bash
# plugin-only (skips shell aliases): ... | bash -s -- --plugin-modeFor a configured power-user installation, run threnody settings to finish
setup. The packaged stdio entry point does not run the interactive wizard.
Provider terms: Threnody is not affiliated with or endorsed by any AI provider. Credentials stay in provider-native stores; configure auth in each host CLI. See docs/LEGAL.md.
Docs: plugin install · limitations · legal · architecture
Compliance posture (defaults)
With default config, Threnody matches Anthropic's intended MCP pattern for Claude Code:
Control | Default behavior |
Execution | Host runs work via Agent and direct edits — Threnody returns |
Router-only | Claude Code is a coordination anchor; not a subprocess backend |
Same-host | Returns |
Host→host delegation |
|
Utility delegation | Off by default; opt-in targets OpenCode, Aider, and local endpoints only |
Routing policy | Advisory by default — |
Operator opt-in risk: Enabling providers.router_only_allow_execution can subprocess Claude Code. With subscription OAuth that pattern is documented as high policy risk in docs/LEGAL.md. Verify your auth mode and provider terms before changing defaults.
How it works
Host shell (Claude / Copilot / Codex / Cursor / …)
→ start_task / route_task / plan_task returns next_action and host_spawn_waves for host-native work
→ host executes Agent or Task subagents, direct edits (spawned from host_spawn_waves)
→ utility delegation execute_subtask → OpenCode / Aider / local (opt-in)
→ swarm / learning execute_swarm (host_native default), memory_*, learning_*Call the start_task tool (or route_task/plan_task) from your MCP host shell — start_task returns a compact next_action and optional host_spawn_waves for host-native execution.
Threnody scores complexity → low / medium / high tier (no extra LLM call on the hot path).
route_task/plan_taskreturn spawn metadata —host_spawnfor single-agent,host_spawn_wavesfor multi-step plans.The host runs the work — Claude Code uses Agent; other shells use Task.
Swarms or utility delegation —
execute_swarmreturns a host-native wave plan by default;execute_subtaskonly for utility backends when enabled.
Local-first: routing state, telemetry, and caches stay in local SQLite (~/.local/lib/threnody/); the MCP server talks to your host over stdio — no Threnody-hosted control plane. Outbound traffic comes only from the provider CLIs you invoke.
Features
Feature | What it does | |
🎯 | Tier routing | Heuristic complexity scoring + |
🧠 | Learning loop | Pattern tracking → draft agents → approval queue → plan-time context injection. No auto-promotion; conservative recurrence/quality/rework gates |
🐝 | Swarm orchestration |
|
⚡ | Dynamic Workflows | Opt-in (claude-code): fan-out plans emit a tier-aware Workflow script; recurring shapes export to permanent |
🧾 | Receipts and run cards |
|
🧩 | Task packs and blueprints | Curated packs ( |
🔬 | Static pre-scan | Deterministic AST + pattern scan (zero tokens) sharpens review tiering, injects verified-or-refuted leads, and grades reviewers against ground truth |
♻️ | Prior-review memory | An unchanged |
🪄 | Hybrid diagnose→implement | One read-only high-tier diagnosis produces a change-spec, cheaper implementers execute it. Emits tiers only; the discount is learned per work profile, never hardcoded |
✅ | Baseline-diff verify gate | Lint/type/test graded against the merge base, so pre-existing red never blocks and only real regressions get a fix pass (in-process, zero tokens on the host path) |
📚 | Repo beliefs | Each run leaves a free |
🪜 | Graded task ladder |
|
💾 | Cross-session memory |
|
🔌 | MCP-native | 53 published tools over stdio JSON-RPC; works with any MCP-compatible host |
📈 | Adaptive thresholds | EMA threshold learning from |
🛡️ | Write safety | Path validation, outside-workspace grant model + audit trail |
🔒 | Guarded routing | Optional coordination gate + Claude PreToolUse hooks ( |
Cross-CLI memory: all hosts share one SQLite store at ~/.local/lib/threnody/cache.db. Use global (no project_id), project (pass a stable absolute path, not "."), or task (explicit task_id) scopes. Do not store secrets — any connected host can read keys.
Adaptive routing: route_task returns a task_id; after work, call record_outcome(task_id=…, outcome=accepted|revised|rejected|reworked). Enable per project with threnody tune set learning_enabled true --project ..
Project skills
Nine repo-local skills under skills/ guide MCP workflows from any host. install.sh installs them into provider-native roots (directory-style for Claude Code / Cursor / Codex; flat markdown for Copilot CLI / OpenCode).
install.sh also writes the five review-dimension agent definitions into each host's own definition directory, so a review fan-out does not repeat the same checklist in every agent prompt (prompt_economy.externalize_boilerplate). A definition you already have under the same name is never overwritten — your tuned reviewer is the better version of that file.
Skill | Use when |
Plan-only or plan-then-execute; waves vs swarm | |
| |
| |
| |
Default broad review swarm — one read-only agent per file plus synthesis | |
Deep review swarm — file × dimension fanout, optional | |
Claude Code tier-aware Dynamic Workflows; save | |
Contract-first parallel frontend + backend + API | |
Monitor opt-in utility |
Supported providers
Provider | Binary | Role |
Claude Code |
| Host (router-only) — executes via Agent / direct edits |
GitHub Copilot |
| Host — executes via Task |
OpenAI Codex |
| Host — Task execution |
Cursor |
| Host — Task execution |
OpenCode |
| Host + utility delegation target |
JetBrains Junie |
| Host / legacy paths |
Aider |
| Utility (opt-in delegation) |
Amazon Q / Kiro · Mistral Vibe · Blackbox |
| Secondary adapters / detect |
Windsurf |
| Detect only — never executes |
Live matrix: threnody inspect status --project . --details. Full table: docs/PROVIDER_COMPATIBILITY.md
See it in action
plan_task("add JWT auth with tests")
→ host_spawn_waves: [
{ "wave": 1, "agents": [{ "tool": "Agent", "tier": "medium", "target_files": ["src/auth.py"] }] },
{ "wave": 2, "agents": [{ "tool": "Agent", "tier": "low", "target_files": ["tests/test_auth.py"] }] }
]📋 Wave 1 — spawn Agent (host model) → src/auth.py
📋 Wave 2 — spawn Agent (host model) → tests/test_auth.pyOptional utility delegation (opt-in via providers.delegation_utilities_enabled):
execute_subtask(prompt="…", tier="low", provider_id="opencode") → OpenCode utility backend
execute_subtask(prompt="…", tier="medium") → HostNativeRequired + spawn payload
execute_subtask(provider_id="codex") → HostDelegationBlockedShell commands
ghc agent "implement JWT auth for the user service" # multi-agent waves
ghcs "how to list files recursively in python" # quick routed call
threnody inspect status --project . --details # provider readiness
threnody quality --since 7d # model quality ledger
threnody ladder run --tier low,medium,high # graded ground truth (spends tokens)
threnody-watch # live TUI monitorFull reference: docs/CLI.md
Documentation
Doc | Contents |
uvx, plugin marketplace, | |
All 53 MCP tool surfaces | |
Shell aliases and operator commands | |
Trust boundaries and local-first design | |
Safe starting config | |
Eval methodology and accuracy | |
Claude PreToolUse guard script | |
Host-native vs utility delegation | |
Threnody vs heavy swarm platforms | |
Beta scope, privacy, roadmap | |
Operator responsibilities | |
Common fixes |
Beta status
Public alpha v0.3.0-alpha.3 — MCP tool schemas may change between releases; pin a git tag for stability. macOS and Linux (zsh/bash); Windows not supported by the installer. See CHANGELOG.md.
Running tests
THRENODY_TEST_MODE=1 python3 -m pytest tests/ -q
THRENODY_TEST_MODE=1 python3 -m shared.routing_eval
python3 scripts/check_release_archive.pyUninstall
~/.local/lib/threnody/uninstall.sh [--purge-data]Legal
Threnody is an independent open-source project, not affiliated with or endorsed by Anthropic, OpenAI, GitHub, Google, Cursor, JetBrains, or any other provider named here. Provided "AS IS" under the Apache License 2.0 (no warranty). You are solely responsible for determining whether your routing patterns comply with each provider's current terms.
Operator responsibilities: docs/LEGAL.md · Third-party attributions: NOTICE
Built by @timjensgrossinger.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-quality-maintenanceOrchestrates multiple AI models (Gemini, OpenAI, Claude, local models) within a single conversation context, enabling collaborative workflows like multi-model code reviews, consensus building, and CLI-to-CLI bridging for specialized tasks.Last updated
- AlicenseCqualityDmaintenanceIntelligent routing layer that analyzes tasks and guides your AI agent to delegate work to specialized tools (Gemini, Aider, Copilot) using rule-based and capability-based routing.Last updated3MIT
- Alicense-qualityDmaintenanceUnified CLI multiplexer for AI coding agents, enabling orchestration of multiple coding CLI tools through a single interface with session persistence, cost tracking, and MCP tool support.Last updated2019MIT
- AlicenseAqualityAmaintenanceEnables one AI coding agent to delegate tasks to, and build consensus across, multiple other coding CLIs (Claude Code, Codex, etc.) by orchestrating them as headless subprocesses.Last updated184MIT
Related MCP Connectors
Coding agents from Claude Code, Cursor and Codex claim jobs and lock files on one shared board.
Real-time chat hub for AI agents — Claude Code, Cursor, Cline, Codex over MCP or REST.
Real-time chat hub for AI agents — Claude Code, Cursor, Cline, Codex over MCP or REST.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/timjensgrossinger/threnody'
If you have feedback or need assistance with the MCP directory API, please join our Discord server