dokploy-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@dokploy-mcp list my Dokploy projects and their services"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
dokploy-mcp
An MCP server for Dokploy, the self-hosted PaaS. An assistant can list what is on your instance, read deploy and container logs, and deploy, restart, or change env vars. It does not delete anything.
Source: github.com/kennethreitz/dokploy-mcp.
The server uses the official Python MCP SDK. In mcp 2 the high-level class FastMCP was renamed to MCPServer; this project imports that class as FastMCP and uses the same decorator API (@mcp.tool()).
Talking to Dokploy is plain HTTP: x-api-key against <DOKPLOY_URL>/api/<router>.<procedure>, which is how Dokploy publishes its tRPC API. The procedure list was taken from Dokploy's OpenAPI spec (the copy synced to Dokploy/sdk) and from the current router source where that spec leaves response bodies empty.
Setup
You need two values from the Dokploy panel you want to manage:
The panel URL, for example
https://dokploy.example.com. A path is fine if Dokploy is not at the root. If the URL already ends in/api, it is used as-is.An API key. In the panel, open Settings → Profile, then the API/CLI section, and generate a key. Some versions label this Settings → API Keys.
export DOKPLOY_URL=https://dokploy.example.com
export DOKPLOY_API_KEY=your-api-keyPython 3.11 or newer, and uv.
git clone https://github.com/kennethreitz/dokploy-mcp.git
cd dokploy-mcp
uv sync --group devRelated MCP server: portainer-mcp
Run locally
stdio is the default. A local client launches the process and talks over stdin and stdout. No bearer token is used, because nothing is listening on the network.
uv run dokploy-mcp stdioHTTP mode serves the streamable HTTP transport on /mcp so a hosted assistant can connect by URL. Set MCP_AUTH_TOKEN first. Every request except GET /health must send Authorization: Bearer <MCP_AUTH_TOKEN>.
export MCP_AUTH_TOKEN=$(python -c "import secrets; print(secrets.token_urlsafe(32))")
uv run dokploy-mcp http --host 127.0.0.1 --port 8765Then the MCP endpoint is http://127.0.0.1:8765/mcp and the probe is http://127.0.0.1:8765/health.
Variable | Required | Purpose |
| always | Panel origin, with or without |
| always | Sent as |
| HTTP mode | Bearer token for |
| no | Bind address. Default |
| no | Default |
| no | Comma-separated |
| no | Comma-separated |
| no | Who may set |
| no | Uvicorn log level. Default |
A localhost bind checks the Host header and allows only localhost. Binding 0.0.0.0 (the container case, behind Dokploy's proxy) turns that check off, and the bearer token is what keeps the endpoint closed. Set MCP_ALLOWED_HOSTS to your public hostname when you want the check back on, for example dokploy-mcp.example.com.
Connect a client
stdio, from a clone of kennethreitz/dokploy-mcp:
{
"mcpServers": {
"dokploy": {
"command": "uv",
"args": ["run", "--directory", "/absolute/path/to/dokploy-mcp", "dokploy-mcp", "stdio"],
"env": {
"DOKPLOY_URL": "https://dokploy.example.com",
"DOKPLOY_API_KEY": "your-api-key"
}
}
}
}Remote HTTP. The client must send the bearer token. Cursor and Claude accept it as a header:
{
"mcpServers": {
"dokploy": {
"url": "https://dokploy-mcp.example.com/mcp",
"headers": {
"Authorization": "Bearer your-mcp-auth-token"
}
}
}
}Use the URL exactly, including /mcp. A trailing-slash redirect from an HTTPS proxy back to plain HTTP is refused by the MCP client. The server trusts X-Forwarded-* from FORWARDED_ALLOW_IPS so that redirect, when it happens, stays on HTTPS.
Deploy on Dokploy
The image is meant to run as an application on the same Dokploy instance it manages. It calls the panel API; it is not the panel.
Create an application from this repo. Build type Dockerfile. The repo
Dockerfileis the build.Set the container port to 8765.
Add environment variables:
DOKPLOY_URL— the panel's public URL, orhttp://dokploy:3000if the app shares Dokploy's Docker network and that hostname resolvesDOKPLOY_API_KEYMCP_AUTH_TOKEN— a long random string, different from the Dokploy API keyMCP_HOST=0.0.0.0is already set in the image
Add a domain with HTTPS. The proxy must forward
/mcpand/healthwithout stripping the path.Point the health check at path
/healthand port8765.Point your MCP client at
https://<that-domain>/mcpwith the bearer token.
DOKPLOY_URL has to be the panel, not the MCP server's own domain. The API key can do everything your user can do, and the bearer token lets whoever has it drive those tools. Keep both out of git.
Build the image somewhere else with:
docker build -t dokploy-mcp .
docker run --rm -p 8765:8765 \
-e DOKPLOY_URL=https://dokploy.example.com \
-e DOKPLOY_API_KEY=your-api-key \
-e MCP_AUTH_TOKEN=your-mcp-auth-token \
dokploy-mcpTools
Reads come first. Status values use Dokploy's vocabulary: idle is stopped, running means a deployment is in progress, done means the last operation succeeded (the service is usually up), and error means it failed.
Tool | What it does |
| Projects and a count of services in each environment |
| One project, with environments, apps, compose services, and databases |
| Environments in a project, with the services inside them |
| Applications, optionally filtered by project, environment, or search text |
| Config, status, env file, and containers |
| Compose services, with the same filters |
| Compose file, env, declared services, and containers |
| Postgres, MySQL, MariaDB, Mongo, Redis, and LibSQL |
| One database. Password fields are removed |
| Deploy history for an app, a compose service, or the whole instance |
| Deployments waiting to run |
| Build and deploy logs for one deployment |
| Container logs for an application |
| Logs for one compose container. The id comes from |
| Domains for an app, a compose service, or the instance |
| Servers Dokploy can deploy to |
| One server, with secrets redacted |
| Docker host health, via |
| Live app monitoring, via |
| Version, health, IP, Docker disk usage, infrastructure checks |
Writes:
Tool | What it does |
| Build and release an application |
| Start or stop without rebuilding |
| Reload containers without a new image ( |
| Deploy a compose service. Volumes are kept |
| Start or stop a compose service |
| Stop, then start. Dokploy has no compose restart call. Traffic drops, and if start fails the stack stays stopped |
| Replace or merge env vars. Also build args, build secrets, and the env-file flag |
| Replace or merge a compose env file |
Saving env updates the record only. Deploy or restart for running containers to pick it up. Pass env to replace the file, or variables and unset to edit keys. A name in both variables and unset is removed.
To change one key without resending the rest, pass only variables (or unset); every other key keeps its stored value. build_args, build_secrets, and create_env_file keep their stored values when omitted (an unset value is sent as an empty string, which Dokploy requires). get_application shows build secrets as ***; passing *** back as build_secrets is refused so the mask can never overwrite the real value.
There is no delete tool. compose.deploy can take freshVolumes, which wipes volumes; that flag is not exposed.
Development
uv sync --group dev
uv run pytestTests mock Dokploy with respx. One test starts the HTTP server and lists tools through the official MCP client, including a check that a missing bearer token is rejected.
What the Dokploy API did not make verifiable
I did not have a live Dokploy instance, so nothing here was confirmed against a running panel. The gaps that affected the design:
The OpenAPI document describes requests and leaves successful responses as empty objects. Nesting (a project contains environments, which contain applications, compose services, and databases) comes from the current router and service source, not from response schemas. Unknown extra fields are passed through when they are small scalars.
project.allfor an owner returns database rows with only an id.list_databasescallsproject.oneorenvironment.one, which include the name and status.application.readAppMonitoringtakesappNameand has no documented response. The tool returns the JSON unchanged. It does not take aserverId, so monitoring for an app on a remote server may not be what you expect.server.getServerMetricsrequiresurl,token, anddataPoints. The spec does not say how to build those fromserver.one, so the server health tool callsdocker.getServerHealthinstead.Settings calls used by
get_instance_status(settings.getDokployVersion,settings.health,settings.getIp,settings.getDockerDiskUsage,settings.checkInfrastructureHealth) exist and require the API key. A non-admin key may be forbidden from some of them. Failures are returned next to the checks that worked.Operation security in the spec names a scheme called
Authorization, but the scheme that is actually defined is headerx-api-key. Requests sendx-api-key, matching the panel docs.There is no compose restart procedure.
restart_composeis stop followed by start.LibSQL has no search procedure. Databases are listed from the project tree so LibSQL is included.
Deployment and log payloads are not schema'd. Log text is taken from a string body or from a
logs/log/outputfield, then clipped.
License
Apache License 2.0. Copyright 2026 Kenneth Reitz. See LICENSE.
Available Tools
32 toolsdeploy_applicationB
Start a deployment for an application. This builds and releases the current source.
Inputs: application_id (required), title, description. Returns: object
deploy_composeB
Deploy a compose service. Existing volumes are kept.
Dokploy can wipe volumes with freshVolumes. This server does not expose that flag.
Inputs: compose_id (required), title, description. Returns: object
get_applicationARead-onlyIdempotent
Get an application's config, status, env file, and current containers.
The env file is included and may contain secrets. buildSecrets are redacted. Container lookup is best-effort and is omitted as an error field when Dokploy refuses it.
Inputs: application_id (required). Returns: object
get_application_monitoringARead-onlyIdempotent
Read live monitoring for an application (CPU, memory, and network when Dokploy provides them).
The monitoring response shape is not in the OpenAPI spec, so it is returned as Dokploy sent it.
Inputs: application_id (required). Returns: object
get_composeARead-onlyIdempotent
Get a compose service: file, env, declared services, status, and containers.
Use a container id from this result with read_compose_logs.
Inputs: compose_id (required). Returns: object
get_databaseARead-onlyIdempotent
Get one database. Password fields are redacted.
engine is postgres, mysql, mariadb, mongo, redis, or libsql. database_id is that engine's id, for example postgresId.
Inputs: engine (required), database_id (required). Returns: object
get_instance_statusARead-onlyIdempotent
Read Dokploy version, health, public IP, Docker disk usage, and infrastructure checks.
Each check is independent. A non-admin key may be forbidden from some settings calls; those are returned as errors alongside the checks that succeeded.
Inputs: no named parameters. Returns: object
get_projectBRead-onlyIdempotent
Get one project, including its environments, applications, compose services, and databases.
Inputs: project_id (required). Returns: object
get_serverBRead-onlyIdempotent
Get one remote server. SSH material and tokens are redacted.
Inputs: server_id (required). Returns: object
get_server_healthARead-onlyIdempotent
Get Docker host health. Omit server_id for the Dokploy host itself.
since_hours is 1-168 when you want a window. This uses docker.getServerHealth. server.getServerMetrics is not wrapped: it requires a monitoring URL and token the OpenAPI spec does not explain how to derive.
Inputs: server_id, since_hours. Returns: object
list_applicationsBRead-onlyIdempotent
List applications. Filter by project, environment, or a search query.
Status uses Dokploy's vocabulary: idle is stopped, running is a deploy in progress, done means the last operation succeeded, error means it failed.
Inputs: limit, query, offset, project_id, +1 more. Returns: object
list_compose_servicesCRead-onlyIdempotent
List Docker Compose services. Filter by project, environment, or a search query.
Inputs: limit, query, offset, project_id, +1 more. Returns: object
list_databasesARead-onlyIdempotent
List Postgres, MySQL, MariaDB, MongoDB, Redis, and LibSQL databases.
Passwords are not included. Use get_database for connection details other than the password.
Inputs: project_id, environment_id. Returns: object
list_deployment_queueARead-onlyIdempotent
List deployments waiting in Dokploy's queue.
Inputs: no named parameters. Returns: object
list_deploymentsARead-onlyIdempotent
List deployments for an application, a compose service, or the whole instance.
Pass one id. Omit both to read the centralized deployment list. The newest rows Dokploy returns are kept, up to limit. Build output is not included; call read_deployment_logs with a deploymentId.
Inputs: limit, compose_id, application_id. Returns: object
list_domainsARead-onlyIdempotent
List domains for an application, a compose service, or the whole instance.
Inputs: compose_id, application_id. Returns: object
list_environmentsARead-onlyIdempotent
List environments in a project, with the services inside each one.
Inputs: project_id (required). Returns: object
list_projectsARead-onlyIdempotent
List projects on this Dokploy instance, with a count of services in each environment.
Inputs: no named parameters. Returns: object
list_serversARead-onlyIdempotent
List servers Dokploy can deploy to. Secrets in the payload are redacted.
Inputs: no named parameters. Returns: object
read_application_logsARead-onlyIdempotent
Read an application's container logs, not its build logs.
since is 'all' or a duration like 10s, 5m, 2h, or 1d. search is an optional plain string of letters, numbers, spaces, dots, underscores, and hyphens.
Inputs: application_id (required), tail, since, search. Returns: object
read_compose_logsBRead-onlyIdempotent
Read logs for one container in a compose service.
container_id comes from get_compose. since is 'all' or a duration like 5m or 2h.
Inputs: compose_id (required), container_id (required), tail, since, +1 more. Returns: object
read_deployment_logsBRead-onlyIdempotent
Read build and deploy logs for one deployment. tail is how many lines to request (1-10000).
Inputs: deployment_id (required), tail. Returns: object
redeploy_applicationC
Redeploy an application from its current configuration.
Inputs: application_id (required), title, description. Returns: object
redeploy_composeB
Redeploy a compose service from its current file and source. Volumes are kept.
Inputs: compose_id (required), title, description. Returns: object
restart_applicationADestructiveIdempotent
Restart an application by reloading its containers, without building a new image.
This calls Dokploy's application.reload. Use redeploy_application to rebuild.
Inputs: application_id (required). Returns: object
restart_composeADestructiveIdempotent
Restart a compose service by stopping it and starting it again.
Dokploy has no single compose restart procedure. Traffic drops between the two calls, and images are not rebuilt. If start fails, the stack is left stopped.
Inputs: compose_id (required). Returns: object
start_applicationA
Start a stopped application without rebuilding it.
Inputs: application_id (required). Returns: object
start_composeA
Start a stopped compose service.
Inputs: compose_id (required). Returns: object
stop_applicationADestructiveIdempotent
Stop an application. Running containers go down. Nothing is deleted.
Inputs: application_id (required). Returns: object
stop_composeADestructiveIdempotent
Stop a compose service. Containers go down. Volumes and the compose record stay.
Inputs: compose_id (required). Returns: object
update_application_envADestructiveIdempotent
Update an application's environment variables.
Pass env to replace the whole file, or variables to set keys and unset to remove keys. Those edits merge into the current file unless you also pass env. build_args and build_secrets are left unchanged unless you pass them. create_env_file controls whether Dokploy writes an env file into the build. This does not redeploy. To change one secret, pass only variables={KEY: value}; other keys are kept. Never pass the *** mask from get_application back as a value.
Inputs: application_id (required), env, unset, variables, +3 more. Returns: object
update_compose_envADestructiveIdempotent
Update a compose service's environment variables.
Pass env to replace the file, or variables and unset to merge into the current file. This does not redeploy. When a name is in both variables and unset, it is removed.
Inputs: compose_id (required), env, unset, variables, +1 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 32 tools
Most tools target distinct resources and actions, and descriptions clarify potentially confusing pairs such as deploy/redeploy and start/restart. Some lifecycle boundaries remain close enough that an agent could occasionally hesitate, especially for applications versus compose services.
Tool names consistently use snake_case with clear verb_noun phrasing, such as list_projects, get_application, read_deployment_logs, and update_compose_env. The convention is predictable across reads, lifecycle actions, and updates.
With 32 tools, the surface is heavy for a single MCP server and exposes many closely related read and lifecycle operations. While Dokploy is broad, this exceeds a comfortably scoped tool set and increases selection overhead.
The server covers reads, logs, monitoring, deployment lifecycle, and environment updates, but lacks significant management operations such as creating/deleting projects, applications, compose services, databases, and domains. These gaps limit end-to-end Dokploy resource management.
Related MCP Connectors
Deploy apps from GitHub, read build/runtime logs, and manage your app's users from your AI agent.
Deploy and manage Jade Hosting projects from AI clients. Jade account and OAuth required.
Deploy your project to a live HTTPS URL from your AI tool; read logs, set variables, resize apps.
Deploy services, add databases, run agents, read logs, check vulnerabilities and publish pages.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables control and management of Coolify self-hosted PaaS instances, allowing you to deploy applications, manage databases, monitor servers, and execute operations directly from AI assistants.8925 npm28MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to manage Portainer container environments through natural language, including deploying stacks, managing containers, images, volumes, networks, and executing commands.53149 PyPI2MIT
- AlicenseAqualityBmaintenanceEnables AI agents to manage self-hosted Coolify v4 instances, including listing applications, safely handling environment variables with masking and dry runs, deploying, restarting, and reading logs.20MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to inspect and manage hosted PocketBase projects, instances, deployments, domains, logs, and diagnostics. It supports OAuth or CLI-token access with read-only or scoped permissions and optional database tools.Apache 2.0