portainer-mcp-server
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., "@portainer-mcp-server show me all containers in environment 1"
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.
portainer-mcp-server
MCP server for the Portainer REST API. Manage Docker containers, stacks, images, networks and volumes from any AI assistant that supports the Model Context Protocol.
Usage
npx portainer-mcp-serverOr with a permanent install:
npm install -g portainer-mcp-server
portainer-mcp-serverRelated MCP server: Docker MCP Server
Configuration
Two environment variables are required:
Variable | Description | Default |
| Portainer base URL |
|
| Portainer API token (Personal Access Token) | (required) |
To generate a PAT: Portainer UI → Account → Access Tokens → Add access token.
OpenCode / Claude Desktop config
{
"mcp": {
"portainer": {
"type": "local",
"command": ["npx", "-y", "portainer-mcp-server"],
"enabled": true,
"environment": {
"PORTAINER_URL": "http://your-portainer-host:9000",
"PORTAINER_PAT": "<your-token>"
}
}
}
}Available tools
Tool | Description |
| List all Portainer environments/endpoints |
| List containers in an environment |
| Get detailed info about a container |
| Get logs from a container |
| Start a stopped container |
| Stop a running container |
| Restart a container |
| List all Portainer stacks |
| Get details of a specific stack |
| Get the docker-compose file of a stack |
| List Docker images in an environment |
| List Docker networks in an environment |
| List Docker volumes in an environment |
License
MIT
Available Tools
18 toolsdelete_imageC
Delete a Docker image
Inputs: imageId (required), environmentId (required), force.
get_container_logsC
Get logs from a container
Inputs: containerId (required), environmentId (required), tail, timestamps.
get_stack_fileA
Get the docker-compose file content of a stack
Inputs: stackId (required).
inspect_containerC
Get detailed info about a container
Inputs: containerId (required), environmentId (required).
inspect_stackC
Get details of a specific stack
Inputs: stackId (required).
list_containersA
List containers in a Portainer environment
Inputs: environmentId (required), all.
list_environmentsA
List all Portainer environments/endpoints
Inputs: no named parameters.
list_imagesB
List Docker images in an environment
Inputs: environmentId (required).
list_networksB
List Docker networks in an environment
Inputs: environmentId (required).
list_stacksA
List all stacks in Portainer
Inputs: no named parameters.
list_volumesB
List Docker volumes in an environment
Inputs: environmentId (required).
portainer_cleanup_unused_imagesB
Delete all unused Docker images with optional force flag
Inputs: environmentId (required), force.
portainer_list_unused_imagesA
List Docker images not used by any container (dangling images)
Inputs: environmentId (required).
pull_imageB
Pull a Docker image from a registry
Inputs: image (required), environmentId (required).
recreate_containerA
Recreate a container with an updated image (stops old container, pulls new image, starts new container)
Inputs: image (required), containerId (required), environmentId (required).
restart_containerC
Restart a container
Inputs: containerId (required), environmentId (required).
start_containerB
Start a stopped container
Inputs: containerId (required), environmentId (required).
stop_containerB
Stop a running container
Inputs: containerId (required), environmentId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Most tools target distinct resource-action pairs, but list_images and portainer_list_unused_images overlap in purpose, as do delete_image and portainer_cleanup_unused_images. However, the names and descriptions clearly distinguish 'all' vs 'unused' variants, reducing ambiguity.
The majority follow a verb_noun pattern (list_, get_, inspect_, start_, stop_, etc.), but the two tools prefixed with portainer_ (portainer_list_unused_images, portainer_cleanup_unused_images) break the pattern. The mix of list/get/inspect verbs is also slightly inconsistent, though still readable.
18 tools is on the heavier side but reasonable for a Docker/Portainer management server covering environments, containers, images, stacks, networks, and volumes. Each tool serves a distinct purpose, with no apparent duplication.
The toolset covers container lifecycle (start/stop/restart/recreate), image management (pull/delete/cleanup), and stack inspection, but lacks container removal, stack create/update/delete, and network/volume mutations. These are notable gaps for a comprehensive Portainer manager.
Maintenance
Related MCP Connectors
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
MCP server for AI dialogue using various LLM models via AceDataCloud
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
Related MCP Servers
- FlicenseAqualityFmaintenanceA Model Context Protocol server that enables Docker container management through natural language interactions using a custom GPT interface.715-
- AlicenseAqualityBmaintenanceUniversal Docker MCP server for AI assistants (Cursor, Claude Desktop). Manage Docker containers, execute commands, query databases, and handle environment configurations — all through natural language.10277 npm1MIT
- AlicenseNot gradedqualityDmaintenanceLightweight MCP server for Portainer CE, focused on Docker Swarm environments with read-only tools by default and optional mutations.MIT
- FlicenseBqualityDmaintenanceMCP server for natural-language control of local Docker, covering containers, images, volumes, networks, and Compose stacks, plus security scanning and diagnostics.34-