Provides comprehensive container management capabilities including listing, starting, stopping, and restarting containers, executing commands inside containers, viewing logs, managing images, and monitoring resource usage through Podman's container runtime.
Podman MCP Server
Container management made accessible through the Model Context Protocol.
Overview
The Podman MCP Server exposes container management capabilities through MCP, allowing AI tools and applications to:
List and inspect running containers
Start, stop, and restart containers
Execute commands inside containers
View container logs
Manage container images
Monitor container resource usage
Designed for seamless integration with the MCP Discovery Hub for automatic network discovery.
Features
Container Management
List containers: View all running or stopped containers
Container info: Inspect detailed container information
Start/Stop/Restart: Control container lifecycle
Execute commands: Run commands inside containers
View logs: Access container logs with configurable line count
Resource stats: Monitor CPU, memory, and I/O usage
Image Management
List images: View all available container images
Pull images: Download images from registries
Network Discovery
Automatic broadcasting: Announces itself on the network via multicast
Zero-configuration: No manual registration needed
Multi-transport support: Works with HTTP and streamable-http
Installation
Prerequisites
Python 3.10+
Podman installed and running
uv
package manager (orpip
)
Setup
Configuration
Environment Variables
.env File
Create a .env
file in the project root:
Usage
Start in HTTP Mode (with broadcasting)
Start in Streamable-HTTP Mode
Start in Stdio Mode (for Claude)
Available Tools
Containers
List Containers
List running containers (or all if all=true
)
Example:
Container Info
Get detailed information about a specific container
Start Container
Start a stopped container
Stop Container
Stop a running container (gracefully, with timeout in seconds)
Restart Container
Restart a container
Container Logs
Get logs from a container (last N lines)
Run Container
Run a new container
Example:
Remove Container
Remove a container (force if running)
Exec in Container
Execute a command inside a container
Container Stats
Get resource usage statistics for containers
Images
List Images
List available container images
Pull Image
Pull/download an image from a registry
Integration with MCP Discovery Hub
Automatic Discovery
When broadcasting is enabled, this server automatically registers with the MCP Discovery Hub:
Server broadcasts: Every 30 seconds, announces itself on
239.255.255.250:5353
Hub discovers: Discovery hub receives announcement and probes the server
Tools registered: All 12 container management tools become available network-wide
Manual Registration
If running without broadcasting:
API Endpoints (When in HTTP Mode)
GET /
Server info endpoint
Response:
POST /mcp
MCP protocol endpoint
All MCP communication happens here (initialize, tools/list, tools/call)
Use Cases
1. Container Orchestration
Use with AI tools to manage containerized applications:
2. Monitoring and Debugging
Check container status and logs:
3. Multi-Server Management
Deploy and manage containers across multiple hosts:
4. Development Workflows
Quickly spin up development environments:
Logs
Server logs are written to podman_mcp.log
:
Troubleshooting
Port Already in Use
Broadcasting Not Working
Check multicast connectivity:
Podman Connection Error
Ensure Podman is running:
Performance Considerations
Container operations: Most operations complete within 100-500ms
Log retrieval: Depends on log size and network speed
Broadcasting overhead: Minimal (30-byte UDP packets every 30 seconds)
Connection pooling: Configured with pool_size=5 for efficiency
Security
Best Practices
Run in isolated networks: Deploy in trusted network environments
Use firewall rules: Restrict access to the MCP port
Disable broadcasting in untrusted networks: Set
MCP_ENABLE_BROADCAST=false
Monitor logs: Regularly check for unauthorized access attempts
Limitations
No built-in authentication (rely on network security)
No resource quotas (AI can run unlimited containers)
Commands run with same privileges as Podman daemon
Consider adding a reverse proxy with authentication for production use.
Requirements
Python 3.10+
FastAPI
SQLAlchemy
FastMCP
python-dotenv
Contributing
Improvements welcome! Areas for enhancement:
Container networking configuration
Image building and pushing
Volume management
Container health monitoring
Network performance metrics
License
MIT License - See LICENSE file for details
Support
Issues: Report on GitHub
Documentation: See MCP Discovery Hub wiki
Examples: Check examples/ directory
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables AI tools to manage containerized applications through Podman, supporting container lifecycle operations, command execution, log viewing, image management, and resource monitoring. Features automatic network discovery for seamless integration with MCP Discovery Hub.