Skip to main content

MCP server that exposes Podman container management as tools for AI assistants

Project description

podman-mcp

PyPI version Python License: MIT Podman Claude GitHub Copilot ChatGPT Cursor Windsurf

A Model Context Protocol (MCP) server that exposes Podman container management as tools for AI assistants such as Claude, GitHub Copilot, ChatGPT, Cursor and Windsurf.

With podman-mcp you can manage containers and images through natural language — no need to remember CLI flags.

"Show me all running containers"
"Pull the nginx image and run it on port 8080"
"Show me the last 100 log lines from myapp"


Requirements


Installation

Using pip (recommended)

pip install podman-mcp

From source

# 1. Clone the repository
git clone https://github.com/edtroleis/podman-mcp.git
cd podman-mcp

# 2. Create and activate a virtual environment
python3 -m venv .venv
source .venv/bin/activate

# 3. Install dependencies
pip install -r requirements.txt

Client Configuration

Claude Code

If installed via pip:

claude mcp add --scope user podman-mcp -- podman-mcp

If installed from source:

claude mcp add --scope user podman-mcp -- /absolute/path/to/podman-mcp/.venv/bin/podman-mcp

The --scope user flag makes the server available across all projects, not just the current directory.

Verify:

claude mcp list

Skip confirmation prompts (user scope)

By default, Claude asks for confirmation before calling each tool. To allow all podman-mcp tools to run without prompts across all projects, add the following to ~/.claude/settings.json:

{
  "permissions": {
    "allow": [
      "mcp__podman-mcp__*"
    ]
  }
}

GitHub Copilot (VS Code)

Create .vscode/mcp.json in your workspace.

If installed via pip:

{
  "servers": {
    "podman-mcp": {
      "type": "stdio",
      "command": "podman-mcp"
    }
  }
}

If installed from source:

{
  "servers": {
    "podman-mcp": {
      "type": "stdio",
      "command": "/absolute/path/to/podman-mcp/.venv/bin/podman-mcp"
    }
  }
}

Requires VS Code 1.99+ with GitHub Copilot agent mode enabled.

Note: VS Code does not auto-start MCP servers. After opening Copilot Chat, click the Start button next to podman-mcp in the Tools section once per VS Code session. This is a VS Code security design decision and cannot be configured away.


Cursor

Create or edit ~/.cursor/mcp.json.

If installed via pip:

{
  "mcpServers": {
    "podman-mcp": {
      "command": "podman-mcp"
    }
  }
}

If installed from source:

{
  "mcpServers": {
    "podman-mcp": {
      "command": "/absolute/path/to/podman-mcp/.venv/bin/podman-mcp"
    }
  }
}

Windsurf

Create or edit ~/.codeium/windsurf/mcp_config.json.

If installed via pip:

{
  "mcpServers": {
    "podman-mcp": {
      "command": "podman-mcp"
    }
  }
}

If installed from source:

{
  "mcpServers": {
    "podman-mcp": {
      "command": "/absolute/path/to/podman-mcp/.venv/bin/podman-mcp"
    }
  }
}

ChatGPT and other HTTP clients

Start the server in SSE mode.

If installed via pip:

podman-mcp --transport sse --host 127.0.0.1 --port 8000

If installed from source:

/absolute/path/to/podman-mcp/.venv/bin/podman-mcp --transport sse --host 127.0.0.1 --port 8000

The MCP endpoint will be available at:

http://127.0.0.1:8000/sse

Configure your client to connect to that URL as a remote MCP server.


Using from the Terminal

You can interact with podman-mcp directly from your Linux console using the Claude Code CLI — no IDE required.

Claude Code CLI

Once podman-mcp is registered with --scope user, start an interactive session:

claude

Then ask naturally:

How many images do I have locally?
Pull nginx:latest
Show logs from my nexus container
List all running containers
Remove the alpine image

Claude will automatically use the podman-mcp tools to answer.

Other AI CLIs (HTTP mode)

For AI tools that support remote MCP over HTTP, start the server in SSE mode first:

python3 /absolute/path/to/podman-mcp/server.py --transport sse --host 127.0.0.1 --port 8000

Then point your AI CLI client to:

http://127.0.0.1:8000/sse

Available Tools

Images

Tool Description Parameters
list_images List all local images
pull_image Pull an image from a registry image: str
remove_image Remove an image image: str, force: bool
build_image Build an image from a Dockerfile tag: str, dockerfile: str, context: str
tag_image Tag an image with a new name source: str, target: str
push_image Push an image to a registry image: str
image_history Show layer history of an image image: str

Containers

Tool Description Parameters
list_containers List containers all: bool (include stopped)
run_container Run a container image: str, args: str
stop_container Stop a running container name: str
remove_container Remove a container name: str, force: bool
container_logs Fetch container logs name: str, tail: int
exec_in_container Run a command inside a container name: str, command: str
inspect_container Inspect container configuration name: str
container_stats Show resource usage for running containers name: str (empty for all)

Networks

Tool Description Parameters
network_list List all networks
network_create Create a new network name: str
network_remove Remove a network name: str

Volumes

Tool Description Parameters
volume_list List all volumes
volume_create Create a new volume name: str
volume_remove Remove a volume name: str

Pods

Tool Description Parameters
pod_list List pods all: bool (include stopped)
pod_create Create a new pod name: str
pod_remove Remove a pod name: str, force: bool

System

Tool Description Parameters
system_info Podman disk usage and system stats
login_registry Login to a container registry registry: str, username: str, password: str

Usage Examples

Once registered, interact with Podman using natural language. Examples by category:

Images

How many images do I have locally?
Pull the python:3.12-slim image from Docker Hub
Build an image tagged myapp:latest from the Dockerfile in the current directory
Show the layer history of the debian:latest image
Tag myapp:latest as localhost:8082/myapp:1.0
Push localhost:8082/myapp:1.0 to the registry
Remove the alpine image

Containers

List all running containers
Show me all containers, including stopped ones
Run nginx in detached mode, exposing port 8080 on the host
Show the last 200 log lines from the api container
What is the IP address of the db container?
Show CPU and memory usage for all running containers
Execute the command "df -h" inside the api container
Remove all stopped containers

Networks & Volumes

List all networks
Create a network called backend-net
List all volumes
Create a volume called postgres-data
Remove the volume named postgres-data

Pods

List all pods, including stopped ones
Create a pod called my-pod
Remove the pod my-pod and all its containers

System & Registry

Show Podman disk usage and system stats
Login to localhost:8082 with my credentials

Project Structure

podman-mcp/
├── server.py          # MCP server — all tools are defined here
├── requirements.txt   # Python dependencies
├── CONTRIBUTING.md    # How to contribute
├── LICENSE            # MIT License
└── README.md

Adding New Tools

Open server.py and add a new function decorated with @mcp.tool():

@mcp.tool()
def your_tool_name(param: str) -> str:
    """Clear description — the AI assistant uses this to decide when to call the tool."""
    return run(f"<podman subcommand> {param}")

No re-registration is needed. Restart your AI client session to pick up the new tool.


Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.


License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

podman_mcp-0.1.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

podman_mcp-0.1.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file podman_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: podman_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for podman_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ec138fdcf36672fa917c4dc240378c265e58958e854a8223e15074a9640809dc
MD5 d0209f59efefaf6c361ebfcef25de18b
BLAKE2b-256 95c4d7cebbfeabafcc66ba91dcb8e151e2fc9ddc3b297a6e1fa8fb080d4b218a

See more details on using hashes here.

Provenance

The following attestation bundles were made for podman_mcp-0.1.1.tar.gz:

Publisher: publish.yml on edtroleis/podman-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file podman_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: podman_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for podman_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 248592a6f79a5d3cd824b09aabe83c61ad4060333858ff9342f5e09d925416c0
MD5 c0ec91eb6f5c60e90e39efa1b2d257cb
BLAKE2b-256 57c3a35b335b9c1e3ae2b70d0e5f6dd46cf9a268576830d691dbb039e7486493

See more details on using hashes here.

Provenance

The following attestation bundles were made for podman_mcp-0.1.1-py3-none-any.whl:

Publisher: publish.yml on edtroleis/podman-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page