Commit a4ded22
committed
Mount the sandbox as an MCP server; default to unsandboxed host tools
Pion now has exactly two execution modes:
- off (new default): bash/read/write/edit run directly on the host — no
Docker startup, no warning banner.
- mcp: Pion spawns its own "pion mcp" child and mounts it like any other
MCP server. The default toolset becomes sandbox__bash/read/write/edit
executed in the hardened Docker container; host default tools are not
registered. The parent preflights the Docker daemon (fail-closed) and
forwards sandbox settings via PION_SANDBOX_* env vars.
The new "pion mcp" command serves the full default toolset over stdio
(mcp.server.lowlevel), so any MCP client (Claude Code, Cursor, ...) can
mount pion's sandbox: non-root container, cap-drop ALL, no docker.sock,
read-only .git, secret masking, orphan cleanup.
The integrated in-process Docker backend is removed: SandboxBackend is
now "off" | "mcp" (default "off"), legacy "docker" config values migrate
to "mcp", and --sandbox docker works as a deprecated alias. Docker is no
longer required for a default launch.
Tests: end-to-end stdio tests for the server (tests/test_mcp_server.py),
MCP-backend wiring + preflight tests, config migration, updated default
backend expectations. README (en/zh-CN) rewritten for the two modes with
external-client mounting examples.1 parent 6948686 commit a4ded22
10 files changed
Lines changed: 619 additions & 120 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
137 | 158 | | |
138 | 159 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
144 | 166 | | |
145 | | - | |
| 167 | + | |
146 | 168 | | |
147 | 169 | | |
148 | | - | |
| 170 | + | |
149 | 171 | | |
150 | 172 | | |
151 | 173 | | |
| |||
165 | 187 | | |
166 | 188 | | |
167 | 189 | | |
168 | | - | |
| 190 | + | |
169 | 191 | | |
170 | 192 | | |
171 | 193 | | |
| |||
179 | 201 | | |
180 | 202 | | |
181 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
182 | 208 | | |
183 | 209 | | |
184 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
114 | 115 | | |
115 | | - | |
| 116 | + | |
116 | 117 | | |
117 | | - | |
118 | | - | |
119 | | - | |
| 118 | + | |
| 119 | + | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
122 | 143 | | |
123 | 144 | | |
124 | 145 | | |
125 | 146 | | |
126 | | - | |
| 147 | + | |
127 | 148 | | |
128 | 149 | | |
129 | | - | |
| 150 | + | |
130 | 151 | | |
131 | 152 | | |
132 | 153 | | |
| |||
144 | 165 | | |
145 | 166 | | |
146 | 167 | | |
147 | | - | |
| 168 | + | |
148 | 169 | | |
149 | 170 | | |
150 | 171 | | |
| |||
158 | 179 | | |
159 | 180 | | |
160 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
161 | 185 | | |
162 | 186 | | |
163 | 187 | | |
| |||
0 commit comments