better-caprover-mcp 0.0.0-stage → 0.1.0

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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +105 -2
  3. package/dist/main.js +42700 -0
  4. package/package.json +80 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Guilherme Mota
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.
package/README.md CHANGED
@@ -1,3 +1,106 @@
1
- # Temporary Holding Version
1
+ # better-caprover-mcp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ An MCP server for [CapRover](https://caprover.com), run with `npx` or Docker. **Unofficial: not affiliated with CapRover and unrelated to the [`caprover-mcp`](https://github.com/ivan-saorin/caprover-mcp) project.**
4
+
5
+ It lets an agent (Claude, Cursor, Codex) operate a CapRover server, with setup in one command and safety by default: the server starts in `readonly` mode.
6
+
7
+ ## Status
8
+
9
+ The `tools` surface works: 14 named operations that read apps, deploy images, change settings and delete apps, with access modes and a confirmation step for deletes. They are tested against a real CapRover. Planned, in order: the rest of the CapRover API (the SDK has 74 methods; `src/Adapters/CapRover/sdk-coverage.json` says which are still open), diagnostics, and Code Mode (`search` and `execute`). The decisions are in [`docs/adr/`](docs/adr/) and the rules the operations follow are in [`docs/mcp-standards.md`](docs/mcp-standards.md).
10
+
11
+ ## Run it
12
+
13
+ You need the address of your CapRover (`https://captain.your-domain.com`) and its password. `npx -y better-caprover-mcp init` prints the client configuration below and tests the login when `CAPROVER_URL` and `CAPROVER_PASSWORD` are set.
14
+
15
+ With `npx`, in the client configuration (Claude Desktop and Cursor use this format; in Claude Code, `claude mcp add caprover -e CAPROVER_URL=https://captain.your-domain.com -e CAPROVER_PASSWORD=... -- npx -y better-caprover-mcp`):
16
+
17
+ ```json
18
+ {
19
+ "mcpServers": {
20
+ "caprover": {
21
+ "command": "npx",
22
+ "args": ["-y", "better-caprover-mcp"],
23
+ "env": {
24
+ "CAPROVER_URL": "https://captain.your-domain.com",
25
+ "CAPROVER_PASSWORD": "your CapRover password",
26
+ "CAPROVER_MCP_MODE": "readonly"
27
+ }
28
+ }
29
+ }
30
+ }
31
+ ```
32
+
33
+ With Docker (`-i` is required: the server talks over stdin and stdout):
34
+
35
+ ```json
36
+ {
37
+ "mcpServers": {
38
+ "caprover": {
39
+ "command": "docker",
40
+ "args": ["run", "-i", "--rm", "-e", "CAPROVER_URL", "-e", "CAPROVER_PASSWORD", "-e", "CAPROVER_MCP_MODE", "ghcr.io/guilhermebkel/better-caprover-mcp:latest"],
41
+ "env": {
42
+ "CAPROVER_URL": "https://captain.your-domain.com",
43
+ "CAPROVER_PASSWORD": "your CapRover password",
44
+ "CAPROVER_MCP_MODE": "readonly"
45
+ }
46
+ }
47
+ }
48
+ }
49
+ ```
50
+
51
+ The package and the image are not published yet; until then, build them from this repository (below).
52
+
53
+ | Variable | Default | Meaning |
54
+ | --- | --- | --- |
55
+ | `CAPROVER_URL` | none | The address of your CapRover, with `http://` or `https://`. Only its origin is used |
56
+ | `CAPROVER_PASSWORD` | none | The CapRover password. CapRover has no user name |
57
+ | `CAPROVER_MCP_MODE` | `readonly` | `readonly`, `operate` or `admin`: how much the server may do |
58
+ | `CAPROVER_MCP_ALLOW_CRITICAL` | off | Set to `1` to unlock critical operations in `admin` mode. No operation is critical yet |
59
+
60
+ Without `CAPROVER_URL` and `CAPROVER_PASSWORD` the server still starts, and every call tells the model what is missing. The CapRover password gives full access, so the modes are enforced by this server, not by CapRover. Servers with CapRover's two-factor login turned on are not supported (`docs/adr/0010-the-server-logs-in-with-the-password-only.md`).
61
+
62
+ ## Access modes
63
+
64
+ The mode decides which operations the client sees at all. Only the person can change it, by restarting the server with another `CAPROVER_MCP_MODE`.
65
+
66
+ | Mode | Operations available |
67
+ | --- | --- |
68
+ | `readonly` (default) | The 7 read operations |
69
+ | `operate` | Read, plus the 6 that change an app |
70
+ | `admin` | Read, change, plus `delete_app` |
71
+
72
+ ## Operations
73
+
74
+ | Operation | Tier | What it does |
75
+ | --- | --- | --- |
76
+ | `get_overview` | read | CapRover version, domain, app count, and what this server may do |
77
+ | `list_apps`, `get_app` | read | Find apps; read one app (env var values are never returned, only `isSet`) |
78
+ | `get_app_runtime` | read | Live state of an app. Needs a CapRover version that has the endpoint (1.15.5 has none) |
79
+ | `get_app_logs`, `get_build_logs` | read | The last lines of the running app or of the latest build, with secrets replaced by `[REDACTED]` |
80
+ | `list_one_click_apps` | read | The one-click templates CapRover offers |
81
+ | `create_app` | write | Make an empty app |
82
+ | `deploy_image` | write | Deploy a Docker image to an app; the deploy goes on in the background |
83
+ | `set_env_vars` | write | Set and delete env vars from `KEY=value` lines; keeps the others |
84
+ | `scale_app` | write | Set the number of instances (0 stops the app) |
85
+ | `add_custom_domain`, `enable_ssl` | write | Attach a domain; turn on HTTPS |
86
+ | `delete_app` | destructive | Delete an app, and its volumes only if asked |
87
+
88
+ Every write takes `dry_run` and returns what it would change without writing. `delete_app` changes nothing on its first call: it returns a preview and a `confirmation_token` tied to that exact call. It runs only when called again with `user_confirmed` and the token, once, within 5 minutes. This makes the model show the person what will be lost; it does not stop a manipulated model, so the real barrier is the mode.
89
+
90
+ ## Development
91
+
92
+ Needs the Node version in `.nvmrc` and pnpm.
93
+
94
+ ```bash
95
+ nvm use
96
+ pnpm install
97
+ pnpm check # typecheck, lint, dead code, duplication, SDK drift, tests, build and a smoke run of the bundle
98
+ ```
99
+
100
+ `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`.
101
+
102
+ `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.
103
+
104
+ ## License
105
+
106
+ MIT. See [LICENSE](LICENSE).