AI assistants and MCP: uc mcp
Connect UniCloud to Claude Code, Cursor and Claude Desktop through the MCP server in uc: resources, status, logs, folder deploys, rollback, variables and domains.
uc mcp is a Model Context Protocol server built into the uc command line. An AI assistant (Claude Code, Cursor, Claude Desktop and other MCP clients) starts it by itself and gets tools for your resources: list them and check their status, read logs, deploy a folder, roll back a release, restart, change variables and attach a domain. Nothing else to install: the server is the same uc file, with no Node.js and no third-party packages. It talks over standard input and output (JSON-RPC 2.0); the only outside connection uc makes is to the public API of the platform.
Before you start
- Install
ucand sign in:uc login --url https://<panel address>(see the command line article). - Choose the token scope in the panel. Read-only: the assistant sees resources, status and logs but changes nothing. Full access: deploys, rollback, restarts, variables and domains too.
The server uses the same login as uc: the saved token or the UC_TOKEN and UC_URL variables.
Connect
claude mcp add unicloud -- uc mcp
For all projects at once: claude mcp add --scope user unicloud -- uc mcp. Check with claude mcp list, or /mcp inside a session.
.cursor/mcp.json in the project folder (or ~/.cursor/mcp.json for every project):
{
"mcpServers": {
"unicloud": { "command": "uc", "args": ["mcp"] }
}
}
Cursor lists the server under Settings → MCP.
Settings → Developer → Edit Config opens claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\). Claude Desktop does not read the PATH of your terminal, so give the full path to uc, and set the deploy folder with --root:
{
"mcpServers": {
"unicloud": {
"command": "/Users/you/.local/bin/uc",
"args": ["mcp", "--root", "/Users/you/projects"]
}
}
}
On Windows: "command": "C:\\Users\\you\\AppData\\Local\\Programs\\unicloud\\uc.exe". Restart Claude Desktop after editing.
Tools
| Tool | What it does | Scope |
|---|---|---|
list_resources | all resources: name, id, kind, state, plan, URL | read |
resource_status | state, release, last deploys, domains, variable names | read |
resource_logs | last log lines (tail, up to 2000) | read |
list_env | environment variable names, without values | read |
list_domains | custom domains of a resource and their verification | read |
source_settings | where an app is built from: folder, Dockerfile, auto-deploy paths and trigger | read |
deploy_folder | pack a folder (honouring .gitignore and .ucignore), deploy it and wait for the build | write |
rollback | return to the previous working release without a build | write |
restart_resource | restart | write |
set_env | set and remove variables; values are not echoed back | write |
set_source_settings | change the build folder, Dockerfile, auto-deploy paths or trigger (only the given fields) | write |
add_domain, verify_domain | attach a domain and check its DNS | write |
stop_resource, remove_domain, delete_resource | stop, detach a domain, delete with data | only with --allow-destructive |
Safety
- Token scope. With a read-only token the assistant does not even see the write tools, and calling one is refused without a request to the server. The platform checks the scope again on its side.
- Dangerous actions are off. Stopping, detaching a domain and deleting appear only with
uc mcp --allow-destructive; deleting also requires repeating the resource name. - Secrets. The assistant gets variable names, not values. If it really needs them, start the server with
--env-values. - Folders.
deploy_folderonly takes a folder inside the working folder of the server: the project folder in Claude Code and Cursor, otherwise set by--root. Links pointing outside do not help. - Audit. Every action goes through the API with your token and shows up in the account events. To revoke access, delete the token under Account → API tokens.
Flags
| Flag | Effect |
|---|---|
--allow-destructive | stop, detach domain and delete tools |
--env-values | list_env with show_values: true returns values |
--root <folder> | where deploys are allowed (the start folder by default) |
The server writes only protocol messages to stdout; service lines go to stderr, where the MCP log of your client shows them.