ecp-mcp-server 0.2.0 → 0.4.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.
- package/.env.sample +4 -3
- package/CHANGELOG.md +29 -0
- package/README.md +20 -5
- package/dist/config.js +73 -0
- package/dist/ecp-client.js +22 -9
- package/dist/index.js +22 -15
- package/dist/tools/apps.js +1 -1
- package/dist/tools/asdf.js +10 -0
- package/dist/tools/domains.js +2 -2
- package/dist/tools/files.js +21 -5
- package/dist/tools/resource-monitor.js +6 -0
- package/dist/tools/system.js +2 -2
- package/package.json +1 -1
package/.env.sample
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
ECP_API_BASE_URL
|
|
1
|
+
# Your ECP address. Any of these work: example.com, the panel address
|
|
2
|
+
# https://example.com:2323, or the API URL https://example.com:2324/api.
|
|
3
|
+
# (ECP_API_BASE_URL is the older name and still works.)
|
|
4
|
+
ECP_URL=
|
|
4
5
|
|
|
5
6
|
# The hosting account this MCP server logs in as. One server = one account.
|
|
6
7
|
ECP_ACCOUNT_USERNAME=
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0 — 2026-11-21
|
|
4
|
+
|
|
5
|
+
Ships with the ECP plugin for Claude (`plugin/`), which bundles this server.
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- `ECP_URL`: your ECP address in any form people actually have it - `example.com`, the panel address `https://example.com:2323`, or the API URL. `ECP_API_BASE_URL` still works.
|
|
9
|
+
- `ecp_asdf_recommend`: picks a runtime version for an app that doesn't pin one exactly (newest LTS within its declared constraints).
|
|
10
|
+
- `ecp_files_compress` takes an optional `format` (zip, tar, tar.gz, tar.bz2, tar.xz). Older ECP ignores it and makes a zip.
|
|
11
|
+
- `ecp_files_change_permission` takes `recursive`. `false` changes only the folder itself, not its contents. Omitting it keeps the old behaviour (the folder and everything inside). Needs the ECP release after 2.0.6; older ECP ignores `false`.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
- Missing or invalid settings no longer stop the server at launch. It starts, and every tool replies with what's missing and where to set it, so the chat app shows a useful message instead of a failed server.
|
|
15
|
+
- Login errors say what went wrong in plain words: wrong username/password, or the ECP address can't be reached (with the cause).
|
|
16
|
+
- `ecp_system_update` is described as what it actually does: apply an ECP update by rebuilding the account's container (sites restart; files and databases kept). It never changed a password. `ecp_password` is now optional, as ECP doesn't use it.
|
|
17
|
+
|
|
18
|
+
## 0.3.0 — 2026-10-26
|
|
19
|
+
|
|
20
|
+
Matches ECP 2.0.5 / EHM 2.0.8.
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
- `ecp_resource_bandwidth_usage`: the account's bandwidth use for the current billing cycle and recent cycles. Needs ECP 2.0.5+ on EHM 2.0.8+.
|
|
24
|
+
- `ecp_files_upload_limit`: the largest upload ECP accepts (also the size cap for SQL imports). Needs ECP 2.0.5+.
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
- `ecp_domains_add_domain` no longer takes `dns_server` (ECP dropped it).
|
|
28
|
+
- `ecp_domains_list_additional` says it includes subdomains, which it always did.
|
|
29
|
+
- `ecp_files_write` notes ECP 2.0.5's 32 MB cap on non-upload requests.
|
|
30
|
+
- The `ecp_apps_git_*` tools need ECP 2.0.5+ (was "the release after 2.0.4").
|
|
31
|
+
|
|
3
32
|
## 0.2.0 — 2026-10-22
|
|
4
33
|
|
|
5
34
|
### Added
|
package/README.md
CHANGED
|
@@ -17,18 +17,31 @@ It talks to ECP's own API (the same one ECP's web UI uses) as the hosting accoun
|
|
|
17
17
|
- **asdf** — language runtime version management
|
|
18
18
|
- **Git integrations** — connect GitHub/GitLab/Bitbucket, browse repos, manage per-app deploy webhooks
|
|
19
19
|
- **Managed WordPress** — full install, status/event history, cache mode and purge, security status, XML-RPC toggle, admin password reset, one-time wp-admin login
|
|
20
|
-
- **Resource monitoring / notifications**
|
|
20
|
+
- **Resource monitoring / notifications** — resource status, current-cycle bandwidth use
|
|
21
21
|
- **storage.bd** — backup config and job status
|
|
22
22
|
- **cPanel import** — discover and import sites from a cPanel server over SSH
|
|
23
23
|
- **Shell** — run a command in the account's container and get its exit code and output, with your approval for every command (see Security notes)
|
|
24
24
|
|
|
25
25
|
**What it deliberately does *not* do:** start a local file backup or restore. Those need a live browser connection for progress; use ECP's own web UI.
|
|
26
26
|
|
|
27
|
+
## Easiest: the ECP plugin for Claude
|
|
28
|
+
|
|
29
|
+
For people who just want to run their hosting from chat, without editing config files: install the **ECP plugin**, which bundles this server with step-by-step guides for websites, domains, HTTPS, databases, files and troubleshooting. In Claude Code:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
/plugin marketplace add EpicLabs23/ecp-mcp-server
|
|
33
|
+
/plugin install ecp@epiclabs23
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
It asks for your ECP panel address, username and password (the password goes to your system's secure storage). See [`plugin/README.md`](./plugin/README.md).
|
|
37
|
+
|
|
38
|
+
The rest of this page is for using the server directly with any MCP client.
|
|
39
|
+
|
|
27
40
|
## Requirements
|
|
28
41
|
|
|
29
42
|
- Node.js 18+
|
|
30
43
|
- An ECP hosting account (username + password)
|
|
31
|
-
- Some tools need a recent ECP: `ecp_shell_exec` and cPanel import need ECP 2.0.3+, DNS claim needs 2.0.4+, and the `ecp_apps_git_*` tools need
|
|
44
|
+
- Some tools need a recent ECP: `ecp_shell_exec` and cPanel import need ECP 2.0.3+, DNS claim needs 2.0.4+, and the `ecp_apps_git_*` tools, `ecp_files_upload_limit` and `ecp_resource_bandwidth_usage` need 2.0.5+ (bandwidth also needs EHM 2.0.8+). On an older ECP these tools return a 404 error.
|
|
32
45
|
- For `ecp_shell_exec`: an MCP client that supports elicitation (form mode)
|
|
33
46
|
|
|
34
47
|
## Install
|
|
@@ -51,7 +64,7 @@ This server is configured entirely through environment variables — no config f
|
|
|
51
64
|
|
|
52
65
|
| Variable | Required | Description |
|
|
53
66
|
|---|---|---|
|
|
54
|
-
| `
|
|
67
|
+
| `ECP_URL` | yes | Your ECP address: `yourdomain.com`, the panel address `https://yourdomain.com:2323`, or the API URL `https://yourdomain.com:2324/api` all work. (`ECP_API_BASE_URL` is the older name and still works.) |
|
|
55
68
|
| `ECP_ACCOUNT_USERNAME` | yes | The hosting account to log in as. One server instance manages one account. |
|
|
56
69
|
| `ECP_ACCOUNT_PASSWORD` | yes | That account's password. |
|
|
57
70
|
| `ECP_REMEMBER` | no | `true` for a 30-day session instead of 24h. |
|
|
@@ -64,7 +77,7 @@ This server is configured entirely through environment variables — no config f
|
|
|
64
77
|
```bash
|
|
65
78
|
claude mcp add ecp-mcp-server \
|
|
66
79
|
--scope user \
|
|
67
|
-
-e
|
|
80
|
+
-e ECP_URL=https://yourdomain.com:2323 \
|
|
68
81
|
-e ECP_ACCOUNT_USERNAME=youraccount \
|
|
69
82
|
-e ECP_ACCOUNT_PASSWORD=yourpassword \
|
|
70
83
|
-- npx ecp-mcp-server
|
|
@@ -83,7 +96,7 @@ Add to your `claude_desktop_config.json`:
|
|
|
83
96
|
"command": "npx",
|
|
84
97
|
"args": ["ecp-mcp-server"],
|
|
85
98
|
"env": {
|
|
86
|
-
"
|
|
99
|
+
"ECP_URL": "https://yourdomain.com:2323",
|
|
87
100
|
"ECP_ACCOUNT_USERNAME": "youraccount",
|
|
88
101
|
"ECP_ACCOUNT_PASSWORD": "yourpassword"
|
|
89
102
|
}
|
|
@@ -117,6 +130,8 @@ npm run build
|
|
|
117
130
|
npm run inspect # opens the MCP Inspector to test tools manually
|
|
118
131
|
```
|
|
119
132
|
|
|
133
|
+
Releasing the server and the plugin: see [`docs/RELEASE.md`](./docs/RELEASE.md).
|
|
134
|
+
|
|
120
135
|
## License
|
|
121
136
|
|
|
122
137
|
MIT
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Turns whatever the user typed as their ECP address into ecp-go's API base
|
|
2
|
+
// URL. People know the panel they log into (https://example.com:2323), not
|
|
3
|
+
// the API behind it, so all of these work:
|
|
4
|
+
// example.com
|
|
5
|
+
// https://example.com:2323 (the panel itself)
|
|
6
|
+
// https://example.com:2323/dashboard (a copied panel link)
|
|
7
|
+
// https://example.com:2324/api (the API, as older configs had it)
|
|
8
|
+
// ecp-go always serves the panel on 2323 and the API on 2324 of the same host.
|
|
9
|
+
export function normalizeApiBaseUrl(input) {
|
|
10
|
+
let raw = input.trim();
|
|
11
|
+
if (!/^[a-z][a-z0-9+.-]*:\/\//i.test(raw))
|
|
12
|
+
raw = `https://${raw}`;
|
|
13
|
+
let url;
|
|
14
|
+
try {
|
|
15
|
+
url = new URL(raw);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
throw new Error(`"${input}" isn't a web address. Use your ECP panel address, e.g. https://example.com:2323`);
|
|
19
|
+
}
|
|
20
|
+
if (url.protocol !== "https:" && url.protocol !== "http:") {
|
|
21
|
+
throw new Error(`"${input}" isn't a web address. Use your ECP panel address, e.g. https://example.com:2323`);
|
|
22
|
+
}
|
|
23
|
+
// An explicit API URL on a non-standard port is kept as given (a proxied
|
|
24
|
+
// or dev setup); everything else is mapped to <host>:2324/api.
|
|
25
|
+
const path = url.pathname.replace(/\/+$/, "");
|
|
26
|
+
if (/\/api$/.test(path) && url.port !== "2323") {
|
|
27
|
+
return `${url.origin}${path}`;
|
|
28
|
+
}
|
|
29
|
+
return `${url.protocol}//${url.hostname}:2324/api`;
|
|
30
|
+
}
|
|
31
|
+
/** The panel URL to send users to for anything this server can't do. */
|
|
32
|
+
export function panelUrlFromApiBase(apiBaseUrl) {
|
|
33
|
+
return apiBaseUrl.replace(/:2324\/api\/?$/, ":2323");
|
|
34
|
+
}
|
|
35
|
+
const read = (name) => process.env[name]?.trim() ?? "";
|
|
36
|
+
// ECP_URL is the friendly name; ECP_API_BASE_URL is kept for existing setups.
|
|
37
|
+
// Unexpanded "${...}" placeholders (a plugin option that was never filled in)
|
|
38
|
+
// count as empty.
|
|
39
|
+
const value = (name) => {
|
|
40
|
+
const v = read(name);
|
|
41
|
+
return /^\$\{[^}]*\}$/.test(v) ? "" : v;
|
|
42
|
+
};
|
|
43
|
+
export function loadConfig() {
|
|
44
|
+
const address = value("ECP_URL") || value("ECP_API_BASE_URL");
|
|
45
|
+
const username = value("ECP_ACCOUNT_USERNAME");
|
|
46
|
+
const password = value("ECP_ACCOUNT_PASSWORD");
|
|
47
|
+
let apiBaseUrl;
|
|
48
|
+
if (address) {
|
|
49
|
+
try {
|
|
50
|
+
apiBaseUrl = normalizeApiBaseUrl(address);
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
return { ok: false, problem: err.message };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const missing = [
|
|
57
|
+
!address && "your ECP panel address",
|
|
58
|
+
!username && "your ECP username",
|
|
59
|
+
!password && "your ECP password",
|
|
60
|
+
].filter(Boolean);
|
|
61
|
+
if (missing.length > 0 || !apiBaseUrl) {
|
|
62
|
+
return { ok: false, problem: `ECP isn't set up yet: missing ${missing.join(", ")}.`, apiBaseUrl };
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
ok: true,
|
|
66
|
+
config: {
|
|
67
|
+
apiBaseUrl,
|
|
68
|
+
username,
|
|
69
|
+
password,
|
|
70
|
+
remember: value("ECP_REMEMBER").toLowerCase() === "true",
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
package/dist/ecp-client.js
CHANGED
|
@@ -61,17 +61,30 @@ export class EcpClient {
|
|
|
61
61
|
this.accessTokenExpiresAt = exp ? exp - 60_000 : Date.now() + 10 * 60_000;
|
|
62
62
|
}
|
|
63
63
|
async login() {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
64
|
+
let res;
|
|
65
|
+
try {
|
|
66
|
+
res = await fetch(`${this.baseUrl}/auth/login`, {
|
|
67
|
+
method: "POST",
|
|
68
|
+
headers: { "content-type": "application/json" },
|
|
69
|
+
body: JSON.stringify({
|
|
70
|
+
username: this.username,
|
|
71
|
+
password: this.password,
|
|
72
|
+
remember: this.remember,
|
|
73
|
+
}),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
// fetch only throws for transport problems (DNS, refused, TLS), and its
|
|
78
|
+
// own message is just "fetch failed" - name the address and the cause.
|
|
79
|
+
const cause = err.cause;
|
|
80
|
+
const detail = cause?.code ?? cause?.message ?? err.message;
|
|
81
|
+
throw new Error(`Couldn't reach ECP at ${this.baseUrl} (${detail}). Check the panel address in the settings and that the server is online.`);
|
|
82
|
+
}
|
|
73
83
|
if (!res.ok) {
|
|
74
84
|
const text = await res.text().catch(() => "");
|
|
85
|
+
if (res.status === 400 || res.status === 401 || res.status === 403) {
|
|
86
|
+
throw new Error(`ECP didn't accept the username or password (${res.status}). Check them in the settings - they're the same ones you use to log into the ECP panel. ${text}`.trim());
|
|
87
|
+
}
|
|
75
88
|
throw new Error(`ECP login failed (${res.status}): ${text}`);
|
|
76
89
|
}
|
|
77
90
|
this.captureRefreshCookie(res);
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import "dotenv/config";
|
|
|
3
3
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
4
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
5
|
import { EcpClient } from "./ecp-client.js";
|
|
6
|
+
import { loadConfig, panelUrlFromApiBase } from "./config.js";
|
|
6
7
|
import { auditLog } from "./audit-log.js";
|
|
7
8
|
import { accountTools } from "./tools/account.js";
|
|
8
9
|
import { appsTools } from "./tools/apps.js";
|
|
@@ -28,29 +29,33 @@ if ((process.env.ECP_TLS_INSECURE ?? "false").toLowerCase() === "true") {
|
|
|
28
29
|
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
|
|
29
30
|
console.error("[ecp-mcp-server] WARNING: ECP_TLS_INSECURE=true - TLS certificate verification is disabled for this process.");
|
|
30
31
|
}
|
|
31
|
-
function requireEnv(name) {
|
|
32
|
-
const value = process.env[name]?.trim();
|
|
33
|
-
if (!value) {
|
|
34
|
-
throw new Error(`Missing required env var ${name} (see .env.sample)`);
|
|
35
|
-
}
|
|
36
|
-
return value;
|
|
37
|
-
}
|
|
38
32
|
// Same relative path from src/ (tsx) and dist/ (built), and package.json
|
|
39
33
|
// always ships in the npm tarball - keeps the handshake version in step with
|
|
40
34
|
// the published one.
|
|
41
35
|
const { version } = createRequire(import.meta.url)("../package.json");
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
// A missing or bad setting doesn't stop the server: it still starts, and every
|
|
37
|
+
// tool answers with what's wrong. In a chat client a server that exits at
|
|
38
|
+
// launch just shows up as "failed", which tells a non-technical user nothing.
|
|
39
|
+
const configResult = loadConfig();
|
|
40
|
+
const client = configResult.ok
|
|
41
|
+
? new EcpClient({
|
|
42
|
+
baseUrl: configResult.config.apiBaseUrl,
|
|
43
|
+
username: configResult.config.username,
|
|
44
|
+
password: configResult.config.password,
|
|
45
|
+
remember: configResult.config.remember,
|
|
46
|
+
})
|
|
47
|
+
: null;
|
|
48
|
+
const setupProblem = configResult.ok
|
|
49
|
+
? null
|
|
50
|
+
: `${configResult.problem} Add the missing details in this MCP server's settings (in the ECP plugin: its options; otherwise the ECP_URL, ECP_ACCOUNT_USERNAME and ECP_ACCOUNT_PASSWORD environment variables), then restart the chat app.`;
|
|
51
|
+
if (setupProblem)
|
|
52
|
+
console.error(`[ecp-mcp-server] ${setupProblem}`);
|
|
49
53
|
// ecp-go serves its browser UI on port 2323 and its API (what this server
|
|
50
54
|
// talks to) on 2324, same host - derived here so the "go do this in ecp-ui"
|
|
51
55
|
// guidance below points at a real, clickable URL instead of a vague
|
|
52
56
|
// pointer.
|
|
53
|
-
const
|
|
57
|
+
const apiBaseUrl = configResult.ok ? configResult.config.apiBaseUrl : configResult.apiBaseUrl;
|
|
58
|
+
const ecpUiUrl = apiBaseUrl ? panelUrlFromApiBase(apiBaseUrl) : "your ECP panel (port 2323 of your domain)";
|
|
54
59
|
const server = new McpServer({ name: "ecp-mcp-server", version }, {
|
|
55
60
|
instructions: `This server manages one ECP hosting account's apps, domains, databases, files, PHP, SSL, and related settings.
|
|
56
61
|
|
|
@@ -95,6 +100,8 @@ const toolContext = {
|
|
|
95
100
|
for (const tool of allTools) {
|
|
96
101
|
server.registerTool(tool.name, { description: tool.description, inputSchema: tool.inputSchema }, async (args) => {
|
|
97
102
|
try {
|
|
103
|
+
if (!client)
|
|
104
|
+
throw new Error(setupProblem ?? "ECP isn't set up yet.");
|
|
98
105
|
const result = await tool.handler(args, client, toolContext);
|
|
99
106
|
await auditLog({ tool: tool.name, args, result: "success" });
|
|
100
107
|
return {
|
package/dist/tools/apps.js
CHANGED
|
@@ -40,7 +40,7 @@ export const appsTools = [
|
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
name: "ecp_apps_detect",
|
|
43
|
-
description: "Inspect an app directory and detect its app root, tech stack (deploy_type + framework_hint), web root, whether it needs a database, its runtime (asdf_key + version), and suggested install/build/start commands. " +
|
|
43
|
+
description: "Inspect an app directory and detect its app root, tech stack (deploy_type + framework_hint), web root, whether it needs a database, its runtime (asdf_key + version, or runtime_constraints when there's no exact pin - feed those to ecp_asdf_recommend), and suggested install/build/start commands. " +
|
|
44
44
|
"Read-only: it runs no commands and changes nothing, so it's safe to call before creating or deploying an app. app_dir is a folder name under ~/apps or an absolute path inside it. " +
|
|
45
45
|
"If root_ambiguous is true, pick one of root_candidates and call this again with it.",
|
|
46
46
|
inputSchema: { app_dir: z.string() },
|
package/dist/tools/asdf.js
CHANGED
|
@@ -30,6 +30,16 @@ export const asdfTools = [
|
|
|
30
30
|
inputSchema: { name: z.string() },
|
|
31
31
|
handler: async (args, client) => client.request("GET", `asdf/list-installed/${args.name}`),
|
|
32
32
|
},
|
|
33
|
+
{
|
|
34
|
+
name: "ecp_asdf_recommend",
|
|
35
|
+
description: "Pick a runtime version for an app that doesn't pin one exactly (ecp_apps_detect returned no runtime_version). " +
|
|
36
|
+
"Pass runtime_constraints from ecp_apps_detect as constraints (or [] if there were none). Returns the newest LTS release " +
|
|
37
|
+
"(newest stable for tools with no LTS, like python) that satisfies all of them - e.g. engines.node \">=22\" gets the latest Node LTS, not 22. " +
|
|
38
|
+
"installed_match is an installed version on that line to use as-is; otherwise install `version`. relaxed=true means no release met every upper bound, so only minimums were applied. " +
|
|
39
|
+
"Prefer this over choosing a version yourself.",
|
|
40
|
+
inputSchema: { name: z.string(), constraints: z.array(z.string()).default([]) },
|
|
41
|
+
handler: async (args, client) => client.request("POST", "asdf/recommend", { body: { name: args.name, constraints: args.constraints } }),
|
|
42
|
+
},
|
|
33
43
|
{
|
|
34
44
|
name: "ecp_asdf_install",
|
|
35
45
|
description: "Start installing a plugin version. Returns once the install STARTS - building can take minutes (python compiles from source). " +
|
package/dist/tools/domains.js
CHANGED
|
@@ -25,14 +25,14 @@ export const domainTools = [
|
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
name: "ecp_domains_list_additional",
|
|
28
|
-
description: "List additional (addon) domains
|
|
28
|
+
description: "List additional (addon) domains and subdomains - every domain an app can use except the primary domain.",
|
|
29
29
|
inputSchema: {},
|
|
30
30
|
handler: async (_args, client) => client.request("GET", "domain/additional-domains"),
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
name: "ecp_domains_add_domain",
|
|
34
34
|
description: "Add an additional (addon) domain to this account.",
|
|
35
|
-
inputSchema: { domain: z.string()
|
|
35
|
+
inputSchema: { domain: z.string() },
|
|
36
36
|
handler: async (args, client) => client.request("POST", "domain/add-domain", { body: args }),
|
|
37
37
|
},
|
|
38
38
|
{
|
package/dist/tools/files.js
CHANGED
|
@@ -10,6 +10,12 @@ import { z } from "zod";
|
|
|
10
10
|
// (same reasoning as the DB import/export punt in the plan) - revisit later
|
|
11
11
|
// if there's a concrete need.
|
|
12
12
|
export const filesTools = [
|
|
13
|
+
{
|
|
14
|
+
name: "ecp_files_upload_limit",
|
|
15
|
+
description: "Get the largest upload this ECP accepts, in MB (upload_max_size_mb). It also caps the SQL size for the *_import_database tools. Needs ECP 2.0.5+.",
|
|
16
|
+
inputSchema: {},
|
|
17
|
+
handler: async (_args, client) => client.request("GET", "file-system/upload-limit"),
|
|
18
|
+
},
|
|
13
19
|
{
|
|
14
20
|
name: "ecp_files_list",
|
|
15
21
|
description: "List files/folders in a directory.",
|
|
@@ -40,7 +46,7 @@ export const filesTools = [
|
|
|
40
46
|
},
|
|
41
47
|
{
|
|
42
48
|
name: "ecp_files_write",
|
|
43
|
-
description: "Overwrite a text file's content (creates it if it doesn't exist). Can break a running app if it's a config/env/source file - review the current content first.",
|
|
49
|
+
description: "Overwrite a text file's content (creates it if it doesn't exist). Can break a running app if it's a config/env/source file - review the current content first. ECP 2.0.5+ rejects requests over 32 MB.",
|
|
44
50
|
inputSchema: { file_path: z.string(), file_content: z.string(), confirm: z.literal(true) },
|
|
45
51
|
handler: async (args, client) => client.request("POST", "code-editor/file", {
|
|
46
52
|
body: { "file-path": args.file_path, "file-content": args.file_content },
|
|
@@ -90,29 +96,39 @@ export const filesTools = [
|
|
|
90
96
|
},
|
|
91
97
|
{
|
|
92
98
|
name: "ecp_files_change_permission",
|
|
93
|
-
description: "chmod a file (e.g. new_permission: '644').",
|
|
94
|
-
inputSchema: {
|
|
99
|
+
description: "chmod a file or folder (e.g. new_permission: '644'). For a folder, ECP applies the mode to the folder and everything inside it unless recursive is false.",
|
|
100
|
+
inputSchema: {
|
|
101
|
+
current_directory: z.string(),
|
|
102
|
+
file_name: z.string(),
|
|
103
|
+
new_permission: z.string(),
|
|
104
|
+
recursive: z
|
|
105
|
+
.boolean()
|
|
106
|
+
.optional()
|
|
107
|
+
.describe("Folders only. false changes just the folder itself; omitted or true also changes every file and subfolder to the same mode (files usually want 644, folders 755). Needs the ECP release after 2.0.6; older ECP ignores false and changes everything."),
|
|
108
|
+
},
|
|
95
109
|
handler: async (args, client) => client.request("POST", "file-system/change-permission", { body: args }),
|
|
96
110
|
},
|
|
97
111
|
{
|
|
98
112
|
name: "ecp_files_compress",
|
|
99
|
-
description: "Compress one or more files/folders into an archive.",
|
|
113
|
+
description: "Compress one or more files/folders (paths relative to current_directory) into an archive in current_directory. Fails if the archive already exists.",
|
|
100
114
|
inputSchema: {
|
|
101
115
|
file_paths: z.array(z.string()),
|
|
102
116
|
output_filename: z.string(),
|
|
103
117
|
current_directory: z.string(),
|
|
118
|
+
format: z.enum(["zip", "tar", "tar.gz", "tar.bz2", "tar.xz"]).optional().describe("Archive format; default zip"),
|
|
104
119
|
},
|
|
105
120
|
handler: async (args, client) => client.request("POST", "file-system/compress", {
|
|
106
121
|
body: {
|
|
107
122
|
filePaths: args.file_paths,
|
|
108
123
|
outputFilename: args.output_filename,
|
|
109
124
|
currentDirectory: args.current_directory,
|
|
125
|
+
...(args.format ? { format: args.format } : {}),
|
|
110
126
|
},
|
|
111
127
|
}),
|
|
112
128
|
},
|
|
113
129
|
{
|
|
114
130
|
name: "ecp_files_extract",
|
|
115
|
-
description: "Extract an archive into a destination directory.",
|
|
131
|
+
description: "Extract an archive (.zip, .tar, .tar.gz/.tgz, .tar.bz2, .tar.xz) into a destination directory.",
|
|
116
132
|
inputSchema: { file_path: z.string(), destination: z.string() },
|
|
117
133
|
handler: async (args, client) => client.request("POST", "file-system/extract", { body: args }),
|
|
118
134
|
},
|
|
@@ -9,6 +9,12 @@ export const resourceMonitorTools = [
|
|
|
9
9
|
inputSchema: {},
|
|
10
10
|
handler: async (_args, client) => client.request("GET", "resource-status"),
|
|
11
11
|
},
|
|
12
|
+
{
|
|
13
|
+
name: "ecp_resource_bandwidth_usage",
|
|
14
|
+
description: "Get this account's bandwidth use for the current billing cycle (bytes in/out/total, limit, cycle dates) plus recent cycles. tracking is false when bandwidth isn't being collected for this account. Needs ECP 2.0.5+ on EHM 2.0.8+.",
|
|
15
|
+
inputSchema: {},
|
|
16
|
+
handler: async (_args, client) => client.request("GET", "resource-status/bandwidth"),
|
|
17
|
+
},
|
|
12
18
|
{
|
|
13
19
|
name: "ecp_resource_status_dismiss",
|
|
14
20
|
description: "Dismiss a resource-status warning banner.",
|
package/dist/tools/system.js
CHANGED
|
@@ -84,9 +84,9 @@ export const systemTools = [
|
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
name: "ecp_system_update",
|
|
87
|
-
description: "
|
|
87
|
+
description: "Apply an ECP/hosting update (what ECP's own Update button does): EHM rebuilds this account's container on the current or given hosting environment/version, then restores logins, settings and site configs. Files and databases are kept, but every site restarts and is briefly offline. Check ecp_system_check_for_update first. It does not change any password.",
|
|
88
88
|
inputSchema: {
|
|
89
|
-
ecp_password: z.string(),
|
|
89
|
+
ecp_password: z.string().optional().describe("Not used by ECP; accepted for compatibility with older clients."),
|
|
90
90
|
hosting_environment: z.string().optional(),
|
|
91
91
|
hosting_version: z.string().optional(),
|
|
92
92
|
confirm: z.literal(true),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ecp-mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "MCP server for ECP (Epic Control Panel) - manage a hosting account's apps, domains, databases, files, PHP, SSL and more conversationally through an MCP client like Claude Code or Claude Desktop.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|