rutherford-mcp-server 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. rutherford_mcp_server-0.1.0/.gitignore +33 -0
  2. rutherford_mcp_server-0.1.0/CHANGELOG.md +40 -0
  3. rutherford_mcp_server-0.1.0/LICENSE +21 -0
  4. rutherford_mcp_server-0.1.0/PKG-INFO +367 -0
  5. rutherford_mcp_server-0.1.0/README.md +338 -0
  6. rutherford_mcp_server-0.1.0/pyproject.toml +155 -0
  7. rutherford_mcp_server-0.1.0/src/rutherford/__init__.py +21 -0
  8. rutherford_mcp_server-0.1.0/src/rutherford/__main__.py +10 -0
  9. rutherford_mcp_server-0.1.0/src/rutherford/adapters/__init__.py +7 -0
  10. rutherford_mcp_server-0.1.0/src/rutherford/adapters/antigravity.py +198 -0
  11. rutherford_mcp_server-0.1.0/src/rutherford/adapters/base.py +200 -0
  12. rutherford_mcp_server-0.1.0/src/rutherford/adapters/claude_code.py +148 -0
  13. rutherford_mcp_server-0.1.0/src/rutherford/adapters/codex.py +305 -0
  14. rutherford_mcp_server-0.1.0/src/rutherford/adapters/cursor.py +208 -0
  15. rutherford_mcp_server-0.1.0/src/rutherford/adapters/generic.py +156 -0
  16. rutherford_mcp_server-0.1.0/src/rutherford/adapters/goose.py +130 -0
  17. rutherford_mcp_server-0.1.0/src/rutherford/adapters/kiro.py +164 -0
  18. rutherford_mcp_server-0.1.0/src/rutherford/adapters/opencode.py +247 -0
  19. rutherford_mcp_server-0.1.0/src/rutherford/adapters/qwen.py +239 -0
  20. rutherford_mcp_server-0.1.0/src/rutherford/adapters/registry.py +124 -0
  21. rutherford_mcp_server-0.1.0/src/rutherford/adapters/results.py +92 -0
  22. rutherford_mcp_server-0.1.0/src/rutherford/config/__init__.py +3 -0
  23. rutherford_mcp_server-0.1.0/src/rutherford/config/loader.py +145 -0
  24. rutherford_mcp_server-0.1.0/src/rutherford/config/schema.py +95 -0
  25. rutherford_mcp_server-0.1.0/src/rutherford/context.py +102 -0
  26. rutherford_mcp_server-0.1.0/src/rutherford/domain/__init__.py +7 -0
  27. rutherford_mcp_server-0.1.0/src/rutherford/domain/enums.py +104 -0
  28. rutherford_mcp_server-0.1.0/src/rutherford/domain/error_codes.py +60 -0
  29. rutherford_mcp_server-0.1.0/src/rutherford/domain/errors.py +61 -0
  30. rutherford_mcp_server-0.1.0/src/rutherford/domain/models.py +289 -0
  31. rutherford_mcp_server-0.1.0/src/rutherford/io/__init__.py +3 -0
  32. rutherford_mcp_server-0.1.0/src/rutherford/io/serialize.py +47 -0
  33. rutherford_mcp_server-0.1.0/src/rutherford/py.typed +0 -0
  34. rutherford_mcp_server-0.1.0/src/rutherford/roles/codereviewer.md +25 -0
  35. rutherford_mcp_server-0.1.0/src/rutherford/roles/debugger.md +25 -0
  36. rutherford_mcp_server-0.1.0/src/rutherford/roles/planner.md +21 -0
  37. rutherford_mcp_server-0.1.0/src/rutherford/roles/security.md +30 -0
  38. rutherford_mcp_server-0.1.0/src/rutherford/runtime/__init__.py +6 -0
  39. rutherford_mcp_server-0.1.0/src/rutherford/runtime/depth.py +61 -0
  40. rutherford_mcp_server-0.1.0/src/rutherford/runtime/launch.py +93 -0
  41. rutherford_mcp_server-0.1.0/src/rutherford/runtime/paths.py +62 -0
  42. rutherford_mcp_server-0.1.0/src/rutherford/runtime/platform.py +84 -0
  43. rutherford_mcp_server-0.1.0/src/rutherford/runtime/probe.py +110 -0
  44. rutherford_mcp_server-0.1.0/src/rutherford/runtime/process.py +152 -0
  45. rutherford_mcp_server-0.1.0/src/rutherford/server.py +265 -0
  46. rutherford_mcp_server-0.1.0/src/rutherford/services/__init__.py +7 -0
  47. rutherford_mcp_server-0.1.0/src/rutherford/services/consensus.py +209 -0
  48. rutherford_mcp_server-0.1.0/src/rutherford/services/delegation.py +243 -0
  49. rutherford_mcp_server-0.1.0/src/rutherford/services/jobs.py +122 -0
  50. rutherford_mcp_server-0.1.0/src/rutherford/services/roles.py +121 -0
  51. rutherford_mcp_server-0.1.0/src/rutherford/tools/__init__.py +9 -0
  52. rutherford_mcp_server-0.1.0/src/rutherford/tools/capabilities.py +70 -0
  53. rutherford_mcp_server-0.1.0/src/rutherford/tools/common.py +78 -0
  54. rutherford_mcp_server-0.1.0/src/rutherford/tools/consensus.py +86 -0
  55. rutherford_mcp_server-0.1.0/src/rutherford/tools/delegate.py +64 -0
  56. rutherford_mcp_server-0.1.0/src/rutherford/tools/jobs.py +32 -0
  57. rutherford_mcp_server-0.1.0/src/rutherford/tools/plan.py +36 -0
  58. rutherford_mcp_server-0.1.0/src/rutherford/tools/probing.py +58 -0
  59. rutherford_mcp_server-0.1.0/src/rutherford/tools/review.py +59 -0
  60. rutherford_mcp_server-0.1.0/src/rutherford/tools/roles.py +16 -0
@@ -0,0 +1,33 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ build/
6
+ dist/
7
+ .eggs/
8
+
9
+ # Virtual environments
10
+ .venv/
11
+ venv/
12
+ .env
13
+ .env.local
14
+
15
+ # Tooling caches
16
+ .pytest_cache/
17
+ .mypy_cache/
18
+ .ruff_cache/
19
+ .coverage
20
+ .coverage.*
21
+ coverage.xml
22
+ htmlcov/
23
+
24
+ # Local research receipts (kept out of commits)
25
+ .research/
26
+
27
+ # Per-user Claude Code settings
28
+ .claude/settings.local.json
29
+
30
+ # Logs and OS cruft
31
+ *.log
32
+ .DS_Store
33
+ Thumbs.db
@@ -0,0 +1,40 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file. The format is based on
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project adheres to
5
+ [Semantic Versioning](https://semver.org/).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.0] - 2026-05-30
10
+
11
+ Initial release.
12
+
13
+ ### Added
14
+
15
+ - Interface-driven orchestration core. The services depend only on the abstract
16
+ `CLIAdapter` and `ProcessRunner` interfaces; every CLI-specific detail lives behind an
17
+ adapter, so adding or removing a CLI is additive.
18
+ - Eight CLI adapters: `claude_code`, `codex`, `cursor`, `qwen`, `antigravity`, `kiro`,
19
+ `opencode`, `goose`, plus a config-driven generic adapter so a well-behaved further CLI is a
20
+ config entry.
21
+ - The MCP tool surface: `delegate`, `consensus`, `review`, `plan`, `capabilities`,
22
+ `doctor`, `job_status`, `job_result`, and `list_roles`, exposed over stdio via FastMCP.
23
+ - A universal `SafetyMode` (`read_only` | `propose` | `write` | `yolo`), defaulting to
24
+ `read_only`, mapped per adapter to that CLI's approval and sandbox flags. Write and yolo
25
+ modes require explicit opt-in and a trusted-workspace check.
26
+ - Synchronous and background (job) execution, with parallel consensus across targets and
27
+ optional per-target stance steering.
28
+ - Normalized `DelegationResult` envelope and a stable set of string error codes, serialized
29
+ as TOON (Token-Oriented Object Notation) to cut MCP client token usage, behind a swappable
30
+ serialization seam.
31
+ - Cross-platform process execution (Windows, macOS, Linux, and Linux under WSL): argv arrays
32
+ with no shell strings, `PATHEXT`/`.cmd` resolution, process-tree termination on timeout,
33
+ and Windows<->WSL path translation.
34
+ - A delegation depth guard propagated through `RUTHERFORD_DEPTH`, plus a per-request target
35
+ cap, so a CLI-calls-itself chain is bounded.
36
+ - Versioned role personas (`planner`, `codereviewer`, `security`, `debugger`) loaded from
37
+ markdown.
38
+ - Fake-based unit tests, adapter golden tests, a shared contract test over every registered
39
+ adapter, the self-invocation depth-guard test, and a local-only integration suite (real
40
+ CLIs, skipped in CI). The full house-convention scaffolding and docs set.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 John Chapman
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,367 @@
1
+ Metadata-Version: 2.4
2
+ Name: rutherford-mcp-server
3
+ Version: 0.1.0
4
+ Summary: An MCP server that delegates work to, and builds consensus across, a crew of agentic coding CLIs.
5
+ Project-URL: Homepage, https://github.com/chapmanjw/rutherford-mcp-server#readme
6
+ Project-URL: Repository, https://github.com/chapmanjw/rutherford-mcp-server.git
7
+ Project-URL: Issues, https://github.com/chapmanjw/rutherford-mcp-server/issues
8
+ Project-URL: Changelog, https://github.com/chapmanjw/rutherford-mcp-server/blob/main/CHANGELOG.md
9
+ Author: John Chapman
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: ai-agents,claude-code,cli,codex,consensus,mcp,model-context-protocol,orchestration
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development :: Build Tools
22
+ Classifier: Typing :: Typed
23
+ Requires-Python: >=3.11
24
+ Requires-Dist: fastmcp>=3.3
25
+ Requires-Dist: psutil>=7
26
+ Requires-Dist: pydantic>=2.13
27
+ Requires-Dist: python-toon>=0.1.3
28
+ Description-Content-Type: text/markdown
29
+
30
+ <p align="center">
31
+ <img src="docs/images/logo.png" width="200" alt="Rutherford logo">
32
+ </p>
33
+
34
+ # Rutherford MCP Server - Multi-Agent Consensus, Debates, Reviews, and Delegation
35
+
36
+ A [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server that lets one AI coding
37
+ CLI delegate work to, and build consensus across, a crew of others. Rutherford runs other agentic
38
+ coding CLIs (Claude Code, Codex, Cursor, Qwen Code, Antigravity, Kiro, OpenCode, Goose) as headless
39
+ subprocesses and returns each one's answer in a single normalized envelope. It is CLI-only: it
40
+ orchestrates terminal coding agents and never calls a model provider API directly.
41
+
42
+ ```
43
+ .---------.
44
+ | \/\/\/ |
45
+ | O [==]|
46
+ | < |
47
+ | \___/ |
48
+ '---------'
49
+ -- Ensign Sam Rutherford --
50
+ USS Cerritos . Engineering
51
+ ```
52
+
53
+ ## Why Rutherford?
54
+
55
+ > Rutherford is named for Ensign Sam Rutherford, the irrepressibly cheerful engineer aboard the
56
+ > USS Cerritos in Star Trek: Lower Decks. Rutherford has a cybernetic implant and a gift for
57
+ > getting heterogeneous systems to cooperate, which is exactly what this server does: it lets one
58
+ > AI coding agent hand work to a crew of others and bring their results back. Like the show's
59
+ > lower-deckers, Rutherford does the unglamorous coordination so the bridge, your primary agent,
60
+ > gets the win.
61
+ >
62
+ > Star Trek and Lower Decks are trademarks of their respective owners. This is an unaffiliated,
63
+ > fan-named open-source project and implies no endorsement.
64
+
65
+ ## Experimental status
66
+
67
+ Rutherford drives independent third-party CLIs. Their headless flags, output formats, and auth
68
+ mechanisms change between releases, and a CLI update can change or remove something an adapter
69
+ relies on. Every flag in this repo was verified against the CLI's own `--help` and docs on the
70
+ date in the table below; pin your CLI versions, re-verify after upgrades, and treat the integration
71
+ as evolving. Each adapter keeps all of its CLI-specific details in one file, so a change is a
72
+ one-file edit.
73
+
74
+ ## How it works
75
+
76
+ Rutherford is a stdio MCP server. Any MCP client -- a coding CLI or a desktop app -- calls it over
77
+ MCP, and it spawns the target CLIs as fresh, isolated headless subprocesses.
78
+
79
+ ```
80
+ any MCP client (Claude Code, Claude Desktop, Cursor, Codex, ...)
81
+ |
82
+ | MCP over stdio
83
+ v
84
+ rutherford-mcp-server
85
+ | argv list, no shell (read_only by default; depth-bounded)
86
+ +--> claude -p "..." --output-format json
87
+ +--> codex exec --json (prompt on stdin)
88
+ +--> agy -p "..." (answer read from the transcript file)
89
+ +--> kiro-cli chat --no-interactive "..."
90
+ +--> opencode run --format json "..."
91
+ +--> goose run -t "..." --no-session
92
+ +--> cursor-agent -p --output-format json (prompt on stdin)
93
+ +--> qwen -o json (prompt on stdin)
94
+ ```
95
+
96
+ A self-invocation is supported and explicit: when the calling CLI targets its own adapter (Claude
97
+ Code asking Rutherford to delegate to `claude_code`), Rutherford spawns a separate headless process
98
+ that is independent of the caller's session. A delegation depth is tracked and propagated through
99
+ `RUTHERFORD_DEPTH`, so a CLI-calls-itself chain stops at a configured maximum rather than recursing
100
+ without bound.
101
+
102
+ ## Supported CLIs
103
+
104
+ Invocation flags verified 2026-05-30. "(docs)" means verified against the CLI's documentation
105
+ rather than a local install.
106
+
107
+ | CLI | Adapter id | How Rutherford invokes it headlessly | Auth | Verified |
108
+ | --- | --- | --- | --- | --- |
109
+ | Claude Code | `claude_code` | `claude -p "<prompt>" --output-format json` | subscription/OAuth login or `ANTHROPIC_API_KEY` | 2026-05-30 |
110
+ | Codex | `codex` | `codex exec --json --skip-git-repo-check` (prompt on stdin) | ChatGPT login or `OPENAI_API_KEY` | 2026-05-30 |
111
+ | Antigravity | `antigravity` | `agy -p "<prompt>"` (answer read from the transcript file) | Google account login (no `whoami`; `doctor` verifies it with a live check) | 2026-05-30 |
112
+ | Kiro | `kiro` | `kiro-cli chat --no-interactive "<prompt>"` | `KIRO_API_KEY` (Pro/Pro+/Power) or `kiro-cli login` | 2026-05-30 |
113
+ | OpenCode | `opencode` | `opencode run --format json -q "<prompt>"` | provider key or `opencode auth login` | 2026-05-30 (docs) |
114
+ | Goose | `goose` | `goose run -q -t "<prompt>" --no-session` | `GOOSE_PROVIDER` + provider key | 2026-05-30 (docs) |
115
+ | Cursor | `cursor` | `cursor-agent -p --output-format json --trust` (prompt on stdin) | `cursor-agent login` or `CURSOR_API_KEY` | 2026-05-30 |
116
+ | Qwen Code | `qwen` | `qwen -o json` (prompt on stdin) | `qwen` OAuth login or `OPENAI_API_KEY` | 2026-05-30 |
117
+
118
+ Antigravity's print-mode model is fixed (no model selector). Cursor on a free plan can only use the
119
+ `auto` model; named models need a paid plan. Both Cursor and Qwen install as Windows shims, which
120
+ Rutherford launches via `cmd.exe` while feeding the prompt on stdin. Codex on Windows installs as an npm
121
+ shim, which Rutherford launches via `cmd.exe` automatically while still passing arguments as a list.
122
+ A seventh, well-behaved CLI can be added without code -- see [docs/adding-a-cli.md](docs/adding-a-cli.md).
123
+
124
+ ## Using Rutherford
125
+
126
+ You drive Rutherford from your MCP client in plain language. You describe what you want, and your
127
+ agent translates it into Rutherford's tools (`delegate`, `consensus`, `review`, `plan`,
128
+ `capabilities`, `doctor`, `job_status`, `job_result`, `list_roles`) -- you rarely name the tools or
129
+ their arguments yourself. You name a CLI (`claude_code`, `codex`, `cursor`, `qwen`, `kiro`,
130
+ `opencode`, `goose`, `antigravity`), optionally a model, and what you want done. Everything defaults
131
+ to read-only.
132
+
133
+ The examples below are prompts you can paste, grouped by what you are trying to do. Each is followed
134
+ by a note on what Rutherford does under the hood.
135
+
136
+ ### See which agents are available
137
+
138
+ > Which coding CLIs can Rutherford reach right now, and which ones am I signed in to?
139
+
140
+ > Run Rutherford's doctor and tell me if anything's misconfigured before I start delegating.
141
+
142
+ The first runs `capabilities` (an instant, free snapshot of installed state, auth, and models). The
143
+ second runs `doctor`, which also live-checks any CLI that has no status command -- like Antigravity,
144
+ whose auth only shows up once a real round trip confirms it.
145
+
146
+ ### Hand one task to a specific agent
147
+
148
+ > Use Rutherford to have Codex read `src/auth/session.py` and explain how token refresh works.
149
+ > Read-only -- don't change anything.
150
+
151
+ > Ask Kiro with the cheap `claude-haiku-4.5` model to summarize what changed in this 1,500-line log
152
+ > and list the three most likely root causes.
153
+
154
+ A single `delegate` to one CLI (and model), read-only. You get back one normalized result -- the
155
+ answer text, timing, token cost, and a session id you can resume.
156
+
157
+ ### Get a second and third opinion
158
+
159
+ > I think the deadlock is in `queue.py`. Ask Claude Code, Codex, and Qwen the same question --
160
+ > "where is the deadlock and how would you fix it?" -- and show me their answers side by side.
161
+
162
+ A `consensus` across three targets, one independent voice each. A CLI that errors or isn't installed
163
+ comes back as a single failed voice without sinking the rest of the panel.
164
+
165
+ ### Poll every CLI you have authenticated
166
+
167
+ > Ask every coding agent I'm logged into the same question -- "is a UUID or a ULID a better primary
168
+ > key for a high-write table?" -- and show me all their answers.
169
+
170
+ A `consensus` with no targets named (or `targets: "all"`): Rutherford builds the panel from every
171
+ adapter it finds installed and authenticated, each at its default model, and tells you in `skipped`
172
+ which it left out and why (not installed, needs login). If one voice asked for a model its plan
173
+ doesn't allow, that voice retries once on the CLI's default model rather than dropping out.
174
+
175
+ ### Run a structured debate with assigned stances
176
+
177
+ > Use Rutherford to debate this claim: "We should replace our internal REST APIs with gRPC." Have
178
+ > Cursor (model `auto`) argue for it and Claude Code argue against, then give me the strongest point
179
+ > on each side.
180
+
181
+ A `consensus` with per-target stances (for / against / neutral), so each agent argues its assigned
182
+ position instead of all converging on the same answer.
183
+
184
+ ### Build one combined recommendation
185
+
186
+ > Ask claude_code, codex, and opencode (`openai/gpt-5.4`) for the best caching strategy for an
187
+ > append-heavy event log, then have Rutherford merge their answers into a single recommendation that
188
+ > flags where they disagree.
189
+
190
+ A `consensus` with server-side synthesis enabled: you get every voice plus one merged answer.
191
+ (Synthesis is off by default -- usually you let your own agent compare the voices.)
192
+
193
+ ### Review code across several reviewers
194
+
195
+ > Review my staged diff with Rutherford using Claude Code and Codex as reviewers. Findings by file
196
+ > and line, must-fix separated from nits, and call out anything only one of them flagged.
197
+
198
+ > Have Codex and Qwen review everything under `src/payments/` for security and injection bugs.
199
+
200
+ `review` -- read-only, using the `codereviewer` role -- over a diff or a set of paths, across one or
201
+ more targets.
202
+
203
+ ### Get an implementation plan
204
+
205
+ > Use Rutherford's planner on Claude Code to turn "add OAuth2 device-code login to the CLI" into an
206
+ > ordered, step-by-step plan, with the files each step touches and the risky parts flagged.
207
+
208
+ `plan` -- one target, the `planner` role, read-only. The bundled roles are `planner`, `codereviewer`,
209
+ `security`, and `debugger`; ask "what roles does Rutherford have?" to list them, and you can add your
210
+ own (see [docs/configuration.md](docs/configuration.md)).
211
+
212
+ ### Let an agent actually make the change
213
+
214
+ > Let Codex apply the fix in `C:\work\myrepo` -- write mode, you have my permission to edit files in
215
+ > that folder. Add the missing null check and a test that covers it.
216
+
217
+ A `delegate` in `write` mode. Write and yolo are never the default: they require both an explicit
218
+ mode and a trusted workspace (an allowlisted path or your per-call go-ahead), so an agent can't
219
+ modify a directory by accident. See the safety model below.
220
+
221
+ ### Kick off a long job and keep working
222
+
223
+ > Start a big refactor on OpenCode in the background -- "convert the data layer to the repository
224
+ > pattern" in `C:\work\myrepo` -- and just give me the job id so I can keep working.
225
+
226
+ > Is that Rutherford job done yet? Show me the result if it finished.
227
+
228
+ The first runs `delegate` in async mode and returns a job id immediately; the second polls
229
+ `job_status` / `job_result`.
230
+
231
+ ### Continue where an agent left off
232
+
233
+ > Pick the review session Claude Code just ran back up, and tell it to also check the error handling
234
+ > now.
235
+
236
+ A `delegate` that passes the `session_id` from the earlier result back in, resuming that CLI's own
237
+ conversation (on the CLIs that support resume).
238
+
239
+ ### Get a fresh, unbiased take (self-invocation)
240
+
241
+ > Spin up a separate Claude Code instance through Rutherford -- one with no memory of this
242
+ > conversation -- to critique the design we just wrote, so I get an outside opinion.
243
+
244
+ Rutherford can target the very CLI you're talking to: it spawns a fresh, isolated subprocess that is
245
+ distinct from your session and can't reach back into it. A depth guard (`max_depth`, default 3) and a
246
+ per-call target cap keep a CLI-calls-itself chain bounded.
247
+
248
+ ## Install
249
+
250
+ Rutherford is a Python 3.11+ package. Install it as a tool so the `rutherford-mcp-server` command
251
+ is on your PATH:
252
+
253
+ ```sh
254
+ uv tool install rutherford-mcp-server
255
+ # or: pipx install rutherford-mcp-server
256
+ # or: pip install rutherford-mcp-server
257
+ ```
258
+
259
+ From source (for development):
260
+
261
+ ```sh
262
+ git clone https://github.com/chapmanjw/rutherford-mcp-server
263
+ cd rutherford-mcp-server
264
+ uv sync
265
+ uv run rutherford-mcp-server --smoke # prints a readiness line and exits
266
+ ```
267
+
268
+ Rutherford does not install or authenticate the target CLIs. Install and log in to whichever CLIs
269
+ you want to orchestrate (see [docs/integration-testing.md](docs/integration-testing.md)), then run
270
+ the `doctor` tool to confirm each one is reachable.
271
+
272
+ ## MCP client registration
273
+
274
+ Rutherford is client-agnostic: every tool behaves identically from any MCP client. The command to
275
+ run is `rutherford-mcp-server` (equivalently `python -m rutherford`). Configuration uses the same
276
+ command on Windows, macOS, and Linux.
277
+
278
+ ### Claude Code
279
+
280
+ ```sh
281
+ claude mcp add rutherford -- rutherford-mcp-server
282
+ ```
283
+
284
+ ### Claude Desktop / Cursor / other JSON-config clients
285
+
286
+ Add to the client's MCP servers config (Claude Desktop: `claude_desktop_config.json`; Cursor:
287
+ `.cursor/mcp.json`):
288
+
289
+ ```json
290
+ {
291
+ "mcpServers": {
292
+ "rutherford": {
293
+ "command": "rutherford-mcp-server"
294
+ }
295
+ }
296
+ }
297
+ ```
298
+
299
+ If the command is not on PATH, use an absolute path (or `python -m rutherford` with the interpreter
300
+ from the environment where Rutherford is installed).
301
+
302
+ ### Codex
303
+
304
+ ```sh
305
+ codex mcp add rutherford -- rutherford-mcp-server
306
+ ```
307
+
308
+ ### Linux under WSL
309
+
310
+ Install and run Rutherford inside the same WSL distribution as the CLIs it will orchestrate, and
311
+ register it from a client running in that distribution. When a client on the Windows host must
312
+ reach a server in WSL, invoke it through `wsl.exe`:
313
+
314
+ ```json
315
+ {
316
+ "mcpServers": {
317
+ "rutherford": {
318
+ "command": "wsl.exe",
319
+ "args": ["-e", "rutherford-mcp-server"]
320
+ }
321
+ }
322
+ }
323
+ ```
324
+
325
+ ### Self-invocation example
326
+
327
+ Register Rutherford in Claude Code as above, then ask Claude Code to use Rutherford's `delegate`
328
+ tool with `cli="claude_code"`. Rutherford spawns a fresh, isolated `claude -p` subprocess, distinct
329
+ from your session, and returns its result. The same works for Codex calling `codex`. The depth
330
+ guard (`max_depth`, default 3) bounds any self-referential chain.
331
+
332
+ See [docs/mcp-client-integration.md](docs/mcp-client-integration.md) for more clients and detail.
333
+
334
+ ## Safety model
335
+
336
+ Every delegation runs in one of four safety modes, defaulting to the most restrictive:
337
+
338
+ | Mode | Meaning |
339
+ | --- | --- |
340
+ | `read_only` (default) | Inspect only. Review and consensus are read-only by nature. |
341
+ | `propose` | The agent may propose changes (e.g. a diff) but not apply them. |
342
+ | `write` | The agent may modify the workspace, subject to the CLI's approvals. |
343
+ | `yolo` | The agent may act without approval prompts (the CLI's bypass mode). |
344
+
345
+ `write` and `yolo` require an explicit argument and a trusted-workspace check -- the target
346
+ directory must be on the configured `trusted_workspaces` allowlist, or the call must pass
347
+ `trust_workspace=true`. No adapter ever defaults to its permission-bypass flag. Invocations are
348
+ always built as an argv list, never a shell string. See [docs/security.md](docs/security.md).
349
+
350
+ ## Documentation
351
+
352
+ - [docs/architecture.md](docs/architecture.md) -- the layered design and the two core interfaces.
353
+ - [docs/configuration.md](docs/configuration.md) -- config file, env overrides, generic adapters.
354
+ - [docs/adding-a-cli.md](docs/adding-a-cli.md) -- the contract and checklist for adding a CLI.
355
+ - [docs/integration-testing.md](docs/integration-testing.md) -- installing and authenticating each CLI, and running the suite.
356
+ - [docs/mcp-client-integration.md](docs/mcp-client-integration.md) -- registration for many clients.
357
+ - [docs/troubleshooting.md](docs/troubleshooting.md) -- common problems and fixes.
358
+ - [docs/security.md](docs/security.md) -- the security model in depth.
359
+
360
+ ## Contributing
361
+
362
+ See [CONTRIBUTING.md](CONTRIBUTING.md). The whole core is testable without a real CLI; run
363
+ `just check` before pushing, then `just test-integration` for whatever CLIs your machine has.
364
+
365
+ ## License
366
+
367
+ MIT (c) John Chapman. See [LICENSE](LICENSE).