claude-team-mcp 0.8.0__py3-none-any.whl → 0.9.0__py3-none-any.whl

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.
@@ -1,427 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: claude-team-mcp
3
- Version: 0.8.0
4
- Summary: MCP server for managing multiple Claude Code sessions via iTerm2
5
- Project-URL: Homepage, https://github.com/Martian-Engineering/claude-team
6
- Project-URL: Repository, https://github.com/Martian-Engineering/claude-team
7
- Project-URL: Documentation, https://github.com/Martian-Engineering/claude-team#readme
8
- Project-URL: Issues, https://github.com/Martian-Engineering/claude-team/issues
9
- Project-URL: Changelog, https://github.com/Martian-Engineering/claude-team/releases
10
- Author-email: Josh Lehman <josh@martianengineering.com>
11
- Maintainer-email: Josh Lehman <josh@martianengineering.com>
12
- License: MIT
13
- Keywords: ai,anthropic,automation,claude,claude-code,iterm2,mcp,multi-agent,orchestration
14
- Classifier: Development Status :: 3 - Alpha
15
- Classifier: Environment :: MacOS X
16
- Classifier: Intended Audience :: Developers
17
- Classifier: License :: OSI Approved :: MIT License
18
- Classifier: Operating System :: MacOS
19
- Classifier: Programming Language :: Python :: 3
20
- Classifier: Programming Language :: Python :: 3.11
21
- Classifier: Programming Language :: Python :: 3.12
22
- Classifier: Programming Language :: Python :: 3.13
23
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
- Classifier: Topic :: System :: Distributed Computing
25
- Classifier: Typing :: Typed
26
- Requires-Python: >=3.11
27
- Requires-Dist: iterm2>=2.7
28
- Requires-Dist: mcp>=1.0.0
29
- Requires-Dist: msgspec>=0.19.0
30
- Description-Content-Type: text/markdown
31
-
32
- # Claude Team MCP Server
33
-
34
- An MCP server that allows one Claude Code session to spawn and manage a team of other Claude Code sessions via iTerm2.
35
-
36
- ## Introduction
37
-
38
- `claude-team` is an MCP server and a set of slash commands for allowing Claude Code to orchestrate a "team" of other Claude Code sessions. It uses the iTerm2 API to spawn new terminal sessions and run Claude Code within them.
39
-
40
- ### Why?
41
-
42
- - **Parallelism:** Many development tasks can be logically parallelized, but managing that parallelism is difficult for humans with limited attention spans. Claude, meanwhile, is very effective at it.
43
- - **Context management:** Offloading implementation to a worker gives the implementing agent a fresh context window (smarter), and keeps the manager's context free of implementation details.
44
- - **Background work:** Sometimes you want to have Claude Code go research something or answer a question without blocking the main thread of work.
45
- - **Visibility:** `claude-team` spawns real Claude Code sessions. You can watch them, interrupt and take control, or close them out.
46
-
47
- But, *why not just use Claude Code sub-agents*, you ask? They're opaque -- they go off and do things and you, the user, cannot effectively monitor their work, interject, or continue a conversation with them. Using a full Claude Code session obviates this problem.
48
-
49
- ### Git Worktrees: Isolated Branches per Worker
50
-
51
- A key feature of `claude-team` is **git worktree support**. When spawning workers with `use_worktrees: true`, each worker gets:
52
-
53
- - **Its own working directory** - A dedicated git worktree at `~/.claude-team/worktrees/{repo-hash}/{worker-name}/`
54
- - **Its own branch** - Automatically created branch named `{WorkerName}-{hash}` (e.g., `Groucho-a1b2c3`)
55
- - **Shared repository history** - All worktrees share the same `.git` database, so commits are immediately visible across workers
56
-
57
- This means workers can make commits, run tests, and modify files without conflicting with each other or the main working directory. When work is complete, branches can be merged or submitted as PRs.
58
-
59
- ## Features
60
-
61
- - **Spawn Workers**: Create new Claude Code sessions in iTerm2 with multi-pane layouts
62
- - **Git Worktrees**: Isolate each worker in its own branch and working directory
63
- - **Send Messages**: Inject prompts into managed workers (single or broadcast)
64
- - **Read Logs**: Retrieve conversation history from worker JSONL files
65
- - **Monitor Status**: Check if workers are idle, processing, or waiting for input
66
- - **Idle Detection**: Wait for workers to complete using stop-hook markers
67
- - **Visual Identity**: Each worker gets a unique tab color and themed name (Marx Brothers, Beatles, etc.)
68
- - **Session Recovery**: Discover and adopt orphaned Claude Code sessions
69
-
70
- ## Requirements
71
-
72
- - macOS with iTerm2 installed
73
- - iTerm2 Python API enabled (Preferences → General → Magic → Enable Python API)
74
- - Python 3.11+
75
- - uv package manager
76
-
77
- ## Installation
78
-
79
- ### As Claude Code Plugin (recommended)
80
-
81
- ```bash
82
- # Add the Martian Engineering marketplace
83
- /plugin marketplace add Martian-Engineering/claude-team
84
-
85
- # Install the plugin
86
- /plugin install claude-team@martian-engineering
87
- ```
88
-
89
- This automatically configures the MCP server - no manual setup needed.
90
-
91
- ### From PyPI
92
-
93
- Once published, install via:
94
-
95
- ```bash
96
- uvx --from claude-team-mcp@latest claude-team
97
- ```
98
-
99
- ### From Source
100
-
101
- ```bash
102
- # Clone the repository
103
- git clone https://github.com/Martian-Engineering/claude-team.git
104
- cd claude-team
105
-
106
- # Install with uv
107
- uv sync
108
- ```
109
-
110
- ## Configuration for Claude Code
111
-
112
- Add to your Claude Code MCP settings. You can configure this at:
113
- - **Global**: `~/.claude/settings.json`
114
- - **Project**: `.claude/settings.json` in your project directory
115
-
116
- ### Using PyPI package
117
-
118
- ```json
119
- {
120
- "mcpServers": {
121
- "claude-team": {
122
- "command": "uvx",
123
- "args": ["--from", "claude-team-mcp@latest", "claude-team"]
124
- }
125
- }
126
- }
127
- ```
128
-
129
- ### Using local clone
130
-
131
- ```json
132
- {
133
- "mcpServers": {
134
- "claude-team": {
135
- "command": "uv",
136
- "args": ["run", "--directory", "/path/to/claude-team", "python", "-m", "claude_team_mcp"]
137
- }
138
- }
139
- }
140
- ```
141
-
142
- After adding the configuration, restart Claude Code for it to take effect.
143
-
144
- ## Environment Variables
145
-
146
- | Variable | Default | Description |
147
- |----------|---------|-------------|
148
- | `CLAUDE_TEAM_COMMAND` | `claude` | Override the command used to start Claude Code in worker sessions. Useful for running alternative CLI implementations like `happy`. |
149
- | `CLAUDE_TEAM_CODEX_COMMAND` | `codex` | Override the command used to start Codex in worker sessions. Useful for running wrapped Codex (e.g., `happy codex`). |
150
- | `CLAUDE_TEAM_PROJECT_DIR` | (none) | When set, allows using `"project_path": "auto"` in worker configs to automatically use this path. |
151
-
152
- Example using an alternative CLI:
153
-
154
- ```bash
155
- # For Claude Code workers
156
- export CLAUDE_TEAM_COMMAND=happy
157
-
158
- # For Codex workers
159
- export CLAUDE_TEAM_CODEX_COMMAND="happy codex"
160
- ```
161
-
162
- ## MCP Tools
163
-
164
- ### Worker Management
165
-
166
- | Tool | Description |
167
- |------|-------------|
168
- | `spawn_workers` | Create workers in a new window with multi-pane layout (single, vertical, horizontal, quad, triple_vertical) |
169
- | `list_workers` | List all managed workers with status |
170
- | `examine_worker` | Get detailed worker status including conversation stats and last response preview |
171
- | `close_workers` | Gracefully terminate one or more workers |
172
- | `discover_workers` | Find existing Claude Code sessions running in iTerm2 |
173
- | `adopt_worker` | Import a discovered iTerm2 session into the managed registry |
174
-
175
- ### Communication
176
-
177
- | Tool | Description |
178
- |------|-------------|
179
- | `message_workers` | Send a message to one or more workers (supports wait modes: none, any, all) |
180
- | `read_worker_logs` | Get paginated conversation history from a worker's JSONL file |
181
- | `annotate_worker` | Add a coordinator note to a worker (visible in list_workers output) |
182
-
183
- ### Idle Detection
184
-
185
- | Tool | Description |
186
- |------|-------------|
187
- | `check_idle_workers` | Quick non-blocking check if workers are idle |
188
- | `wait_idle_workers` | Block until workers are idle (supports "any" or "all" modes) |
189
-
190
- ### Utilities
191
-
192
- | Tool | Description |
193
- |------|-------------|
194
- | `list_worktrees` | List git worktrees created by claude-team for a repository |
195
- | `bd_help` | Beads quick reference (use `pb help` for Pebbles projects) |
196
-
197
- ### Worker Identification
198
-
199
- Workers can be referenced by any of three identifiers:
200
- - **Internal ID**: Short hex string (e.g., `3962c5c4`)
201
- - **Terminal ID**: Prefixed iTerm UUID (e.g., `iterm:6D2074A3-2D5B-4823-B257-18721A7F5A04`)
202
- - **Worker name**: Human-friendly name (e.g., `Groucho`, `Aragorn`)
203
-
204
- All tools accept any of these formats.
205
-
206
- ### Tool Details
207
-
208
- #### spawn_workers
209
-
210
- ```
211
- Arguments:
212
- projects: dict[str, str] - Map of pane names to project paths
213
- layout: str - "auto", "single", "vertical", "horizontal", "quad", or "triple_vertical"
214
- skip_permissions: bool - If True, start Claude with --dangerously-skip-permissions
215
- custom_names: list[str] - Override automatic themed name selection
216
- custom_prompt: str - Custom prompt instead of standard worker pre-prompt
217
- use_worktrees: bool - Create isolated git worktree for each worker
218
-
219
- Returns:
220
- sessions, layout, count, name_set, mode, use_worktrees, coordinator_guidance
221
- ```
222
-
223
- Layout pane names:
224
- - `single`: `["main"]`
225
- - `vertical`: `["left", "right"]`
226
- - `horizontal`: `["top", "bottom"]`
227
- - `quad`: `["top_left", "top_right", "bottom_left", "bottom_right"]`
228
- - `triple_vertical`: `["left", "middle", "right"]`
229
-
230
- #### message_workers
231
-
232
- ```
233
- Arguments:
234
- session_ids: list[str] - Worker IDs to message (accepts ID, terminal ID, or name)
235
- message: str - The prompt to send
236
- wait_mode: str - "none" (default), "any", or "all"
237
- timeout: float - Max seconds to wait (default: 600)
238
-
239
- Returns:
240
- success, session_ids, results, [idle_session_ids, all_idle, timed_out]
241
- ```
242
-
243
- #### wait_idle_workers
244
-
245
- ```
246
- Arguments:
247
- session_ids: list[str] - Worker IDs to wait on
248
- mode: str - "all" (default) or "any"
249
- timeout: float - Max seconds to wait (default: 600)
250
- poll_interval: float - Seconds between checks (default: 2)
251
-
252
- Returns:
253
- session_ids, idle_session_ids, all_idle, waiting_on, mode, waited_seconds, timed_out
254
- ```
255
-
256
- ## Slash Commands
257
-
258
- The following slash commands are available for common workflows. Install them with:
259
-
260
- ```bash
261
- make install-commands
262
- ```
263
-
264
- | Command | Description |
265
- |---------|-------------|
266
- | `/spawn-workers` | Analyze tasks, create worktrees, and spawn workers with appropriate prompts |
267
- | `/check-workers` | Generate a status report for all active workers |
268
- | `/merge-worker` | Directly merge a worker's branch back to parent (for internal changes) |
269
- | `/pr-worker` | Create a pull request from a worker's branch |
270
- | `/team-summary` | Generate end-of-session summary of all worker activity |
271
-
272
- ## Issue Tracker Support
273
-
274
- `claude-team` supports both Pebbles (`pb`) and Beads (`bd --no-db`).
275
- The tracker is auto-detected by marker directories in the project root:
276
-
277
- - `.pebbles` → Pebbles
278
- - `.beads` → Beads
279
-
280
- If both markers exist, Pebbles is selected by default. Worker prompts and
281
- coordination guidance use the detected tracker commands. For quick references:
282
-
283
- - Pebbles: `pb help`
284
- - Beads: `bd_help` tool
285
- | `/cleanup-worktrees` | Remove worktrees for merged branches |
286
-
287
- ## Usage Patterns
288
-
289
- ### Basic: Spawn and Message
290
-
291
- From your Claude Code session, spawn workers and send them tasks:
292
-
293
- ```
294
- "Spawn two workers for frontend and backend work"
295
- → Uses spawn_workers with projects={"left": "/path/to/frontend", "right": "/path/to/backend"}
296
- → Returns workers named e.g. "Simon" and "Garfunkel"
297
-
298
- "Send Simon the message: Review the React components"
299
- → Uses message_workers with session_ids=["Simon"]
300
-
301
- "Check on Garfunkel's progress"
302
- → Uses examine_worker with session_id="Garfunkel"
303
- ```
304
-
305
- ### Parallel Work with Worktrees
306
-
307
- Spawn workers in isolated branches for parallel development:
308
-
309
- ```
310
- "Spawn three workers with worktrees to work on different features"
311
- → Uses spawn_workers with use_worktrees=true
312
- → Creates worktrees at ~/.claude-team/worktrees/{repo}/
313
- → Each worker gets their own branch (e.g., "Larry-a1b2c3", "Curly-d4e5f6", "Moe-g7h8i9")
314
-
315
- "Message all workers with their tasks, then wait for completion"
316
- → Uses message_workers with wait_mode="all"
317
-
318
- "Create PRs for each worker's branch"
319
- → Uses /pr-worker for each completed worker
320
- ```
321
-
322
- ### Coordinated Workflow
323
-
324
- Use the manager to coordinate between workers:
325
-
326
- ```
327
- "Spawn a backend worker to create a new API endpoint"
328
- → Wait for completion with wait_idle_workers
329
-
330
- "Now spawn a frontend worker and tell it about the new endpoint"
331
- → Pass context from read_worker_logs of the backend worker
332
-
333
- "Spawn a test worker to write integration tests"
334
- → Coordinate based on both previous workers' output
335
- ```
336
-
337
- ## Architecture
338
-
339
- ```
340
- ┌──────────────────────────────────────────────────────────────────┐
341
- │ Manager Claude Code Session │
342
- │ (has claude-team MCP server) │
343
- ├──────────────────────────────────────────────────────────────────┤
344
- │ MCP Tools │
345
- │ spawn_workers │ message_workers │ wait_idle_workers │ etc. │
346
- └───────────────────────────┬──────────────────────────────────────┘
347
-
348
- ┌────────────┼────────────┐
349
- ▼ ▼ ▼
350
- ┌──────────┐ ┌──────────┐ ┌──────────┐
351
- │ Groucho │ │ Harpo │ │ Chico │
352
- │ (iTerm2) │ │ (iTerm2) │ │ (iTerm2) │
353
- │ │ │ │ │ │
354
- │ Claude │ │ Claude │ │ Claude │
355
- │ Code │ │ Code │ │ Code │
356
- │ │ │ │ │ │
357
- │ worktree │ │ worktree │ │ worktree │
358
- │ branch: │ │ branch: │ │ branch: │
359
- │ Groucho- │ │ Harpo- │ │ Chico- │
360
- │ a1b2c3 │ │ d4e5f6 │ │ g7h8i9 │
361
- └──────────┘ └──────────┘ └──────────┘
362
- ```
363
-
364
- The manager maintains:
365
- - **Session Registry**: Maps worker IDs/names to iTerm2 sessions
366
- - **iTerm2 Connection**: Persistent connection for terminal control
367
- - **JSONL Monitoring**: Reads Claude's session files for conversation state and idle detection
368
- - **Worktree Tracking**: Manages git worktrees for isolated worker branches
369
-
370
- ## Development
371
-
372
- ```bash
373
- # Sync dependencies
374
- uv sync
375
-
376
- # Run tests
377
- uv run pytest
378
-
379
- # Run the server directly (for debugging)
380
- uv run python -m claude_team_mcp
381
-
382
- # Install slash commands
383
- make install-commands
384
- ```
385
-
386
- ## Troubleshooting
387
-
388
- ### "Could not connect to iTerm2"
389
- - Make sure iTerm2 is running
390
- - Enable: iTerm2 → Preferences → General → Magic → Enable Python API
391
-
392
- ### "Session not found"
393
- - The worker may have been closed externally
394
- - Use `list_workers` to see active workers
395
- - Workers can be referenced by ID, terminal ID, or name
396
-
397
- ### "No JSONL session file found"
398
- - Claude Code may still be starting up
399
- - Wait a few seconds and try again
400
- - Check that Claude Code is actually running in the worker pane
401
-
402
- ### Worktree issues
403
- - Use `list_worktrees` to see worktrees for a repository
404
- - Orphaned worktrees can be cleaned up with `list_worktrees` + `remove_orphans=true`
405
- - Worktrees are stored at `~/.claude-team/worktrees/{repo-hash}/`
406
-
407
- ## License
408
-
409
- MIT
410
-
411
- ## Upgrading to New Versions
412
-
413
- After a new version is published to PyPI, you may need to force-refresh the cached version:
414
-
415
- ```bash
416
- # Stop service first
417
- launchctl bootout gui/$UID/com.claude-team
418
-
419
- # Clear cache and reinstall
420
- uv cache clean --force
421
- uv tool install --force --refresh claude-team-mcp
422
-
423
- # Restart service
424
- launchctl bootstrap gui/$UID ~/Library/LaunchAgents/com.claude-team.plist
425
- ```
426
-
427
- This is necessary because `uvx` aggressively caches tool environments.