claude-team-mcp 0.2.1__py3-none-any.whl → 0.3.1__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/iterm_utils.py +8 -1
- claude_team_mcp/server.py +76 -14
- {claude_team_mcp-0.2.1.dist-info → claude_team_mcp-0.3.1.dist-info}/METADATA +14 -1
- {claude_team_mcp-0.2.1.dist-info → claude_team_mcp-0.3.1.dist-info}/RECORD +7 -7
- {claude_team_mcp-0.2.1.dist-info → claude_team_mcp-0.3.1.dist-info}/WHEEL +0 -0
- {claude_team_mcp-0.2.1.dist-info → claude_team_mcp-0.3.1.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/iterm_utils.py
CHANGED
|
@@ -6,6 +6,7 @@ from the original primitives.py for use in the MCP server.
|
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
import logging
|
|
9
|
+
import os
|
|
9
10
|
import re
|
|
10
11
|
from typing import TYPE_CHECKING, Optional
|
|
11
12
|
|
|
@@ -515,6 +516,11 @@ async def start_claude_in_session(
|
|
|
515
516
|
atomic command (cd && claude). Waits for shell readiness before sending
|
|
516
517
|
the command, then waits for Claude's startup banner to appear.
|
|
517
518
|
|
|
519
|
+
The command used to launch Claude Code can be overridden by setting
|
|
520
|
+
the CLAUDE_TEAM_COMMAND environment variable (defaults to "claude").
|
|
521
|
+
This is useful for running alternative Claude CLI implementations
|
|
522
|
+
like "happy" or for testing purposes.
|
|
523
|
+
|
|
518
524
|
Args:
|
|
519
525
|
session: iTerm2 session to use
|
|
520
526
|
project_path: Directory to run Claude in
|
|
@@ -537,7 +543,8 @@ async def start_claude_in_session(
|
|
|
537
543
|
)
|
|
538
544
|
|
|
539
545
|
# Build claude command with flags
|
|
540
|
-
|
|
546
|
+
# Allow overriding the claude command via environment variable (e.g., "happy")
|
|
547
|
+
claude_cmd = os.environ.get("CLAUDE_TEAM_COMMAND", "claude")
|
|
541
548
|
if dangerously_skip_permissions:
|
|
542
549
|
claude_cmd += " --dangerously-skip-permissions"
|
|
543
550
|
if stop_hook_marker_id:
|
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()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: claude-team-mcp
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
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
|
|
@@ -140,6 +140,19 @@ Add to your Claude Code MCP settings. You can configure this at:
|
|
|
140
140
|
|
|
141
141
|
After adding the configuration, restart Claude Code for it to take effect.
|
|
142
142
|
|
|
143
|
+
## Environment Variables
|
|
144
|
+
|
|
145
|
+
| Variable | Default | Description |
|
|
146
|
+
|----------|---------|-------------|
|
|
147
|
+
| `CLAUDE_TEAM_COMMAND` | `claude` | Override the command used to start Claude Code in worker sessions. Useful for running alternative CLI implementations like `happy`. |
|
|
148
|
+
| `CLAUDE_TEAM_PROJECT_DIR` | (none) | When set, allows using `"project_path": "auto"` in worker configs to automatically use this path. |
|
|
149
|
+
|
|
150
|
+
Example using an alternative CLI:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
export CLAUDE_TEAM_COMMAND=happy
|
|
154
|
+
```
|
|
155
|
+
|
|
143
156
|
## MCP Tools
|
|
144
157
|
|
|
145
158
|
### Worker Management
|
|
@@ -1,13 +1,13 @@
|
|
|
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
|
|
5
5
|
claude_team_mcp/idle_detection.py,sha256=IX_b46EpK0h8fewdGDHuWXa_abYwnKPSk1oc7a4OnkY,5930
|
|
6
|
-
claude_team_mcp/iterm_utils.py,sha256=
|
|
6
|
+
claude_team_mcp/iterm_utils.py,sha256=4hVpb5USurTDjP4OrPIpPvUs0hLPvLEOyHVltrfqqgQ,32761
|
|
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
|
|
@@ -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.1.dist-info/METADATA,sha256=2RRqJQ6Hh4fY6ChxyDeMHTzeC3HFeA5LGSfK9ghR4dI,14930
|
|
34
|
+
claude_team_mcp-0.3.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
35
|
+
claude_team_mcp-0.3.1.dist-info/entry_points.txt,sha256=cmk5dmK50RVquExT-k_J72akl3qKIerPpVqfit7kQtQ,53
|
|
36
|
+
claude_team_mcp-0.3.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|