better-caprover-mcp 0.1.1 → 0.1.3

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.
Files changed (3) hide show
  1. package/README.md +45 -3
  2. package/dist/main.js +12117 -9128
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -135,6 +135,37 @@ Set LOG_LEVEL=debug on the api app, but show me what changes first.
135
135
 
136
136
  To let the agent change apps, set `CAPROVER_MCP_MODE=operate`; for deleting, `admin`.
137
137
 
138
+ ### Run it as a server over HTTP
139
+
140
+ Use this when the client reaches the server over the network. Bind to localhost only (`127.0.0.1:3100`), and put TLS in front for anything else.
141
+
142
+ ```bash
143
+ docker run -d --name caprover-mcp -p 127.0.0.1:3100:3100 \
144
+ -e CAPROVER_URL=https://captain.your-domain.com \
145
+ -e CAPROVER_PASSWORD='your CapRover password' \
146
+ -e CAPROVER_MCP_HTTP_HOST=0.0.0.0 \
147
+ -e CAPROVER_MCP_HTTP_TOKEN='your-long-random-secret' \
148
+ ghcr.io/guilhermebkel/better-caprover-mcp:latest \
149
+ serve --http
150
+ ```
151
+
152
+ Then point the client at it:
153
+
154
+ ```json
155
+ {
156
+ "mcpServers": {
157
+ "caprover": {
158
+ "url": "http://127.0.0.1:3100/mcp",
159
+ "headers": {
160
+ "Authorization": "Bearer your-long-random-secret"
161
+ }
162
+ }
163
+ }
164
+ }
165
+ ```
166
+
167
+ More on HTTP bind and TLS: [`docs/product/remote-http.md`](docs/product/remote-http.md). Limits and other variables: [Configuration](#configuration).
168
+
138
169
  ## Example
139
170
 
140
171
  <sub>Real output of the built server against a CapRover 1.15.5. The agent asks to delete an app; nothing is deleted yet.</sub>
@@ -186,6 +217,16 @@ The mode decides which operations the client sees at all. Only the person can ch
186
217
  | `CAPROVER_PASSWORD` | none | The CapRover password |
187
218
  | `CAPROVER_MCP_MODE` | `readonly` | `readonly`, `operate` or `admin` |
188
219
  | `CAPROVER_MCP_ALLOW_CRITICAL` | off | Set to `1` to unlock critical operations in `admin` mode. No operation is critical yet |
220
+ | `CAPROVER_MCP_LOG_LEVEL` | `info` | `error`, `info` or `debug`. `info` logs the start (transport, mode, what is set); `debug` also logs the configuration (CapRover address, HTTP host and port, whether a token is set). Never the password or the token. Audit lines are always written |
221
+ | `CAPROVER_MCP_TRANSPORT` | `stdio` | `stdio` or `http`. `http` makes a plain start (no arguments) serve Streamable HTTP, same as `serve --http` |
222
+ | `CAPROVER_MCP_HTTP_TOKEN` | none | Bearer secret for `serve --http` (minimum 8 characters); required for non-local HTTP bind |
223
+ | `CAPROVER_MCP_HTTP_HOST` | `127.0.0.1` | Address for `serve --http` |
224
+ | `CAPROVER_MCP_HTTP_PORT` | `3100` | Port for `serve --http` |
225
+ | `CAPROVER_MCP_MAX_HTTP_BODY_BYTES` | `1048576` | Max POST body size on `/mcp` |
226
+ | `CAPROVER_MCP_MAX_HTTP_REQUESTS_PER_MINUTE` | `120` | Max MCP HTTP requests per minute, counted in two buckets: failed auth and authenticated traffic. Each bucket is shared by every caller. |
227
+ | `CAPROVER_MCP_MAX_HTTP_SESSIONS` | `64` | Max concurrent Streamable HTTP MCP sessions |
228
+ | `CAPROVER_MCP_HTTP_SESSION_TTL_MS` | `86400000` | Idle lifetime of an HTTP MCP session (ms); each request renews it |
229
+ | `CAPROVER_MCP_MAX_CONCURRENT` | `5` | Max parallel tool runs in this MCP instance |
189
230
 
190
231
  Without `CAPROVER_URL` and `CAPROVER_PASSWORD` the server still starts, and every call tells the model what is missing.
191
232
 
@@ -204,6 +245,7 @@ The work is split on purpose:
204
245
  | --- | --- | --- |
205
246
  | **Operations** (`src/Operations/`) | One class per thing a person does, with its schema, risk tier and description | One manifest feeds every surface and the policy |
206
247
  | **Policy and runner** (`src/Services/`) | Applies the mode, `dry_run`, the confirmation token and the masking | Rules that cannot fail live in code with a test, never only in a prompt |
248
+ | **Entry points** (`src/Setup/`) | Start the program: arguments, transport, `init` | They only call the builders; no operation, policy or adapter logic |
207
249
  | **CapRover adapter** (`src/Adapters/CapRover/`) | The only place that imports the official `caprover-api` SDK | The SDK is experimental; one folder absorbs its changes |
208
250
 
209
251
  Decisions are in [`docs/adr/`](docs/adr/), the rules operations follow in [`docs/mcp-standards.md`](docs/mcp-standards.md).
@@ -228,7 +270,7 @@ Found a way around any of this? Open an issue without secrets in it.
228
270
  <details>
229
271
  <summary><b>Does it work with CapRover's two-factor login?</b></summary>
230
272
 
231
- No. The code lasts 30 seconds and a client starts this server again every session, so it cannot be kept in an environment variable. The server logs in with the password only ([ADR 0010](docs/adr/0010-the-server-logs-in-with-the-password-only.md)).
273
+ No. The code lasts 30 seconds. Over stdio, a client restarts the server each session; over HTTP the process is long-lived, but the server still has no way to obtain a fresh code, so it cannot be kept in an environment variable. The server logs in with the password only ([ADR 0010](docs/adr/0010-the-server-logs-in-with-the-password-only.md)).
232
274
 
233
275
  </details>
234
276
 
@@ -252,7 +294,7 @@ The endpoint it uses is missing in older CapRover versions (1.15.5 has none). Th
252
294
  - [ ] **The rest of the CapRover API** (about 56 more SDK methods): [#3](https://github.com/guilhermebkel/better-caprover-mcp/issues/3)
253
295
  - [ ] **Diagnostics** (`diagnose_app`, `find_issues`): [#4](https://github.com/guilhermebkel/better-caprover-mcp/issues/4)
254
296
  - [ ] **Code Mode** (`search` and `execute` in a sandbox) and a benchmark: [#5](https://github.com/guilhermebkel/better-caprover-mcp/issues/5)
255
- - [ ] **Remote HTTP and several CapRover servers:** [#6](https://github.com/guilhermebkel/better-caprover-mcp/issues/6)
297
+ - [x] **Remote HTTP (one CapRover server per MCP instance):** [#6](https://github.com/guilhermebkel/better-caprover-mcp/issues/6) — multi-server in one process is out of scope; run one instance per Captain.
256
298
 
257
299
  ## Contributing
258
300
 
@@ -268,7 +310,7 @@ pnpm install
268
310
  pnpm check # typecheck, lint, dead code, duplication, SDK drift, tests, build and a smoke run of the bundle
269
311
  ```
270
312
 
271
- `pnpm test:integration` runs the tests that need a real CapRover (CI starts one; locally, `scripts/start-caprover.sh` starts a throwaway CapRover in Docker with its default password and waits until it is ready; or set `CAPROVER_TEST_URL` and `CAPROVER_TEST_PASSWORD` to use your own), and needs `pnpm build` first. A second run reuses the CapRover that is installed, so it is fast. To remove it: `docker swarm leave --force` and `docker rm -f captain-install`. `pnpm sdk:drift` fails when the CapRover SDK has a method that is not classified in `src/Adapters/CapRover/sdk-coverage.json`.
313
+ `pnpm test:integration` runs the tests that need a real CapRover (CI starts one; locally, `scripts/start-caprover.sh` starts a throwaway CapRover in Docker with its default password and waits until it is ready; or set `CAPROVER_TEST_URL` and `CAPROVER_TEST_PASSWORD` to use your own), and needs `pnpm build` first. A second run reuses the CapRover that is installed, so it is fast. To remove it: `docker swarm leave --force` and `docker rm -f captain-install`. `pnpm sdk:drift` fails when the CapRover SDK has a method that is not classified in `scripts/sdk-coverage.json`.
272
314
 
273
315
  `pnpm smoke -- docker run -i --rm <image>` runs the same smoke test against an image. Read `AGENTS.md` first: it says what to read for each kind of task.
274
316