Skip to main content
Glama
hlavrencic

portainer-mcp-server

by hlavrencic

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-server

Or with a permanent install:

npm install -g portainer-mcp-server
portainer-mcp-server

Related MCP server: ChatGPT MCP Server

Configuration

Two environment variables are required:

Variable

Description

Default

PORTAINER_URL

Portainer base URL

http://localhost:9000

PORTAINER_PAT

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_environments

List all Portainer environments/endpoints

list_containers

List containers in an environment

inspect_container

Get detailed info about a container

get_container_logs

Get logs from a container

start_container

Start a stopped container

stop_container

Stop a running container

restart_container

Restart a container

list_stacks

List all Portainer stacks

inspect_stack

Get details of a specific stack

get_stack_file

Get the docker-compose file of a stack

list_images

List Docker images in an environment

list_networks

List Docker networks in an environment

list_volumes

List Docker volumes in an environment

License

MIT

A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hlavrencic/portainer-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server