MCP server
Let Claude, Cursor, VS Code and other MCP clients manage your wtree Cloud instance as tools.
Connect an AI assistant to wtree Cloud through the Model Context Protocol so it can create projects, deploy applications, read logs and manage databases and domains for you.
The server is published as @wtree/cloud-mcp and calls the API through the SDK.
Before you start
- Node.js 20 or newer, or Bun.
- An MCP client: Cursor, VS Code, Claude Desktop, Claude Code, Windsurf, Zed or another.
- An API key from Profile (avatar menu) › API/CLI Keys.
The server acts with the permissions of the user who created the key. An assistant using an owner's key can delete projects. Create the key from a user whose role matches what the assistant may do.
Connect
Add the server to your client. Most clients use this JSON; replace the URL and key.
{
"mcpServers": {
"wtree-cloud": {
"command": "npx",
"args": ["-y", "@wtree/cloud-mcp"],
"env": {
"W3PANEL_URL": "https://your-wtree-cloud-server.com",
"W3PANEL_API_KEY": "your-wtree-cloud-api-key"
}
}
}
}| Client | Location |
|---|---|
| Cursor | ~/.cursor/mcp.json, or .cursor/mcp.json in a project |
| Claude Desktop | claude_desktop_config.json |
| Windsurf | The Windsurf MCP config file |
| VS Code | The MCP config file, with a top-level servers key and "type": "stdio" |
| Zed | settings.json, under context_servers |
For Claude Code, use the CLI instead.
claude mcp add wtree-cloud \
-e W3PANEL_URL=https://your-wtree-cloud-server.com \
-e W3PANEL_API_KEY=your-wtree-cloud-api-key \
-- npx -y @wtree/cloud-mcpWith Bun, use bunx @wtree/cloud-mcp in place of npx -y @wtree/cloud-mcp.
Environment variables
| Variable | Required | Default | What it does |
|---|---|---|---|
W3PANEL_URL | Yes | Your wtree Cloud server URL. | |
W3PANEL_API_KEY | Yes | Your API key. | |
W3PANEL_TOOL_PRESET | No | all | Toolset: all, minimal, core, deploy, databases or git. |
W3PANEL_ENABLED_TAGS | No | Comma-separated API tags to load, such as project,application,postgres. Overrides the preset. | |
W3PANEL_DISABLED_TAGS | No | Comma-separated tags to exclude. Applied last. | |
W3PANEL_REDACT_ENV | No | true | Redacts environment variables, compose files, passwords, tokens and keys from responses before they reach the model. |
W3PANEL_CUSTOM_HEADERS | No | JSON object of extra request headers, for instances behind Cloudflare Access or a similar proxy. | |
W3PANEL_TIMEOUT | No | 30000 | Request timeout in milliseconds. |
W3PANEL_RETRY_ATTEMPTS | No | 3 | Extra attempts for read tools after a network or server error. 0 turns retries off. Other tools are never retried. |
W3PANEL_RETRY_DELAY | No | 1000 | Milliseconds before the first retry, growing with each attempt. |
Limit the tools
By default every API endpoint becomes a tool, several hundred in total. Some clients and models get slower or less reliable with that many, so start with a preset.
| Preset | Included tags |
|---|---|
minimal | project, application |
core | project, server, application |
deploy | project, environment, server, application, compose, domain, deployment |
databases | postgres, redis, mysql, mariadb, mongo, libsql |
git | github, gitlab, bitbucket, gitea, gitProvider, registry, sshKey |
Tools carry annotations so clients can confirm risky actions: readOnlyHint on reads, destructiveHint on deletes and on tools that stop, kill, clean, restart, reload or cancel something, and idempotentHint only on reads and on updates that set a value.
HTTP mode
The server uses stdio by default. To run it as an HTTP service, give it a token.
W3PANEL_MCP_TOKEN=$(openssl rand -hex 32) npx -y @wtree/cloud-mcp --httpIt serves Streamable HTTP on /mcp, legacy SSE on /sse and a health check on /health.
Anyone who can reach the HTTP server can act with your API key, so HTTP mode is locked down by default.
| Variable | Default | What it does |
|---|---|---|
W3PANEL_MCP_TOKEN | required | Bearer token clients send as Authorization: Bearer <token>. At least 16 characters; the server won't start without it. |
W3PANEL_MCP_HOST | 127.0.0.1 | Address to listen on, for example 0.0.0.0 in a container behind a proxy. |
W3PANEL_MCP_PORT | 3000 | Port to listen on. wtree Cloud uses 3000, so pick another when both run on one machine. |
W3PANEL_MCP_ALLOWED_HOSTS | loopback names | Comma-separated Host values to accept, such as mcp.example.com. Include the port when it isn't 80 or 443. |
Only known Host headers are accepted, which blocks DNS-rebinding from web pages. The default is localhost, 127.0.0.1 and [::1] on the server's port.
Next steps
- SDK and CLI use the same API.
- API reference
