better-caprover-mcp 0.1.5 → 0.1.6
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.
- package/README.md +36 -60
- package/dist/main.js +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
**Giving an agent the keys to a server is the hard part.** A CapRover password is full access, and a model that can call "delete app" will sooner or later call it when it should not.
|
|
26
26
|
|
|
27
|
-
`better-caprover-mcp` gives the agent
|
|
27
|
+
`better-caprover-mcp` gives the agent all possible CapRover actions over its API and puts the safety in code, not in a prompt. The server starts in `readonly` mode and a mode only goes up when you restart it with another setting. Every change can be previewed with `dry_run`. Deleting does nothing until the person has seen what would be lost and said yes, and the password and the values of your environment variables never come back in a reply.
|
|
28
28
|
|
|
29
29
|
> **The mode is the barrier, not the model's good manners.** In `readonly` the write tools are not even registered, and every call is checked again when it runs.
|
|
30
30
|
|
|
@@ -71,18 +71,9 @@ Env var values are never returned (only `isSet`). The password and the values of
|
|
|
71
71
|
|
|
72
72
|
You need the address of your CapRover (`https://captain.your-domain.com`) and its password. CapRover has no user name, and servers with two-factor login turned on are not supported ([ADR 0010](docs/adr/0010-the-server-logs-in-with-the-password-only.md)).
|
|
73
73
|
|
|
74
|
-
### 1.
|
|
74
|
+
### 1. Coding Agent
|
|
75
75
|
|
|
76
|
-
Claude Code:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
claude mcp add caprover \
|
|
80
|
-
-e CAPROVER_URL=https://captain.your-domain.com \
|
|
81
|
-
-e CAPROVER_PASSWORD=your-password \
|
|
82
|
-
-- npx -y better-caprover-mcp
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Claude Desktop, Cursor and other clients, with `npx`:
|
|
76
|
+
Add this to the MCP servers of your client (Claude Code, Claude Desktop, Cursor, Codex and others):
|
|
86
77
|
|
|
87
78
|
```json
|
|
88
79
|
{
|
|
@@ -100,53 +91,21 @@ Claude Desktop, Cursor and other clients, with `npx`:
|
|
|
100
91
|
}
|
|
101
92
|
```
|
|
102
93
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
```json
|
|
106
|
-
{
|
|
107
|
-
"mcpServers": {
|
|
108
|
-
"caprover": {
|
|
109
|
-
"command": "docker",
|
|
110
|
-
"args": ["run", "-i", "--rm", "-e", "CAPROVER_URL", "-e", "CAPROVER_PASSWORD", "-e", "CAPROVER_MCP_MODE", "ghcr.io/guilhermebkel/better-caprover-mcp:latest"],
|
|
111
|
-
"env": {
|
|
112
|
-
"CAPROVER_URL": "https://captain.your-domain.com",
|
|
113
|
-
"CAPROVER_PASSWORD": "your CapRover password",
|
|
114
|
-
"CAPROVER_MCP_MODE": "readonly"
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### 2. Check the login
|
|
122
|
-
|
|
123
|
-
```bash
|
|
124
|
-
CAPROVER_URL=https://captain.your-domain.com CAPROVER_PASSWORD=... npx -y better-caprover-mcp init
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
`init` tests the login and prints the client configuration above. Without the two variables it only prints the configuration.
|
|
128
|
-
|
|
129
|
-
### 3. Ask
|
|
130
|
-
|
|
131
|
-
```text
|
|
132
|
-
Which of my apps run an image tagged latest?
|
|
133
|
-
Set LOG_LEVEL=debug on the api app, but show me what changes first.
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
To let the agent change apps, set `CAPROVER_MCP_MODE=operate`; for deleting, `admin`.
|
|
137
|
-
|
|
138
|
-
### Run it as a server over HTTP
|
|
94
|
+
### 2. Providing on your own server to any AI
|
|
139
95
|
|
|
140
|
-
|
|
96
|
+
Run the server over HTTP on a machine you control, and point any MCP client at it. Bind to localhost only (`127.0.0.1:3100`), and put TLS in front for anything else.
|
|
141
97
|
|
|
142
98
|
```bash
|
|
143
99
|
docker run -d --name caprover-mcp -p 127.0.0.1:3100:3100 \
|
|
144
100
|
-e CAPROVER_URL=https://captain.your-domain.com \
|
|
145
101
|
-e CAPROVER_PASSWORD='your CapRover password' \
|
|
102
|
+
-e CAPROVER_MCP_MODE=readonly \
|
|
103
|
+
-e CAPROVER_MCP_TRANSPORT=http \
|
|
146
104
|
-e CAPROVER_MCP_HTTP_HOST=0.0.0.0 \
|
|
147
105
|
-e CAPROVER_MCP_HTTP_TOKEN='your-long-random-secret' \
|
|
148
|
-
|
|
149
|
-
|
|
106
|
+
-e CAPROVER_MCP_LOG_LEVEL=info \
|
|
107
|
+
-e CAPROVER_MCP_SURFACE=tools \
|
|
108
|
+
ghcr.io/guilhermebkel/better-caprover-mcp:latest
|
|
150
109
|
```
|
|
151
110
|
|
|
152
111
|
Then point the client at it:
|
|
@@ -166,6 +125,23 @@ Then point the client at it:
|
|
|
166
125
|
|
|
167
126
|
More on HTTP bind and TLS: [`docs/product/remote-http.md`](docs/product/remote-http.md). Limits and other variables: [Configuration](#configuration).
|
|
168
127
|
|
|
128
|
+
### Check the login
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
CAPROVER_URL=https://captain.your-domain.com CAPROVER_PASSWORD=... npx -y better-caprover-mcp init
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
`init` tests the login and prints the client configuration. Without the two variables it only prints the configuration.
|
|
135
|
+
|
|
136
|
+
### Ask
|
|
137
|
+
|
|
138
|
+
```text
|
|
139
|
+
Which of my apps run an image tagged latest?
|
|
140
|
+
Set LOG_LEVEL=debug on the api app, but show me what changes first.
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
To let the agent change apps, set `CAPROVER_MCP_MODE=operate`; for deleting, `admin`.
|
|
144
|
+
|
|
169
145
|
## Example
|
|
170
146
|
|
|
171
147
|
<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>
|
|
@@ -189,16 +165,16 @@ The mode decides which operations the client sees at all. Only the person can ch
|
|
|
189
165
|
|
|
190
166
|
| Mode | Operations available |
|
|
191
167
|
| --- | --- |
|
|
192
|
-
| `readonly` (default) |
|
|
193
|
-
| `operate` | Read, plus
|
|
194
|
-
| `admin` | Read, change, plus
|
|
195
|
-
| `admin` with `CAPROVER_MCP_ALLOW_CRITICAL=1` | All of the above, plus the
|
|
168
|
+
| `readonly` (default) | All possible CapRover actions that only read |
|
|
169
|
+
| `operate` | Read, plus all possible actions that change something and can be changed back |
|
|
170
|
+
| `admin` | Read, change, plus all possible actions that delete (`delete_app`, `remove_custom_domain`, `delete_projects`, `delete_one_click_repo`, `delete_registry`, `delete_theme`) |
|
|
171
|
+
| `admin` with `CAPROVER_MCP_ALLOW_CRITICAL=1` | All of the above, plus all the critical ones |
|
|
196
172
|
|
|
197
173
|
`CAPROVER_MCP_TOOLSETS` then picks which groups of operations are registered. The default is `core,apps,domains,oneclick`; the other toolsets are opt-in so the tool list stays short. Ask `get_access` what is on and why a call was denied.
|
|
198
174
|
|
|
199
175
|
## Operations
|
|
200
176
|
|
|
201
|
-
71 operations in ten toolsets. The tier and toolset of every one, and the SDK method behind it, are in [`docs/product/risk-tiers.md`](docs/product/risk-tiers.md). A changing call takes `dry_run`; a deleting or critical call returns a preview and a `confirmation_token` first, and asks the person through the client when the client supports it.
|
|
177
|
+
The server exposes <!-- operations:count -->71<!-- /operations:count --> operations in ten toolsets. The tier and toolset of every one, and the SDK method behind it, are in [`docs/product/risk-tiers.md`](docs/product/risk-tiers.md). A changing call takes `dry_run`; a deleting or critical call returns a preview and a `confirmation_token` first, and asks the person through the client when the client supports it.
|
|
202
178
|
|
|
203
179
|
| Toolset | Operations |
|
|
204
180
|
| --- | --- |
|
|
@@ -213,7 +189,7 @@ The mode decides which operations the client sees at all. Only the person can ch
|
|
|
213
189
|
| `monitoring` | `get_net_data` (never a token), `set_net_data`, `get_go_access`, `set_go_access`, `list_go_access_reports` |
|
|
214
190
|
| `account` | `get_two_factor_status`, `get_pro_state`, `set_pro_api_key`, `list_pro_alerts`, `list_themes`, `get_current_theme`, `set_current_theme`, `save_theme`, `delete_theme`; critical: `set_password` |
|
|
215
191
|
|
|
216
|
-
|
|
192
|
+
Some SDK methods are kept for later, each with its reason in `scripts/sdk-coverage.json`: `updateConfigAndSave` (the `code` surface), `setProConfigs`, `getGoAccessReport` and `createBackup`. `get_app_runtime` and `list_apps_runtime` need a CapRover version that has the runtime endpoint (1.15.5 has none).
|
|
217
193
|
|
|
218
194
|
## Configuration
|
|
219
195
|
|
|
@@ -298,10 +274,10 @@ The endpoint it uses is missing in older CapRover versions (1.15.5 has none). Th
|
|
|
298
274
|
|
|
299
275
|
## Roadmap
|
|
300
276
|
|
|
301
|
-
- [x] **Core:** the first
|
|
302
|
-
- [x] **The rest of the CapRover API:** [#3](https://github.com/guilhermebkel/better-caprover-mcp/issues/3) —
|
|
277
|
+
- [x] **Core:** the first operations on the `tools` surface, access modes, `dry_run`, confirmation token, redaction, tested against a real CapRover.
|
|
278
|
+
- [x] **The rest of the CapRover API:** [#3](https://github.com/guilhermebkel/better-caprover-mcp/issues/3) — all possible CapRover actions in toolsets; some SDK methods stay planned, with reasons.
|
|
303
279
|
- [x] **Diagnostics** (`diagnose_app`, `find_issues`, `redeploy_app`, `bulk_env_update`): [#4](https://github.com/guilhermebkel/better-caprover-mcp/issues/4)
|
|
304
|
-
- [
|
|
280
|
+
- [x] **Code Mode** (`search` and `execute` in a sandbox) and a benchmark: [#5](https://github.com/guilhermebkel/better-caprover-mcp/issues/5) — the `code` surface and the sandbox are built (`CAPROVER_MCP_SURFACE`); the benchmark that picks the default is still to run
|
|
305
281
|
- [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.
|
|
306
282
|
|
|
307
283
|
## Contributing
|
package/dist/main.js
CHANGED
|
@@ -51013,7 +51013,7 @@ var SharedMcpRuntimeSurface = class _SharedMcpRuntimeSurface {
|
|
|
51013
51013
|
}
|
|
51014
51014
|
buildMcpServer() {
|
|
51015
51015
|
const server = new McpServer(
|
|
51016
|
-
{ name: McpServerMetadataUtil.SERVER_NAME, version: "0.1.
|
|
51016
|
+
{ name: McpServerMetadataUtil.SERVER_NAME, version: "0.1.6" },
|
|
51017
51017
|
{ instructions: McpInstructionsSurface.build(this.parts.policy, this.parts.toolsets) }
|
|
51018
51018
|
);
|
|
51019
51019
|
const isElicitationAvailable = () => server.server.getClientCapabilities()?.elicitation !== void 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-caprover-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "MCP server for CapRover: run it with npx or Docker. Unofficial, not affiliated with CapRover.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Guilherme Mota",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"lint:oxlint": "oxlint --type-aware",
|
|
41
41
|
"lint:eslint": "eslint --cache --cache-strategy content",
|
|
42
42
|
"sdk:drift": "node scripts/sdk-drift.mjs",
|
|
43
|
+
"check:operation-docs": "node scripts/check-operation-docs.mjs",
|
|
43
44
|
"quality": "knip && jscpd && dpdm --no-warning --no-tree --exit-code circular:1 --transform src/**/*.ts",
|
|
44
45
|
"test": "vitest run",
|
|
45
46
|
"test:integration": "vitest run --config vitest.integration.config.mjs",
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
"ensure-deps": "node scripts/ensure-deps.mjs",
|
|
49
50
|
"lint-staged": "lint-staged",
|
|
50
51
|
"check:changed": "node scripts/check-changed.mjs",
|
|
51
|
-
"check": "pnpm ensure-deps && pnpm typecheck && pnpm lint && pnpm quality && pnpm sdk:drift && pnpm test && pnpm build && pnpm check:pack && pnpm check:licenses && pnpm smoke",
|
|
52
|
+
"check": "pnpm ensure-deps && pnpm typecheck && pnpm lint && pnpm quality && pnpm sdk:drift && pnpm check:operation-docs && pnpm test && pnpm build && pnpm check:pack && pnpm check:licenses && pnpm smoke",
|
|
52
53
|
"check:pack": "node scripts/check-pack.mjs",
|
|
53
54
|
"check:licenses": "node scripts/check-licenses.mjs"
|
|
54
55
|
},
|