/ Directory / Playground / Portainer MCP
● Official portainer ⚡ Instant

Portainer MCP

by portainer · portainer/portainer-mcp

Manage Docker, Kubernetes, and Swarm via Portainer through MCP.

The official Portainer MCP exposes container, image, volume, and Kubernetes management against any Portainer Business or Community instance. Use Claude to inspect running stacks, restart unhealthy containers, or pull logs from any environment Portainer manages.

Why use it

Key features

Live Demo

What it looks like in practice

portainer-mcp.replay ▶ ready
0/0

Install

Pick your client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "portainer-mcp": {
      "command": "uvx",
      "args": [
        "portainer-mcp"
      ]
    }
  }
}

Open Claude Desktop → Settings → Developer → Edit Config. Restart after saving.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "portainer-mcp": {
      "command": "uvx",
      "args": [
        "portainer-mcp"
      ]
    }
  }
}

Cursor uses the same mcpServers schema as Claude Desktop. Project config wins over global.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "portainer-mcp": {
      "command": "uvx",
      "args": [
        "portainer-mcp"
      ]
    }
  }
}

Click the MCP Servers icon in the Cline sidebar, then "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "portainer-mcp": {
      "command": "uvx",
      "args": [
        "portainer-mcp"
      ]
    }
  }
}

Same shape as Claude Desktop. Restart Windsurf to pick up changes.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "portainer-mcp",
      "command": "uvx",
      "args": [
        "portainer-mcp"
      ]
    }
  ]
}

Continue uses an array of server objects rather than a map.

~/.config/zed/settings.json
{
  "context_servers": {
    "portainer-mcp": {
      "command": {
        "path": "uvx",
        "args": [
          "portainer-mcp"
        ]
      }
    }
  }
}

Add to context_servers. Zed hot-reloads on save.

claude mcp add portainer-mcp -- uvx portainer-mcp

One-liner. Verify with claude mcp list. Remove with claude mcp remove.

Use Cases

Real-world ways to use Portainer MCP

Triage which containers are unhealthy across the fleet

👤 DevOps / SRE ⏱ ~15 min intermediate

When to use: You manage many envs through Portainer and need a fleet-wide health snapshot.

Prerequisites
  • Server/skill installed and authenticated — See repo README
Flow
  1. Inventory
    List every environment Portainer manages. For each, count running, exited, and unhealthy containers.✓ Copied
    → Per-env health table
  2. Drill in
    For the env with the most unhealthy containers, show the last 50 log lines from each and tell me what's failing.✓ Copied
    → Root-cause hypothesis per container

Outcome: Fleet-wide triage in one chat, prioritized by impact.

Pitfalls
  • Granting an API token full admin to give Claude broad access is risky — Granting an API token full admin to give Claude broad access is risky — scope to read-only first, then escalate per-task.

Combinations

Pair with other MCPs for X10 leverage

portainer-mcp + kubernetes-mcp-server

Pair with kubernetes-mcp-server for complementary capabilities

Use this server together with kubernetes-mcp-server to complete a multi-step task.✓ Copied
portainer-mcp + filesystem

Pair with filesystem for complementary capabilities

Use this server together with filesystem to complete a multi-step task.✓ Copied

Tools

What this MCP exposes

ToolInputsWhen to callCost
list_environments (none) Discover which clusters Portainer manages 1 API call
list_containers environment_id, filter Inventory running containers in one env 1 API call
container_logs environment_id, container_id, lines Triage a misbehaving container 1 API call
container_restart environment_id, container_id Bounce an unhealthy container 1 API call

Cost & Limits

What this costs to run

API quota
See provider docs for rate limits
Tokens per call
Varies by tool
Monetary
See repo README for pricing details
Tip
Cache tool results and avoid repeated identical calls.

Security

Permissions, secrets, blast radius

Credential storage: Use environment variables; never commit secrets
Data egress: Tool calls go to the provider's API as documented

Troubleshooting

Common errors and fixes

401 Unauthorized

Create an API token in Portainer (User settings → Access tokens) and set PORTAINER_API_KEY.

Verify: list_environments returns a list
Endpoint not found

Token must have access to the requested environment. Check team/endpoint permissions in Portainer.

Verify: list_environments returns the target env

Alternatives

Portainer MCP vs others

AlternativeWhen to use it insteadTradeoff
Rancher MCPYou're a Rancher shopDifferent feature set; Portainer is broader on plain Docker

More

Resources

📖 Read the official README on GitHub

🐙 Browse open issues

🔍 Browse all 400+ MCP servers and Skills