# Dokku MCP for AI Agents MCP

> Dokku MCP lets you manage self-hosted applications and containers using natural language commands. Stop logging into dashboards or SSHing just to check a service status. Connect your AI agent to this MCP and get full control over your PaaS environment, allowing you to scale processes, audit environment variables, deploy updates, and stream live logs entirely through conversation.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Tags:** container-orchestration, paas, self-hosted, deployment, server-management, environment-variables, log-streaming

## Description

Managing self-hosted infrastructure can be a nightmare of CLI commands, dashboard clicks, and forgotten credentials. This connector hands you back the command line's power without forcing you to learn it. By connecting your AI agent to this MCP, you gain conversational control over everything running on your private PaaS. You can list every deployed application or dismantle an entire setup instantly, all while talking to your AI client. It means getting accurate environment variables and SQL credentials without ever logging into the underlying VM. Need to scale up web workers during a traffic spike? Ask for it. Run a one-off database migration script safely in isolation? Done. The Vinkius catalog makes connecting this kind of deep infrastructure control easy, allowing you to manage your entire application lifecycle from a single chat window.

## Tools

### create_app
Sets up the basic network structure needed for a new self-hosted application boundary on your Dokku VM.

### destroy_app
Deletes an entire app, including all running containers and associated DNS routing records.

### get_logs
Streams the live standard output and error logs from your application's closed Docker containers for debugging.

### list_apps
Retrieves a list of all self-hosted applications currently deployed and managed by Dokku Core.

### list_config
Extracts the specific environment variables loaded into an application, such as SQL credentials or external API tokens.

### ps_restart
Forces a dynamic restart of a running application container to apply changes while maintaining zero downtime for other replicas.

### ps_scale
Changes the structural replica count, determining if web frontends or background worker tasks should increase or decrease.

### run_command
Boots a temporary isolated container to execute single commands safely, perfect for maintenance tasks like running scripts.

### set_config
Injects new environment variables into an active application and triggers the mandatory deployment cycle to use them.

### unset_config
Removes sensitive configuration values from the app, forcing a replacement cycle to ensure they are no longer accessible.

## Prompt Examples

**Prompt:** 
```
List all my self-hosted apps and check if anything needs attention.
```

**Response:** 
```
**Dokku App Inventory**

*   `api-gateway`: Status: Running | Scale: 3/3 (Web) | Last Deployment: 2 hours ago
*   `worker-queue`: Status: Running | Scale: 1/1 (Worker)
*   `frontend-web`: Status: Down | Scale: 0/1 (Web)

**Action Required:** The `frontend-web` container is currently down. Would you like me to restart it, or should I check the logs first using the `get_logs` tool?
```

**Prompt:** 
```
I need to update my database credentials for the main API service.
```

**Response:** 
```
**Configuration Update Required**

To update the credentials for `api-gateway`, we must use a multi-step process:

1.  Run `unset_config` on the old variable (`DATABASE_PASSWORD`).
2.  Provide the new, secure credential.
3.  I will then execute `set_config` and trigger the rolling deployment to ensure zero downtime.
```

**Prompt:** 
```
Can you make sure my worker processes are scaled up for a big data job?
```

**Response:** 
```
**Scaling Request Accepted**

The current web process scale is 2. I've received your request to boost the workers. Running `ps_scale` now to set the replica count for 'worker-queue' to 10.

*Status:* Scaling initiated... ⏳

I will notify you when the internal load balancer confirms all 10 worker endpoints are active and ready.
```

## Capabilities

### List all deployed applications
Retrieves an inventory of every container and service currently managed by your self-hosted Dokku instance.

### Deploy or remove services
Instantly provisions new application boundaries, or completely tears down existing containers and their DNS records in one conversation.

### Check environment settings
Reads the exact runtime configuration variables (like database keys or API tokens) bound to a specific running app.

### Update application configuration
Injects new sensitive environment variables and forces a rolling deployment across your cluster to ensure the changes take effect immediately.

### Adjust container scaling
Directly manipulates replica counts, telling the system whether web frontends or background worker tasks need to spin up or down.

### Stream live logs and run commands
Pulls real-time execution tails for debugging request stacks, or launches raw, isolated containers for maintenance scripts like database migrations.

## Use Cases

### Debugging a slow endpoint
The agent finds that the 'api-gateway' is timing out. You ask it for logs, and the MCP uses `get_logs` to pull precise system execution tails showing slow SQL queries inside the containers. The bottleneck is immediately obvious.

### Rolling out a database migration
A new feature requires an updated schema. Instead of manually running a script, you instruct the agent to use `run_command` for a one-off execution of 'rake db:migrate' in an isolated container, ensuring the main app isn't interrupted.

### Scaling up for peak traffic
It’s Black Friday. The web process is struggling. You ask the agent to scale the web worker to five replicas using `ps_scale`. The MCP handles the load balancing update automatically, giving you immediate relief.

### Revoking an expired token
An API key expires and needs replacement. Instead of manually finding the config file, you tell the agent to use `unset_config` for the old key, then immediately use `set_config` with the new secret, triggering a safe redeployment.

## Benefits

- Eliminate repetitive CLI work. Instead of running `dokku list` or checking dashboards, you just ask your agent to 'list all apps' via the `list_apps` tool.
- Achieve true zero-downtime updates. When you change a key setting using `set_config`, the MCP handles the rolling deployment automatically, keeping your service live while it updates.
- Deep debugging without SSH access. The `get_logs` tool pulls detailed system execution tails and backtraces directly into the chat for rapid troubleshooting.
- Control resources precisely. You can tell the agent to scale specific containers using `ps_scale`, ensuring workers spool up exactly when traffic demands it, saving compute costs.
- Safe credential handling. Need to audit an API key? Use `list_config` to see the environment variables without ever having to manually access sensitive files or secrets managers.

## How It Works

The bottom line is that it turns complex terminal workflows into simple, conversational requests.

1. First, subscribe to the Dokku MCP on Vinkius and provide your specific Dokku Host URL and API Token.
2. Next, connect this MCP to your preferred AI client. The agent authenticates with your private cloud instance.
3. Finally, you interact by asking natural language questions, and the agent executes the necessary infrastructure commands against your self-hosted PaaS.

## Frequently Asked Questions

**How do I manage my self-hosted containers using the Dokku MCP for AI Agents?**
You interact with your infrastructure by simply asking questions. You can ask to scale processes, check logs, or list deployments—it converts complex terminal commands into conversational requests.

**Does connecting the Dokku MCP for AI Agents mean I don't need SSH access anymore?**
Not usually. This MCP allows your agent to perform crucial tasks like logging and scaling without you needing manual SSH access, automating those routine checks into a chat interface.

**What if I need to run a one-off migration script for my app?**
You can use the MCP's capabilities to launch raw commands inside temporary, isolated containers. This lets you safely run scripts like migrations without affecting your live web traffic.

**Can I update sensitive environment variables with this Dokku MCP for AI Agents?**
Yes. You can inject or remove secrets and credentials using the MCP tools, which then forces a rolling deployment to ensure the change is applied safely across all your running services.

**Is this only for web apps, or can it handle background workers too?**
It handles everything. You can monitor and scale both the front-facing web containers and dedicated worker background tasks using specific tools like `ps_scale` to match demand.

**How does the Dokku MCP for AI Agents handle deployment updates?**
It manages it automatically. When you update a configuration or code, the MCP triggers a controlled rolling deployment cycle that minimizes downtime and ensures all replicas get the new version safely.