MCPs/portainer/README.md

90 lines
5.2 KiB
Markdown
Raw Normal View History

# portainer-mcp
MCP server for Portainer (Docker/K8s management).
Source: [`portainer-mcp`](https://pypi.org/project/portainer-mcp/) (v0.5.1)
## Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| `PORTAINER_URL` | Yes | Base URL of the Portainer instance (e.g. `https://portainer.corentic.eu`) |
| `PORTAINER_USERNAME` | Yes | Portainer username (use `admin` if using API key) |
| `PORTAINER_PASSWORD` | Yes | Portainer password or API key |
| `PORTAINER_VERIFY_SSL` | No | Verify SSL certificate (`true`/`false`, default: `true`) |
| `PORTAINER_DEFAULT_ENDPOINT` | No | Default endpoint ID (default: `1`) |
| `PORTAINER_TIMEOUT` | No | Request timeout in seconds (default: `30`) |
| `PORTAINER_LONG_TIMEOUT` | No | Long request timeout in seconds (default: `300`) |
## Usage
```bash
docker run -d \
--name portainer-mcp \
-p 8110:8110 \
-e PORTAINER_URL=https://portainer.corentic.eu \
-e PORTAINER_USERNAME=admin \
-e PORTAINER_PASSWORD=your_api_key_or_password \
-e PORTAINER_VERIFY_SSL=false \
forgejo.corentic.eu/corentic/mcp-fleet-portainer:latest
```
## Tools
### Auth & System
- **`portainer_status`** — Verify connection to Portainer and auth status
- **`portainer_docker_info`** — Docker system info. Params: `endpoint_id`
- **`portainer_docker_disk_usage`** — Docker disk usage. Params: `endpoint_id`
### Endpoints (Environments)
- **`portainer_endpoints_list`** — List all environments (Docker/K8s endpoints)
- **`portainer_endpoint_inspect`** — Inspect endpoint details. Params: `endpoint_id`
### Containers
- **`portainer_containers_list`** — List containers. Params: `endpoint_id`, `all`, `limit`, `filters`
- **`portainer_container_inspect`** — Inspect container. Params: `endpoint_id`, `container_id`
- **`portainer_container_start`** — Start container. Params: `endpoint_id`, `container_id`
- **`portainer_container_stop`** — Stop container. Params: `endpoint_id`, `container_id`
- **`portainer_container_restart`** — Restart container. Params: `endpoint_id`, `container_id`
- **`portainer_container_remove`** — Remove container. Params: `endpoint_id`, `container_id`, `force`, `remove_volumes`
- **`portainer_container_logs`** — Get container logs. Params: `endpoint_id`, `container_id`, `tail`, `stdout`, `stderr`
- **`portainer_container_logs_grep`** — Search container logs for pattern. Params: `endpoint_id`, `container_id`, `pattern`, `tail`, `stdout`, `stderr`
- **`portainer_container_stats`** — Get container stats (CPU, memory, etc.). Params: `endpoint_id`, `container_id`
- **`portainer_container_exec`** — Execute command in container. Params: `endpoint_id`, `container_id`, `command`, `workdir`, `timeout`
### Stacks
- **`portainer_stacks_list`** — List stacks. Params: `endpoint_id`
- **`portainer_stack_inspect`** — Inspect stack. Params: `stack_id`
- **`portainer_stack_deploy`** — Deploy stack from compose. Params: `endpoint_id`, `name`, `compose_content`, `env_vars`
- **`portainer_stack_update`** — Update stack compose. Params: `stack_id`, `endpoint_id`, `compose_content`, `env_vars`, `prune`, `pull_image`
- **`portainer_stack_delete`** — Delete stack. Params: `stack_id`, `endpoint_id`
- **`portainer_stack_start`** — Start stack. Params: `stack_id`, `endpoint_id`
- **`portainer_stack_stop`** — Stop stack. Params: `stack_id`, `endpoint_id`
- **`portainer_stack_logs_errors`** — Scan stack container logs for errors. Params: `endpoint_id`, `stack_name`
- **`portainer_laravel_errors`** — Scan for Laravel errors in stack containers. Params: `endpoint_id`, `stack_name`
- **`portainer_laravel_tinker`** — Run Laravel tinker in container. Params: `endpoint_id`, `stack_name`, `command`, `service`
### Images
- **`portainer_images_list`** — List images. Params: `endpoint_id`, `with_usage`
- **`portainer_image_inspect`** — Inspect image. Params: `endpoint_id`, `image_ref`
- **`portainer_image_pull`** — Pull image from registry. Params: `endpoint_id`, `image`, `registry_auth`
- **`portainer_image_remove`** — Remove image. Params: `endpoint_id`, `image_ref`, `force`
### Networks
- **`portainer_networks_list`** — List networks. Params: `endpoint_id`
- **`portainer_network_inspect`** — Inspect network. Params: `endpoint_id`, `network_id`
- **`portainer_network_create`** — Create network. Params: `endpoint_id`, `name`, `driver`, `subnet`, `gateway`
- **`portainer_network_remove`** — Remove network. Params: `endpoint_id`, `network_id`
- **`portainer_network_connect`** — Connect container to network. Params: `endpoint_id`, `network_id`, `container_id`
- **`portainer_network_disconnect`** — Disconnect container from network. Params: `endpoint_id`, `network_id`, `container_id`, `force`
### Volumes
- **`portainer_volumes_list`** — List volumes. Params: `endpoint_id`
- **`portainer_volume_inspect`** — Inspect volume. Params: `endpoint_id`, `volume_id`
- **`portainer_volume_create`** — Create volume. Params: `endpoint_id`, `name`, `driver`, `labels`
- **`portainer_volume_remove`** — Remove volume. Params: `endpoint_id`, `volume_id`, `force`
### Users
- **`portainer_users_list`** — List Portainer users
- **`portainer_user_inspect`** — Inspect user. Params: `user_id`