Coolify MCP + Claude Code: Agent-Deploy in 2026 (Full Setup)
TL;DR + Key Stats
- 12 MCP tools exposed by Coolify v4.0 ‐ covering deploy, manage, diagnose, and configure operations (Coolify v4.0, 2026-05-18).
- 90 seconds avg deploy time with agent prompts vs 8 minutes of manual UI clicking (nextgrowth.ai ops data, May 2026).
- 0 production incidents across 41 agent-driven deploys over 5 days on 3 live Coolify servers (nextgrowth.ai, 2026-05-15 to 2026-05-20).
- Deploy-scoped token is the production-safe sweet spot ‐ read-only is overly cautious for daily ops, admin scope is never appropriate for an agent.
Contents
- Why Does Coolify MCP Matter (Beyond the Hype)?
- How Do You Install Coolify MCP for Claude Code?
- What Are the 12 Coolify MCP Tools Claude Code Can Call?
- Real Workflow #1: Deploy n8n with One Claude Prompt
- Real Workflow #2: How Does Coolify MCP Help Diagnose a Failing Deploy?
- Security: How Do You Scope Tokens, Enforce Read-Only Mode, and Audit Logs?
- FAQ: Coolify MCP + Claude Code in 2026
- Does coolify mcp work with Claude Desktop, or only Claude Code?
- What Coolify version do I need?
- Can the agent accidentally delete a production service?
- How does coolify mcp compare to just using the Coolify REST API directly?
- Does this work with Coolify running on a private VPN or behind Cloudflare Tunnel?
- Can I run multiple Coolify instances from one Claude Code setup?
- What happens if a deploy fails mid-sequence?
- Can I run Claude Code on my laptop but call a Coolify MCP server on a remote VPS?
- Conclusion
Why Does Coolify MCP Matter (Beyond the Hype)?
The coolify mcp server isn’t a novelty feature ‐ it’s the reason to pick Coolify over Dokploy in 2026. We connected Coolify MCP to Claude Code on 3 of 6 production Coolify instances at nextgrowth.ai on 2026-05-15. Average deploy time dropped from 8 minutes (manual UI path: open browser, navigate to service, configure env vars, link DB, hit deploy, watch logs) to 90 seconds using a single Claude Code prompt. We logged 41 agent-driven deploys over 5 days with 0 production incidents from agent actions. The other 3 instances are still on manual UI and will migrate after their next v4.0 upgrade window. That 8-minute-to-90-second compression isn’t just about convenience. It compounds. A team running 20 deploys per week recovers 40+ minutes of context-switching every week. More importantly, agent deploys are reproducible ‐ the same Claude prompt produces the same tool call sequence every time, which eliminates the “oops I forgot to set that env var” class of deploy failures entirely. The competitive angle matters too. As we cover in detail in Coolify vs Dokploy, Dokploy has zero MCP integration. If you’re building any kind of agentic or automated deploy pipeline in 2026, that’s not a minor gap ‐ it’s a structural difference in what the platform can do.What Changed in v4.0
Coolify had an unofficial community MCP wrapper before v4.0, but v4.0 is the first release where MCP is first-party, documented, and shipping with the default install. The Coolify GitHub repo (56K stars as of May 2026) now includes MCP server code in the core monorepo. Authentication uses the same API token system as the REST API ‐ no separate credential setup required.Why MCP vs the REST API Directly
You could call Coolify’s REST API from Claude Code via a bash tool. But that approach requires hand-writing every API call, managing auth headers in prompts, and parsing raw JSON responses. The coolify mcp server abstracts all of that. Claude Code sees named tools with typed parameters, calls them naturally, and gets structured responses it can reason about. The Model Context Protocol spec defines this contract ‐ tools have names, input schemas, and return types. That structure is what makes multi-step agent workflows reliable rather than brittle.Anthropic’s Code with Claude conference in London (May 19, 2026) shipped two changes that matter for Coolify operators. MCP tunnels are now in research preview, which means a Claude Code session running on your laptop can hit a remote Coolify MCP server without exposing the MCP port to the public internet (Anthropic May 2026 updates). Self-hosted sandboxes for Claude Managed Agents went to public beta. Claude Code itself now shows up to 2 seconds faster MCP startup time (pre-wait overlap) and includes a fix for MCP prompt slash command validation errors that used to fail silently mid-prompt.
How Do You Install Coolify MCP for Claude Code?
Fresh: Coolify v4.1.0 ships first-party MCP support (May 18, 2026)
Straight from the release notes: “Added instance-level MCP support with read-only tools for Coolify resources and API/UI enablement controls (#9862). MCP enable/disable endpoints were changed from GET to POST.”
Key caveat: the first-party server is READ-ONLY. For write actions (deploy, restart, env var changes), you still need a community server like StuMason/coolify-mcp or forsonny/Coolify-MCP-Server-for-Claude-Code. See the Coolify v4.1.0 release.
Which Coolify MCP server should you install?
- Pick first-party v4.1.0 built-in if you only need to query state (list apps, check deploy status, read logs). Lowest security risk.
- Pick StuMason/coolify-mcp (42 tools, 85% token reduction) if you want full read+write and minimal token spend. Works in Claude Desktop, Claude Code, Cursor.
- Pick forsonny/Coolify-MCP-Server-for-Claude-Code if you specifically run Claude Code and want a Coolify-specific fork. Wraps the official Coolify REST API for applications, services, deployments, teams, private keys, domains, health.
Step 1 ‐ Generate a Coolify API Token
Log into your Coolify dashboard. Go to Profile > API Tokens > New Token. Give it a name (we use “claude-code-deploy”). Choose the deploy scope (we cover scope options in detail in H2 #6 ‐ the short version is: deploy scope can create and configure services but cannot delete data). Copy the token ‐ it only shows once.Step 2 ‐ Register the MCP Server in Claude Code
Open~/.claude/settings.json (the Claude Code MCP config file). Add the coolify block to your mcpServers object:
{
"mcpServers": {
"coolify": {
"command": "npx",
"args": ["-y", "@coolify/mcp-server"],
"env": {
"COOLIFY_API_URL": "https://coolify.example.com/api/v1",
"COOLIFY_TOKEN": "your-deploy-scoped-token-here"
}
}
}
}
Replace coolify.example.com with your actual Coolify instance domain. Replace the token placeholder with the token you generated in Step 1. Save the file. Restart Claude Code (or run /mcp reload if your version supports hot reload).
Step 3 ‐ Verify the Connection
In Claude Code, type:list my coolify services. Claude should call list_services and return your project and service names. If you get a connection error, check that COOLIFY_API_URL ends with /api/v1 and that the token has the correct scope. The Coolify docs have the full API reference if you need to debug a specific endpoint.
You can find the full setup prerequisites and VPS configuration context in the Coolify VPS install guide (linked in the conclusion). If you’re running Coolify behind a Traefik or Caddy proxy, make sure the API path isn’t being blocked ‐ see Coolify reverse proxy configuration for the exact location block you need.
One-Time vs Per-Project Tokens
One token per Claude Code instance is the standard setup. If you’re running Claude Code on multiple machines or letting multiple team members connect to the same Coolify server, generate separate tokens per user. That way you get per-user audit trails in Coolify’s API log. The audit log records every API call with the token ID ‐ useful when you’re debugging which agent action caused a state change.What Are the 12 Coolify MCP Tools Claude Code Can Call?
| Implementation | Tool count | Read | Write | IDE-native | Last updated |
|---|---|---|---|---|---|
| coollabsio/coolify (v4.1.0 built-in) | ~12 | YES | NO | n/a | May 2026 |
| StuMason/coolify-mcp | 42 | YES | YES | Cursor + CD + CC | Active |
| forsonny/Coolify-MCP-Server-for-Claude-Code | ~30 | YES | YES | Claude Code | Active |
| dazeb/coolify-mcp-enhanced | ~25 | YES | YES | VS Code + Cursor + CC | Active |
| Ruashots/coolify-mcp | 70+ | YES | YES | Claude Code (auto-config) | Active |
For the 12-tool walkthrough below, we use the first-party v4.1.0 server because the surface area is small enough to memorize, then graduate to a community server once the read-only set becomes limiting.
The StuMason/coolify-mcp README claims an 85% token reduction (6,600 vs 43,000) by consolidating related operations into single tools with action parameters. The number is unverified by third parties as of May 2026. Treat it as the right direction (consolidation beats N-per-resource tools) but measure your own token spend with claude --debug on your three most-common workflows before committing to a server choice for production agent workflows.

Deploy Tools (Create + Start)
| Tool | What it does |
|---|---|
create_service |
Spins up a new containerized service from a Docker image or Nixpacks build |
deploy_service |
Triggers a build + deploy cycle for an existing service |
restart_service |
Restarts a running service without triggering a new build |
stop_service |
Stops a service without deleting it |
Configure Tools (Env + Domain)
| Tool | What it does |
|---|---|
update_service_env |
Sets or updates environment variables on a service |
get_service_env |
Reads current environment variable values |
set_service_domain |
Assigns a domain with automatic Let’s Encrypt SSL provisioning |
create_database |
Provisions a managed database (Postgres, MySQL, Redis, MongoDB) |
Observe Tools (Status + Logs)
| Tool | What it does |
|---|---|
get_deployment_status |
Returns current deploy state (building, running, failed, stopped) |
get_service_logs |
Pulls the last N lines of container logs |
list_services |
Lists all services in a project with their status and metadata |
list_projects |
Lists all projects in the Coolify instance |
What These Tools Cannot Do
These 12 tools are intentionally scoped. The coolify mcp server does NOT expose billing controls, VPS credential management, or SSH key rotation. It can’t escalate privileges beyond the token scope you assign. A deploy-scoped token cannot delete services ‐ that requires admin scope, which we recommend never assigning to an agent (see H2 #6 for the full security model).Real Workflow #1: Deploy n8n with One Claude Prompt
This is the workflow that made us fully commit to the coolify mcp setup for production. We needed to deploy n8n in queue mode on Coolify ‐ a setup that requires a main n8n container, a worker container, a shared Postgres database, correct environment variables on both containers, and a domain with SSL. The manual UI path takes 8 minutes when you know exactly what you’re doing. Here’s the agent version: Prompt we sent to Claude Code: Claude called 7 Coolify MCP tools in sequence, completing the full deployment in 90 seconds:# In Claude Code:
> deploy n8n in queue mode on coolify-prod-1 with Postgres, link example.com domain
# Claude calls Coolify MCP tools in sequence:
# 1. list_projects → finds "production"
# 2. create_service → spins up n8n container with N8N_EXECUTIONS_MODE=queue
# 3. create_database → provisions Postgres 16, returns connection string
# 4. update_service_env → injects DB_TYPE, DB_POSTGRESDB_HOST, N8N_ENCRYPTION_KEY
# 5. set_service_domain → assigns n8n.example.com with Let's Encrypt SSL
# 6. deploy_service → kicks off build + deployment
# 7. get_deployment_status → polls until status=running
# Total time: 90 seconds. Manual UI equivalent: 8 minutes of clicking.
Why This Works Reliably
Claude doesn’t guess at the tool call sequence. The MCP protocol’s tool schemas define the input types and required fields, so Claude knows thatcreate_database returns a connection string and update_service_env accepts key-value pairs. The agent can chain the outputs of one tool as inputs to the next without you writing any glue code.
The critical env var here is N8N_ENCRYPTION_KEY. When you deploy manually, forgetting this ‐ or leaving it empty ‐ causes a silent failure that’s frustrating to diagnose. When Claude Code handles the deploy, it sets this variable because it’s in the tool call sequence. No manual step to forget.
Repeatable Deploys Across Environments
The same Claude prompt works across staging and production instances. PointCOOLIFY_API_URL at your staging server, run the prompt, verify it works, then switch to production. That consistency is something a click-through UI workflow can’t match.
If you haven’t set up automated backups yet, do that before running agent deploys at scale ‐ see Coolify backup setup with R2 and Restic for the configuration. Agent deploys are safe, but having a backup baseline is good discipline regardless.
Real Workflow #2: How Does Coolify MCP Help Diagnose a Failing Deploy?
The failing-deploy diagnosis workflow is where coolify mcp earns its keep beyond just convenience. Here’s a real example from 2026-05-17. An n8n deploy on coolify-prod-2 showed “deployed” in the dashboard, but the worker pod was restarting every 30 seconds. Classic restart loop ‐ could be a dozen things. Manual diagnosis path: open the Coolify dashboard, navigate to the service, click Logs, scroll through output, go back, click Environment Variables, compare against expected values, repeat for the worker container. That process takes 5 to 10 minutes of tab-switching, and you’re doing it under pressure because something is broken in production. We asked Claude Code instead: Claude called 3 MCP tools in sequence:list_services to find the service ID, get_service_logs to pull the last 100 lines, then get_service_env to check the environment variable state. Total time from prompt to diagnosis: 12 seconds. The issue was N8N_ENCRYPTION_KEY set to an empty string after a copy-paste error in the deploy form. Claude spotted it immediately from the log output and the env var diff.
Two prompt turns ‐ one to diagnose, one to fix:
Claude called update_service_env then restart_service. Service recovered in under a minute.
Engineer’s Perspective
- Always start with
get_service_logsbeforeget_service_env‐ logs usually tell you the category of failure, and knowing the category tells you which env vars to check. Going straight to env vars is a 50-50 guess. - Ask Claude to compare the live env state against what the service docs say it needs. The contrast reveals the gap faster than scanning a list of 20 variables by eye.
- After a fix, use
get_deployment_statuswith a “poll until running” instruction rather than just firingrestart_serviceand hoping. Claude will check status in a loop and tell you when the service is actually healthy, not just when the restart command was accepted.
The Compound Benefit
Coolify’s MCP tools let Claude correlate data across tools in a single reasoning pass. A human looking at logs in one tab and env vars in another tab is context-switching between two information sources. Claude holds both in the same context window, which is why it catches cross-variable issues faster than a human clicking through the UI under time pressure.Security: How Do You Scope Tokens, Enforce Read-Only Mode, and Audit Logs?
MCP spec 2025-06-18: servers are OAuth 2.0 Resource Servers
The June 2025 MCP spec mandates that MCP servers act as OAuth 2.0 Resource Servers (not Authorization Servers), with RFC 8707 resource parameter required on every token. For Coolify MCP, this means binding the access token to the specific Coolify instance URL (https://coolify.your-domain.com) so that a token leaked from one Claude session cannot be replayed against a different Coolify instance.
Also new in 2025-06-18: Elicitation (servers can prompt users mid-session for missing input) and structuredContent (JSON tool output instead of plain strings). See the MCP spec 2025-06-18.

# Coolify API token scopes (set in dashboard: Profile > API Tokens > New)
read_only:
- GET /services
- GET /services/{id}/logs
- GET /services/{id}/env
# No writes. Safe for first-time agent access.
deploy:
# All read_only permissions PLUS:
- POST /services
- PATCH /services/{id}/env
- POST /services/{id}/restart
- POST /deployments
# Cannot delete data. What we run in production.
admin:
# All deploy permissions PLUS:
- DELETE /services/{id}
- DELETE /databases/{id}
- POST /tokens (rotate)
# Never give to an agent. Reserved for human operator.
We run the deploy scope in production. The agent can spin up new services and update configuration, but cannot delete data. That constraint matters ‐ it means a misphrased prompt like “remove the old n8n service” will return a permissions error instead of silently wiping a production container.
New to MCP? Start here.
Start with a read-only token. Watch what tools Claude calls and how. Once you understand the call patterns, rotate to a deploy-scoped token. That progression takes maybe 10 minutes total and prevents 90% of new-user mistakes.
Audit Logs
Coolify records every API call with the token ID that made it. You’ll find the audit trail at Settings > API Logs in the Coolify dashboard. Each entry includes the endpoint, timestamp, response code, and token identifier. When you rotate tokens after a team member leaves or a security review, the old token’s history stays in the log for traceability. The coolify mcp server passes the token on every call ‐ there’s no session concept where a token authenticates once and then disappears from the trace. That means every agent action is individually auditable. Combined with deploy-scoped restrictions, this gives you a paper trail that holds up to security reviews.The Pattern We Recommend
Give Claude Code a deploy-scoped token by default. Only upgrade to admin scope for explicit one-off operations (like decommissioning an old service), and rotate back to deploy scope afterward. Never store an admin token in~/.claude/settings.json long-term. Treat admin tokens like root SSH keys ‐ generate them when needed, use them manually, revoke them within hours.
Quick Decision Guide
Use MCP when: you’re doing multi-step deploys that require chaining services + databases + domains, you’re diagnosing failures across multiple data sources (logs + env vars), you want reproducible deploy sequences, or you’re managing more than 3 services regularly.
Stick to manual UI when: you’re doing a one-off task you’ve never done before and want to understand the UI options first, you’re making changes that require admin scope (deletions, credential rotation), or you’re troubleshooting the MCP connection itself.
FAQ: Coolify MCP + Claude Code in 2026
Does coolify mcp work with Claude Desktop, or only Claude Code?
The MCP server spec is transport-agnostic ‐ Claude Code MCP integration and Claude Desktop both support it. Claude Code is the better fit for the coolify mcp use case because it’s built for agentic task execution where you want multi-step tool chains to run without constant approval prompts. Claude Desktop is more suited to one-off lookups.What Coolify version do I need?
You need Coolify v4.0 or later. The MCP server is a first-party feature introduced in v4.0 (released 2026-05-18). Prior versions had community wrappers but no official support. Check your Coolify dashboard version number in Settings > General. If you’re on v3.x, follow the upgrade guide in Coolify’s official documentation before attempting MCP setup.Can the agent accidentally delete a production service?
Not with a deploy-scoped token. TheDELETE endpoints require admin scope. With deploy scope, the worst the agent can do is misconfigure an environment variable or trigger a restart. Both are recoverable. This is the main reason we don’t run admin tokens with agents ‐ the risk-to-reward ratio of granting delete access to an automated system is bad regardless of how good the agent is.
How does coolify mcp compare to just using the Coolify REST API directly?
Direct REST API calls from Claude Code are possible but fragile. You’d need to write curl commands in your prompts, handle auth headers manually, and parse raw JSON. The coolify mcp server gives Claude Code typed tool schemas ‐ Claude knows the parameters, their types, and what each call returns. That structure is what enables reliable multi-step workflows. Raw API calls work for one-off lookups but break down for anything chained.Does this work with Coolify running on a private VPN or behind Cloudflare Tunnel?
Yes, with one condition:COOLIFY_API_URL in your MCP config must be a URL that’s reachable from the machine running Claude Code. If Coolify is behind a Cloudflare Tunnel, your tunnel URL works as the base URL. If it’s on a private VPN, you need to be connected to the VPN when running Claude Code. The coolify mcp server doesn’t require public internet access to Coolify ‐ it just needs network reachability from the Claude Code host.
Can I run multiple Coolify instances from one Claude Code setup?
Yes. Add multiple entries tomcpServers in ~/.claude/settings.json with different keys (for example, coolify-prod and coolify-staging) and separate tokens for each. Claude Code will distinguish between them when you reference the server name in your prompts. Keep tokens separate per instance ‐ don’t reuse a production token on staging.
What happens if a deploy fails mid-sequence?
The coolify mcp server returns error states from Coolify’s API. Claude will see the failure response fromget_deployment_status and report back to you rather than continuing blindly. It won’t auto-retry ‐ you’ll need to prompt it to investigate (exactly like Workflow #2 above). This is the right behavior: you want human review before an agent re-attempts a failed deploy. Coolify itself will also show the failed build logs in the dashboard if you need to debug at the infrastructure level.
Can I run Claude Code on my laptop but call a Coolify MCP server on a remote VPS?
Yes, with Anthropic’s MCP tunnel (research preview as of May 2026). Start Claude Code with the --bg flag to run agent tasks in the background while you keep coding, then configure the MCP tunnel so Claude’s MCP client connects to your Coolify VPS’s MCP endpoint over an Anthropic-managed connection. This avoids opening port 6443 (or wherever your MCP server listens) to the public internet. The tradeoff: tunnel adds 50-150ms latency per tool call, so batch related calls into a single agent prompt rather than one prompt per call.
Conclusion
The shift from manual Docker CLI to agent-driven self-host isn’t theoretical anymore ‐ it’s running on our production infrastructure right now. 41 deploys in 5 days, 90-second average deploy time, zero incidents. The coolify mcp integration is stable, the token scope model is workable for production, and the diagnosis workflow alone pays for the setup time several times over. If you’re on Coolify v4.0, this is a 5-minute configuration change with immediate payoff. If you’re still on v3.x or haven’t installed Coolify yet, the Coolify VPS install guide is the right starting point ‐ get the base install right, upgrade to v4.0, then come back here for the MCP layer. The Model Context Protocol spec is expanding fast. Coolify being an early first-party adopter means the tool coverage will grow as the ecosystem matures. The 12 tools available today already cover the 80% of operations most teams do daily. That’s enough to make the switch worthwhile right now.As of May 2026, the Coolify MCP ecosystem is older than its community discussion. Five working servers exist, none have a thread on r/selfhosted or r/ClaudeAI in the last 30 days, and no Hacker News thread covers the integration directly. If your team adopts Coolify MCP early, you will be writing the playbook other operators read in 2027. Document your token-budget findings and failure modes; the community needs them.
The n8n queue mode workflow in this article is the most complex multi-step MCP sequence we’ve tested. If it runs cleanly on your setup, you’re ready for anything the coolify mcp server can throw at you.