claude-team-mcp 0.2.0__py3-none-any.whl → 0.3.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.
- claude_team_mcp/__init__.py +2 -2
- claude_team_mcp/server.py +76 -14
- claude_team_mcp/tools/close_workers.py +6 -7
- {claude_team_mcp-0.2.0.dist-info → claude_team_mcp-0.3.0.dist-info}/METADATA +1 -1
- {claude_team_mcp-0.2.0.dist-info → claude_team_mcp-0.3.0.dist-info}/RECORD +7 -7
- {claude_team_mcp-0.2.0.dist-info → claude_team_mcp-0.3.0.dist-info}/WHEEL +0 -0
- {claude_team_mcp-0.2.0.dist-info → claude_team_mcp-0.3.0.dist-info}/entry_points.txt +0 -0
claude_team_mcp/__init__.py
CHANGED
|
@@ -12,8 +12,8 @@ from .colors import generate_tab_color, get_hue_for_index, hsl_to_rgb_tuple
|
|
|
12
12
|
|
|
13
13
|
def main():
|
|
14
14
|
"""Entry point for the claude-team command."""
|
|
15
|
-
from .server import
|
|
16
|
-
|
|
15
|
+
from .server import main as server_main
|
|
16
|
+
server_main()
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
__all__ = [
|
claude_team_mcp/server.py
CHANGED
|
@@ -32,6 +32,22 @@ logging.basicConfig(
|
|
|
32
32
|
logger = logging.getLogger("claude-team-mcp")
|
|
33
33
|
|
|
34
34
|
|
|
35
|
+
# =============================================================================
|
|
36
|
+
# Singleton Registry (persists across MCP sessions for HTTP mode)
|
|
37
|
+
# =============================================================================
|
|
38
|
+
|
|
39
|
+
_global_registry: SessionRegistry | None = None
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def get_global_registry() -> SessionRegistry:
|
|
43
|
+
"""Get or create the global singleton registry."""
|
|
44
|
+
global _global_registry
|
|
45
|
+
if _global_registry is None:
|
|
46
|
+
_global_registry = SessionRegistry()
|
|
47
|
+
logger.info("Created global singleton registry")
|
|
48
|
+
return _global_registry
|
|
49
|
+
|
|
50
|
+
|
|
35
51
|
# =============================================================================
|
|
36
52
|
# Application Context
|
|
37
53
|
# =============================================================================
|
|
@@ -162,11 +178,11 @@ async def app_lifespan(server: FastMCP) -> AsyncIterator[AppContext]:
|
|
|
162
178
|
logger.error("Make sure iTerm2 is running and Python API is enabled")
|
|
163
179
|
raise RuntimeError("Could not connect to iTerm2") from e
|
|
164
180
|
|
|
165
|
-
# Create application context with
|
|
181
|
+
# Create application context with singleton registry (persists across sessions)
|
|
166
182
|
ctx = AppContext(
|
|
167
183
|
iterm_connection=connection,
|
|
168
184
|
iterm_app=app,
|
|
169
|
-
registry=
|
|
185
|
+
registry=get_global_registry(),
|
|
170
186
|
)
|
|
171
187
|
|
|
172
188
|
try:
|
|
@@ -180,16 +196,25 @@ async def app_lifespan(server: FastMCP) -> AsyncIterator[AppContext]:
|
|
|
180
196
|
|
|
181
197
|
|
|
182
198
|
# =============================================================================
|
|
183
|
-
# FastMCP Server
|
|
199
|
+
# FastMCP Server Factory
|
|
184
200
|
# =============================================================================
|
|
185
201
|
|
|
186
|
-
mcp = FastMCP(
|
|
187
|
-
"Claude Team Manager",
|
|
188
|
-
lifespan=app_lifespan,
|
|
189
|
-
)
|
|
190
202
|
|
|
191
|
-
|
|
192
|
-
|
|
203
|
+
def create_mcp_server(host: str = "127.0.0.1", port: int = 8766) -> FastMCP:
|
|
204
|
+
"""Create and configure the FastMCP server instance."""
|
|
205
|
+
server = FastMCP(
|
|
206
|
+
"Claude Team Manager",
|
|
207
|
+
lifespan=app_lifespan,
|
|
208
|
+
host=host,
|
|
209
|
+
port=port,
|
|
210
|
+
)
|
|
211
|
+
# Register all tools from the tools package
|
|
212
|
+
register_all_tools(server, ensure_connection)
|
|
213
|
+
return server
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
# Default server instance for stdio mode (backwards compatibility)
|
|
217
|
+
mcp = create_mcp_server()
|
|
193
218
|
|
|
194
219
|
|
|
195
220
|
# =============================================================================
|
|
@@ -311,11 +336,48 @@ async def resource_session_screen(
|
|
|
311
336
|
# =============================================================================
|
|
312
337
|
|
|
313
338
|
|
|
314
|
-
def run_server():
|
|
315
|
-
"""
|
|
316
|
-
|
|
317
|
-
|
|
339
|
+
def run_server(transport: str = "stdio", port: int = 8766):
|
|
340
|
+
"""
|
|
341
|
+
Run the MCP server.
|
|
342
|
+
|
|
343
|
+
Args:
|
|
344
|
+
transport: Transport mode - "stdio" or "streamable-http"
|
|
345
|
+
port: Port for HTTP transport (default 8766)
|
|
346
|
+
"""
|
|
347
|
+
if transport == "streamable-http":
|
|
348
|
+
logger.info(f"Starting Claude Team MCP Server (HTTP on port {port})...")
|
|
349
|
+
# Create server with configured port for HTTP mode
|
|
350
|
+
server = create_mcp_server(host="127.0.0.1", port=port)
|
|
351
|
+
server.run(transport="streamable-http")
|
|
352
|
+
else:
|
|
353
|
+
logger.info("Starting Claude Team MCP Server (stdio)...")
|
|
354
|
+
mcp.run(transport="stdio")
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
def main():
|
|
358
|
+
"""CLI entry point with argument parsing."""
|
|
359
|
+
import argparse
|
|
360
|
+
|
|
361
|
+
parser = argparse.ArgumentParser(description="Claude Team MCP Server")
|
|
362
|
+
parser.add_argument(
|
|
363
|
+
"--http",
|
|
364
|
+
action="store_true",
|
|
365
|
+
help="Run in HTTP mode (streamable-http) instead of stdio",
|
|
366
|
+
)
|
|
367
|
+
parser.add_argument(
|
|
368
|
+
"--port",
|
|
369
|
+
type=int,
|
|
370
|
+
default=8766,
|
|
371
|
+
help="Port for HTTP mode (default: 8766)",
|
|
372
|
+
)
|
|
373
|
+
|
|
374
|
+
args = parser.parse_args()
|
|
375
|
+
|
|
376
|
+
if args.http:
|
|
377
|
+
run_server(transport="streamable-http", port=args.port)
|
|
378
|
+
else:
|
|
379
|
+
run_server(transport="stdio")
|
|
318
380
|
|
|
319
381
|
|
|
320
382
|
if __name__ == "__main__":
|
|
321
|
-
|
|
383
|
+
main()
|
|
@@ -113,16 +113,15 @@ def register_tools(mcp: FastMCP) -> None:
|
|
|
113
113
|
Gracefully terminates the Claude sessions in parallel and closes
|
|
114
114
|
their iTerm2 panes. All session_ids must exist in the registry.
|
|
115
115
|
|
|
116
|
-
⚠️ **
|
|
116
|
+
⚠️ **NOTE: WORKTREE CLEANUP**
|
|
117
117
|
Workers with worktrees commit to ephemeral branches. When closed:
|
|
118
118
|
- The worktree directory is removed
|
|
119
|
-
- The
|
|
120
|
-
- Commits on that branch become orphaned (recoverable via reflog, but awkward)
|
|
119
|
+
- The branch is KEPT for cherry-picking/merging
|
|
121
120
|
|
|
122
|
-
**
|
|
123
|
-
1. Review
|
|
124
|
-
2. Merge or cherry-pick
|
|
125
|
-
3.
|
|
121
|
+
**AFTER closing workers with worktrees:**
|
|
122
|
+
1. Review commits on the worker's branch
|
|
123
|
+
2. Merge or cherry-pick commits to a persistent branch
|
|
124
|
+
3. Delete the branch when done: `git branch -D <branch-name>`
|
|
126
125
|
|
|
127
126
|
Args:
|
|
128
127
|
session_ids: List of session IDs to close (1 or more required).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: claude-team-mcp
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: MCP server for managing multiple Claude Code sessions via iTerm2
|
|
5
5
|
Project-URL: Homepage, https://github.com/Martian-Engineering/claude-team
|
|
6
6
|
Project-URL: Repository, https://github.com/Martian-Engineering/claude-team
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
claude_team_mcp/__init__.py,sha256=
|
|
1
|
+
claude_team_mcp/__init__.py,sha256=HnGWRX1P2CxUafElaxq6zXvXznQeUF5XiQBqu9eJU0Q,481
|
|
2
2
|
claude_team_mcp/__main__.py,sha256=JOG9n8ZCjy3JN96T0n97Ro-ZWtOU-RTJks7ahz81NRM,134
|
|
3
3
|
claude_team_mcp/colors.py,sha256=f-PcPep9WkZ7zbt-IF0Ey4OXfZeiY-y2uXERFtiY8Pk,3270
|
|
4
4
|
claude_team_mcp/formatting.py,sha256=myyzR6sbBapsmo5e5_dK3X5qk8ww2NbNkmo0DpHxDxs,3181
|
|
@@ -7,7 +7,7 @@ claude_team_mcp/iterm_utils.py,sha256=S2s4X1svQoDwsHcphIaHMIGXBIJxeRublGavk-m08v
|
|
|
7
7
|
claude_team_mcp/names.py,sha256=M-84kICkGP4W2LOK94Jzf5O0Gg9AuYpCPfJ-6fq9GjA,15894
|
|
8
8
|
claude_team_mcp/profile.py,sha256=yqytAE0dIe6NQ6FodldSepO-ZIeR7-C0UfK3FsO7Pn4,12326
|
|
9
9
|
claude_team_mcp/registry.py,sha256=6JLrKgbb_9_wfg8CuVLgWRWv3M5eXVKC5QW8DTUGoIQ,12808
|
|
10
|
-
claude_team_mcp/server.py,sha256=
|
|
10
|
+
claude_team_mcp/server.py,sha256=nyBHhL-ke2Mj4YVsEQWyTi0b-mHf7hnsen1-PcRsg5c,12374
|
|
11
11
|
claude_team_mcp/session_state.py,sha256=3kg5sLMp4jcIAJOE6pmXOhdFA9oz-fGkOzK3wsaemnM,27420
|
|
12
12
|
claude_team_mcp/subprocess_cache.py,sha256=6Q1NIMn2X5_75S4s_a9iPBka-UCz6RW0EMxPSPEaLxo,3612
|
|
13
13
|
claude_team_mcp/worker_prompt.py,sha256=olzVr6iHbYeb8sOThIJgVqrqc9uttgBvYzqI3v1J1rE,6207
|
|
@@ -17,7 +17,7 @@ claude_team_mcp/tools/adopt_worker.py,sha256=oWSamOzOqnLPWADWb4tk7qSPHroxIhQXkFD
|
|
|
17
17
|
claude_team_mcp/tools/annotate_worker.py,sha256=mBo4YMaaaNQxQBduYK1DPA-Ioift-ZQ9tYlBM6S15t8,1639
|
|
18
18
|
claude_team_mcp/tools/bd_help.py,sha256=kA3DnMGG48ruIt7L-tcUPfevy_l-Yy22pa3I20DZU2A,1402
|
|
19
19
|
claude_team_mcp/tools/check_idle_workers.py,sha256=IjDNDeal9M7lTONWjKZrt8bXu7O277ossHz_2oyLRcY,3374
|
|
20
|
-
claude_team_mcp/tools/close_workers.py,sha256=
|
|
20
|
+
claude_team_mcp/tools/close_workers.py,sha256=glVUNM5Q32z8DyzvNKpxExN9pDR16rzjuyzEjI-eInM,6633
|
|
21
21
|
claude_team_mcp/tools/discover_workers.py,sha256=PkdnURZBex_y0kFx_pv-EgWrEbtQtsg5TjqycNs7BJI,5437
|
|
22
22
|
claude_team_mcp/tools/examine_worker.py,sha256=7Nd3EOdsGVDjMJ8ov9NhmcrjN8K9IE4i_noXHOP1uI8,1620
|
|
23
23
|
claude_team_mcp/tools/list_workers.py,sha256=6cvsgHOYtakkSgoZdYez4VEQ3I8aWAKaGWhfiZyPf2c,2390
|
|
@@ -30,7 +30,7 @@ claude_team_mcp/utils/__init__.py,sha256=_O-de711DxfMdjCAHHoifyOtzdllciE9FFV-tZ5
|
|
|
30
30
|
claude_team_mcp/utils/constants.py,sha256=gvWbqk1qaymilnAvql28ZiNnvWG4vsz7cYg84mtd6PY,2264
|
|
31
31
|
claude_team_mcp/utils/errors.py,sha256=9uPFHp7UJYB5t3p7P_5Sh3PVpYh4_vj_RLzX5GcJPEU,2738
|
|
32
32
|
claude_team_mcp/utils/worktree_detection.py,sha256=NfEK8c_toFiz8dqF2ht1FJzW9a9VstVm7Y5SNXvwAD8,2564
|
|
33
|
-
claude_team_mcp-0.
|
|
34
|
-
claude_team_mcp-0.
|
|
35
|
-
claude_team_mcp-0.
|
|
36
|
-
claude_team_mcp-0.
|
|
33
|
+
claude_team_mcp-0.3.0.dist-info/METADATA,sha256=KgQ8Jg9OChMe2DDBRQCpWZaakqTPvLxVFVvlHJko9k0,14438
|
|
34
|
+
claude_team_mcp-0.3.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
35
|
+
claude_team_mcp-0.3.0.dist-info/entry_points.txt,sha256=cmk5dmK50RVquExT-k_J72akl3qKIerPpVqfit7kQtQ,53
|
|
36
|
+
claude_team_mcp-0.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|