moonbridge 0.2.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.
@@ -0,0 +1,15 @@
1
+ # Moonbridge MCP Server Configuration
2
+ # Copy to .env and modify as needed
3
+
4
+ # Default timeout for agent execution (30-3600 seconds)
5
+ # MOONBRIDGE_TIMEOUT=600
6
+
7
+ # Maximum number of parallel agents
8
+ # MOONBRIDGE_MAX_AGENTS=10
9
+
10
+ # Colon-separated allowlist of working directories
11
+ # Leave unset to allow all directories
12
+ # MOONBRIDGE_ALLOWED_DIRS=/path/to/project:/another/path
13
+
14
+ # Log level (DEBUG, INFO, WARNING, ERROR)
15
+ # MOONBRIDGE_LOG_LEVEL=WARNING
@@ -0,0 +1,29 @@
1
+ name: publish
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: write # needed for creating releases
9
+ id-token: write
10
+
11
+ jobs:
12
+ publish:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - uses: actions/setup-python@v5
17
+ with:
18
+ python-version: "3.11"
19
+ - name: Build
20
+ run: |
21
+ python -m pip install --upgrade pip
22
+ pip install build
23
+ python -m build
24
+ - name: Publish
25
+ uses: pypa/gh-action-pypi-publish@release/v1
26
+ - name: Create GitHub Release
27
+ uses: softprops/action-gh-release@v2
28
+ with:
29
+ generate_release_notes: true
@@ -0,0 +1,22 @@
1
+ name: release-please
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+
8
+ permissions:
9
+ contents: write
10
+ pull-requests: write
11
+
12
+ jobs:
13
+ release-please:
14
+ runs-on: ubuntu-latest
15
+ outputs:
16
+ release_created: ${{ steps.release.outputs.release_created }}
17
+ tag_name: ${{ steps.release.outputs.tag_name }}
18
+ steps:
19
+ - uses: googleapis/release-please-action@v4
20
+ id: release
21
+ with:
22
+ token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,27 @@
1
+ name: tests
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ test:
9
+ runs-on: ubuntu-latest
10
+ strategy:
11
+ matrix:
12
+ python-version: ["3.11", "3.12", "3.13"]
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: actions/setup-python@v5
16
+ with:
17
+ python-version: ${{ matrix.python-version }}
18
+ - name: Install deps
19
+ run: |
20
+ python -m pip install --upgrade pip
21
+ pip install -e ".[dev]"
22
+ - name: Ruff
23
+ run: ruff check src/
24
+ - name: Mypy
25
+ run: mypy src/
26
+ - name: Pytest
27
+ run: pytest -v
@@ -0,0 +1,10 @@
1
+ __pycache__/
2
+ *.pyc
3
+ .venv/
4
+ dist/
5
+ *.egg-info/
6
+ .mypy_cache/
7
+ .pytest_cache/
8
+ .ruff_cache/
9
+
10
+ thinktank*
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.2.0"
3
+ }
@@ -0,0 +1,32 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.2.0](https://github.com/misty-step/moonbridge/compare/moonbridge-v0.1.0...moonbridge-v0.2.0) (2026-01-28)
9
+
10
+
11
+ ### Features
12
+
13
+ * initial moonbridge MCP server ([3debd32](https://github.com/misty-step/moonbridge/commit/3debd325a1619bbbfe980a258c134665bce36e6d))
14
+
15
+ ## [0.1.0] - 2026-01-28
16
+
17
+ ### Added
18
+ - Initial release
19
+ - `spawn_agent` tool for single Kimi agent execution
20
+ - `spawn_agents_parallel` tool for concurrent agent swarms (up to 10)
21
+ - `check_status` tool for CLI verification
22
+ - Configurable timeouts (30-3600 seconds)
23
+ - Working directory allowlist via `MOONBRIDGE_ALLOWED_DIRS`
24
+ - Structured JSON responses with status, output, stderr, and timing
25
+ - Authentication error detection with actionable messages
26
+ - Process group management for clean termination
27
+ - Extended reasoning mode via `thinking` parameter
28
+
29
+ ### Security
30
+ - Sanitized environment variables passed to subprocesses
31
+ - Symlink-aware path validation to prevent directory traversal
32
+ - Prompt length validation to prevent resource exhaustion
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Phaedrus
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,194 @@
1
+ Metadata-Version: 2.4
2
+ Name: moonbridge
3
+ Version: 0.2.0
4
+ Summary: MCP server for spawning Kimi K2.5 agents
5
+ Project-URL: Homepage, https://github.com/misty-step/moonbridge
6
+ Project-URL: Repository, https://github.com/misty-step/moonbridge
7
+ Project-URL: Issues, https://github.com/misty-step/moonbridge/issues
8
+ Author-email: Phaedrus <hello@mistystep.io>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: agent,ai,claude,kimi,mcp
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Requires-Python: >=3.11
21
+ Requires-Dist: mcp>=1.0.0
22
+ Provides-Extra: dev
23
+ Requires-Dist: mypy>=1.8; extra == 'dev'
24
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
25
+ Requires-Dist: pytest-mock>=3.12; extra == 'dev'
26
+ Requires-Dist: pytest>=8.0; extra == 'dev'
27
+ Requires-Dist: ruff>=0.2; extra == 'dev'
28
+ Description-Content-Type: text/markdown
29
+
30
+ # Moonbridge
31
+
32
+ **Your MCP client just got a team.**
33
+
34
+ Spawn Kimi K2.5 agents from Claude Code, Cursor, or any MCP client. Run 5 approaches in parallel for the cost of one Claude request.
35
+
36
+ ```bash
37
+ uvx moonbridge
38
+ ```
39
+
40
+ ## Quick Start
41
+
42
+ 1. **Install Kimi CLI and authenticate:**
43
+ ```bash
44
+ uv tool install --python 3.13 kimi-cli && kimi login
45
+ ```
46
+
47
+ 2. **Add to MCP config** (`~/.mcp.json`):
48
+ ```json
49
+ {
50
+ "mcpServers": {
51
+ "moonbridge": {
52
+ "type": "stdio",
53
+ "command": "uvx",
54
+ "args": ["moonbridge"]
55
+ }
56
+ }
57
+ }
58
+ ```
59
+
60
+ 3. **Use it.** Your MCP client now has `spawn_agent` and `spawn_agents_parallel` tools.
61
+
62
+ ## When to Use Moonbridge
63
+
64
+ | Task | Why Moonbridge |
65
+ |------|----------------|
66
+ | Parallel exploration | Run 5 approaches simultaneously, pick the best |
67
+ | Frontend/UI work | Kimi excels at visual coding and component design |
68
+ | Tests and documentation | Cost-effective for high-volume tasks |
69
+ | Refactoring | Try multiple strategies in one request |
70
+
71
+ **Best for:** Tasks that benefit from parallel execution or volume.
72
+
73
+ ## Tools
74
+
75
+ | Tool | Use case |
76
+ |------|----------|
77
+ | `spawn_agent` | Single task: "Write tests for auth.ts" |
78
+ | `spawn_agents_parallel` | Go wide: 5 agents, 5 approaches, pick the best |
79
+ | `check_status` | Verify Kimi CLI is installed and authenticated |
80
+
81
+ ### Example: Parallel Exploration
82
+
83
+ ```json
84
+ {
85
+ "agents": [
86
+ {"prompt": "Refactor to React hooks"},
87
+ {"prompt": "Refactor to Zustand"},
88
+ {"prompt": "Refactor to Redux Toolkit"}
89
+ ]
90
+ }
91
+ ```
92
+
93
+ Three approaches. One request. You choose the winner.
94
+
95
+ ### Tool Parameters
96
+
97
+ **`spawn_agent`**
98
+
99
+ | Parameter | Type | Required | Description |
100
+ |-----------|------|----------|-------------|
101
+ | `prompt` | string | Yes | Task description for the agent |
102
+ | `thinking` | boolean | No | Enable reasoning mode (default: false) |
103
+ | `timeout_seconds` | integer | No | Override default timeout (30-3600) |
104
+
105
+ **`spawn_agents_parallel`**
106
+
107
+ | Parameter | Type | Required | Description |
108
+ |-----------|------|----------|-------------|
109
+ | `agents` | array | Yes | List of agent configs (max 5) |
110
+ | `agents[].prompt` | string | Yes | Task for this agent |
111
+ | `agents[].thinking` | boolean | No | Enable reasoning for this agent |
112
+ | `agents[].timeout_seconds` | integer | No | Timeout for this agent |
113
+
114
+ ## Response Format
115
+
116
+ All tools return JSON with these fields:
117
+
118
+ | Field | Type | Description |
119
+ |-------|------|-------------|
120
+ | `status` | string | `success`, `error`, `timeout`, `auth_error`, or `cancelled` |
121
+ | `output` | string | stdout from Kimi agent |
122
+ | `stderr` | string\|null | stderr if any |
123
+ | `returncode` | int | Process exit code (-1 for timeout/error) |
124
+ | `duration_ms` | int | Execution time in milliseconds |
125
+ | `agent_index` | int | Agent index (0 for single, 0-N for parallel) |
126
+ | `message` | string? | Human-readable error context (when applicable) |
127
+
128
+ ## Configuration
129
+
130
+ ### Environment Variables
131
+
132
+ | Variable | Description |
133
+ |----------|-------------|
134
+ | `MOONBRIDGE_TIMEOUT` | Default timeout in seconds (30-3600) |
135
+ | `MOONBRIDGE_MAX_AGENTS` | Maximum parallel agents |
136
+ | `MOONBRIDGE_ALLOWED_DIRS` | Colon-separated allowlist of working directories |
137
+ | `MOONBRIDGE_LOG_LEVEL` | Set to `DEBUG` for verbose logging |
138
+
139
+ ## Troubleshooting
140
+
141
+ ### "Kimi CLI not found"
142
+
143
+ Install the Kimi CLI:
144
+
145
+ ```bash
146
+ uv tool install --python 3.13 kimi-cli
147
+ which kimi
148
+ ```
149
+
150
+ ### "auth_error" responses
151
+
152
+ Authenticate with Kimi:
153
+
154
+ ```bash
155
+ kimi login
156
+ ```
157
+
158
+ ### Timeout errors
159
+
160
+ Increase the timeout for long-running tasks:
161
+
162
+ ```json
163
+ {"prompt": "...", "timeout_seconds": 1800}
164
+ ```
165
+
166
+ Or set a global default:
167
+
168
+ ```bash
169
+ export MOONBRIDGE_TIMEOUT=1800
170
+ ```
171
+
172
+ ### Permission denied on working directory
173
+
174
+ Verify the directory is in your allowlist:
175
+
176
+ ```bash
177
+ export MOONBRIDGE_ALLOWED_DIRS="/path/to/project:/another/path"
178
+ ```
179
+
180
+ ### Debug logging
181
+
182
+ Enable verbose logging:
183
+
184
+ ```bash
185
+ export MOONBRIDGE_LOG_LEVEL=DEBUG
186
+ ```
187
+
188
+ ## Platform Support
189
+
190
+ macOS and Linux only. Windows is not supported.
191
+
192
+ ## License
193
+
194
+ MIT. See `LICENSE`.
@@ -0,0 +1,165 @@
1
+ # Moonbridge
2
+
3
+ **Your MCP client just got a team.**
4
+
5
+ Spawn Kimi K2.5 agents from Claude Code, Cursor, or any MCP client. Run 5 approaches in parallel for the cost of one Claude request.
6
+
7
+ ```bash
8
+ uvx moonbridge
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ 1. **Install Kimi CLI and authenticate:**
14
+ ```bash
15
+ uv tool install --python 3.13 kimi-cli && kimi login
16
+ ```
17
+
18
+ 2. **Add to MCP config** (`~/.mcp.json`):
19
+ ```json
20
+ {
21
+ "mcpServers": {
22
+ "moonbridge": {
23
+ "type": "stdio",
24
+ "command": "uvx",
25
+ "args": ["moonbridge"]
26
+ }
27
+ }
28
+ }
29
+ ```
30
+
31
+ 3. **Use it.** Your MCP client now has `spawn_agent` and `spawn_agents_parallel` tools.
32
+
33
+ ## When to Use Moonbridge
34
+
35
+ | Task | Why Moonbridge |
36
+ |------|----------------|
37
+ | Parallel exploration | Run 5 approaches simultaneously, pick the best |
38
+ | Frontend/UI work | Kimi excels at visual coding and component design |
39
+ | Tests and documentation | Cost-effective for high-volume tasks |
40
+ | Refactoring | Try multiple strategies in one request |
41
+
42
+ **Best for:** Tasks that benefit from parallel execution or volume.
43
+
44
+ ## Tools
45
+
46
+ | Tool | Use case |
47
+ |------|----------|
48
+ | `spawn_agent` | Single task: "Write tests for auth.ts" |
49
+ | `spawn_agents_parallel` | Go wide: 5 agents, 5 approaches, pick the best |
50
+ | `check_status` | Verify Kimi CLI is installed and authenticated |
51
+
52
+ ### Example: Parallel Exploration
53
+
54
+ ```json
55
+ {
56
+ "agents": [
57
+ {"prompt": "Refactor to React hooks"},
58
+ {"prompt": "Refactor to Zustand"},
59
+ {"prompt": "Refactor to Redux Toolkit"}
60
+ ]
61
+ }
62
+ ```
63
+
64
+ Three approaches. One request. You choose the winner.
65
+
66
+ ### Tool Parameters
67
+
68
+ **`spawn_agent`**
69
+
70
+ | Parameter | Type | Required | Description |
71
+ |-----------|------|----------|-------------|
72
+ | `prompt` | string | Yes | Task description for the agent |
73
+ | `thinking` | boolean | No | Enable reasoning mode (default: false) |
74
+ | `timeout_seconds` | integer | No | Override default timeout (30-3600) |
75
+
76
+ **`spawn_agents_parallel`**
77
+
78
+ | Parameter | Type | Required | Description |
79
+ |-----------|------|----------|-------------|
80
+ | `agents` | array | Yes | List of agent configs (max 5) |
81
+ | `agents[].prompt` | string | Yes | Task for this agent |
82
+ | `agents[].thinking` | boolean | No | Enable reasoning for this agent |
83
+ | `agents[].timeout_seconds` | integer | No | Timeout for this agent |
84
+
85
+ ## Response Format
86
+
87
+ All tools return JSON with these fields:
88
+
89
+ | Field | Type | Description |
90
+ |-------|------|-------------|
91
+ | `status` | string | `success`, `error`, `timeout`, `auth_error`, or `cancelled` |
92
+ | `output` | string | stdout from Kimi agent |
93
+ | `stderr` | string\|null | stderr if any |
94
+ | `returncode` | int | Process exit code (-1 for timeout/error) |
95
+ | `duration_ms` | int | Execution time in milliseconds |
96
+ | `agent_index` | int | Agent index (0 for single, 0-N for parallel) |
97
+ | `message` | string? | Human-readable error context (when applicable) |
98
+
99
+ ## Configuration
100
+
101
+ ### Environment Variables
102
+
103
+ | Variable | Description |
104
+ |----------|-------------|
105
+ | `MOONBRIDGE_TIMEOUT` | Default timeout in seconds (30-3600) |
106
+ | `MOONBRIDGE_MAX_AGENTS` | Maximum parallel agents |
107
+ | `MOONBRIDGE_ALLOWED_DIRS` | Colon-separated allowlist of working directories |
108
+ | `MOONBRIDGE_LOG_LEVEL` | Set to `DEBUG` for verbose logging |
109
+
110
+ ## Troubleshooting
111
+
112
+ ### "Kimi CLI not found"
113
+
114
+ Install the Kimi CLI:
115
+
116
+ ```bash
117
+ uv tool install --python 3.13 kimi-cli
118
+ which kimi
119
+ ```
120
+
121
+ ### "auth_error" responses
122
+
123
+ Authenticate with Kimi:
124
+
125
+ ```bash
126
+ kimi login
127
+ ```
128
+
129
+ ### Timeout errors
130
+
131
+ Increase the timeout for long-running tasks:
132
+
133
+ ```json
134
+ {"prompt": "...", "timeout_seconds": 1800}
135
+ ```
136
+
137
+ Or set a global default:
138
+
139
+ ```bash
140
+ export MOONBRIDGE_TIMEOUT=1800
141
+ ```
142
+
143
+ ### Permission denied on working directory
144
+
145
+ Verify the directory is in your allowlist:
146
+
147
+ ```bash
148
+ export MOONBRIDGE_ALLOWED_DIRS="/path/to/project:/another/path"
149
+ ```
150
+
151
+ ### Debug logging
152
+
153
+ Enable verbose logging:
154
+
155
+ ```bash
156
+ export MOONBRIDGE_LOG_LEVEL=DEBUG
157
+ ```
158
+
159
+ ## Platform Support
160
+
161
+ macOS and Linux only. Windows is not supported.
162
+
163
+ ## License
164
+
165
+ MIT. See `LICENSE`.
@@ -0,0 +1,65 @@
1
+ [project]
2
+ name = "moonbridge"
3
+ dynamic = ["version"]
4
+ description = "MCP server for spawning Kimi K2.5 agents"
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ license = "MIT"
8
+ authors = [
9
+ {name = "Phaedrus", email = "hello@mistystep.io"}
10
+ ]
11
+ keywords = ["mcp", "kimi", "claude", "agent", "ai"]
12
+ classifiers = [
13
+ "Development Status :: 4 - Beta",
14
+ "Environment :: Console",
15
+ "Intended Audience :: Developers",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ ]
22
+ dependencies = [
23
+ "mcp>=1.0.0",
24
+ ]
25
+
26
+ [project.optional-dependencies]
27
+ dev = [
28
+ "pytest>=8.0",
29
+ "pytest-asyncio>=0.23",
30
+ "pytest-mock>=3.12",
31
+ "mypy>=1.8",
32
+ "ruff>=0.2",
33
+ ]
34
+
35
+ [project.scripts]
36
+ moonbridge = "moonbridge.server:main"
37
+
38
+ [project.urls]
39
+ Homepage = "https://github.com/misty-step/moonbridge"
40
+ Repository = "https://github.com/misty-step/moonbridge"
41
+ Issues = "https://github.com/misty-step/moonbridge/issues"
42
+
43
+ [build-system]
44
+ requires = ["hatchling"]
45
+ build-backend = "hatchling.build"
46
+
47
+ [tool.pytest.ini_options]
48
+ asyncio_mode = "auto"
49
+ testpaths = ["tests"]
50
+
51
+ [tool.mypy]
52
+ python_version = "3.11"
53
+ strict = true
54
+ # MCP library decorators are not fully typed
55
+ disable_error_code = ["no-untyped-call", "untyped-decorator"]
56
+
57
+ [tool.ruff]
58
+ target-version = "py311"
59
+ line-length = 100
60
+
61
+ [tool.ruff.lint]
62
+ select = ["E", "F", "I", "UP", "B", "SIM"]
63
+
64
+ [tool.hatch.version]
65
+ path = "src/moonbridge/__init__.py"
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3
+ "release-type": "python",
4
+ "packages": {
5
+ ".": {
6
+ "package-name": "moonbridge",
7
+ "extra-files": [
8
+ {
9
+ "type": "generic",
10
+ "path": "src/moonbridge/__init__.py"
11
+ }
12
+ ]
13
+ }
14
+ },
15
+ "changelog-sections": [
16
+ {"type": "feat", "section": "Features"},
17
+ {"type": "fix", "section": "Bug Fixes"},
18
+ {"type": "perf", "section": "Performance"},
19
+ {"type": "docs", "section": "Documentation", "hidden": true},
20
+ {"type": "chore", "section": "Miscellaneous", "hidden": true},
21
+ {"type": "ci", "section": "Miscellaneous", "hidden": true}
22
+ ]
23
+ }
@@ -0,0 +1,9 @@
1
+ """MCP server for spawning Kimi K2.5 agents."""
2
+
3
+ from __future__ import annotations
4
+
5
+ __version__ = "0.2.0"
6
+
7
+ from .server import main, run, server
8
+
9
+ __all__ = ["__version__", "main", "run", "server"]
@@ -0,0 +1 @@
1
+