podman-mcp 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- podman_mcp-0.1.0/LICENSE +21 -0
- podman_mcp-0.1.0/PKG-INFO +414 -0
- podman_mcp-0.1.0/README.md +382 -0
- podman_mcp-0.1.0/podman_mcp/__init__.py +0 -0
- podman_mcp-0.1.0/podman_mcp/server.py +191 -0
- podman_mcp-0.1.0/podman_mcp.egg-info/PKG-INFO +414 -0
- podman_mcp-0.1.0/podman_mcp.egg-info/SOURCES.txt +11 -0
- podman_mcp-0.1.0/podman_mcp.egg-info/dependency_links.txt +1 -0
- podman_mcp-0.1.0/podman_mcp.egg-info/entry_points.txt +2 -0
- podman_mcp-0.1.0/podman_mcp.egg-info/requires.txt +1 -0
- podman_mcp-0.1.0/podman_mcp.egg-info/top_level.txt +1 -0
- podman_mcp-0.1.0/pyproject.toml +21 -0
- podman_mcp-0.1.0/setup.cfg +4 -0
podman_mcp-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 edtroleis
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: podman-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server that exposes Podman container management as tools for AI assistants
|
|
5
|
+
License: MIT License
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2026 edtroleis
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
|
26
|
+
|
|
27
|
+
Requires-Python: >=3.10
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Requires-Dist: mcp>=1.0.0
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
# podman-mcp
|
|
34
|
+
|
|
35
|
+
A [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that exposes [Podman](https://podman.io) container management as tools for AI assistants such as [Claude](https://claude.ai), [GitHub Copilot](https://github.com/features/copilot), [ChatGPT](https://chatgpt.com), [Cursor](https://www.cursor.com) and [Windsurf](https://windsurf.com).
|
|
36
|
+
|
|
37
|
+
With `podman-mcp` you can manage containers and images through natural language — no need to remember CLI flags.
|
|
38
|
+
|
|
39
|
+
> "Show me all running containers"
|
|
40
|
+
> "Pull the nginx image and run it on port 8080"
|
|
41
|
+
> "Show me the last 100 log lines from myapp"
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Requirements
|
|
46
|
+
|
|
47
|
+
- Python 3.10+
|
|
48
|
+
- [Podman](https://podman.io/docs/installation) installed and available in `$PATH`
|
|
49
|
+
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI **or** any MCP-compatible client
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# 1. Clone the repository
|
|
57
|
+
git clone https://github.com/edtroleis/podman-mcp.git
|
|
58
|
+
cd podman-mcp
|
|
59
|
+
|
|
60
|
+
# 2. Create and activate a virtual environment
|
|
61
|
+
python3 -m venv .venv
|
|
62
|
+
source .venv/bin/activate
|
|
63
|
+
|
|
64
|
+
# 3. Install dependencies
|
|
65
|
+
pip install -r requirements.txt
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Client Configuration
|
|
71
|
+
|
|
72
|
+
### Claude Code
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
claude mcp add --scope user podman-mcp -- /absolute/path/to/podman-mcp/.venv/bin/python3 /absolute/path/to/podman-mcp/server.py
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The `--scope user` flag makes the server available across all projects, not just the current directory.
|
|
79
|
+
|
|
80
|
+
Verify:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
claude mcp list
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
#### Skip confirmation prompts (user scope)
|
|
87
|
+
|
|
88
|
+
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`:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"permissions": {
|
|
93
|
+
"allow": [
|
|
94
|
+
"mcp__podman-mcp__*"
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
### GitHub Copilot (VS Code)
|
|
103
|
+
|
|
104
|
+
Create `.vscode/mcp.json` in your workspace:
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"servers": {
|
|
109
|
+
"podman-mcp": {
|
|
110
|
+
"type": "stdio",
|
|
111
|
+
"command": "/absolute/path/to/podman-mcp/.venv/bin/python3",
|
|
112
|
+
"args": ["/absolute/path/to/podman-mcp/server.py"]
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Requires VS Code 1.99+ with GitHub Copilot agent mode enabled.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
### Cursor
|
|
123
|
+
|
|
124
|
+
Create or edit `~/.cursor/mcp.json`:
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"mcpServers": {
|
|
129
|
+
"podman-mcp": {
|
|
130
|
+
"command": "/absolute/path/to/podman-mcp/.venv/bin/python3",
|
|
131
|
+
"args": ["/absolute/path/to/podman-mcp/server.py"]
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
### Windsurf
|
|
140
|
+
|
|
141
|
+
Create or edit `~/.codeium/windsurf/mcp_config.json`:
|
|
142
|
+
|
|
143
|
+
```json
|
|
144
|
+
{
|
|
145
|
+
"mcpServers": {
|
|
146
|
+
"podman-mcp": {
|
|
147
|
+
"command": "/absolute/path/to/podman-mcp/.venv/bin/python3",
|
|
148
|
+
"args": ["/absolute/path/to/podman-mcp/server.py"]
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
### ChatGPT and other HTTP clients
|
|
157
|
+
|
|
158
|
+
Start the server in SSE mode:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
python3 server.py --transport sse --host 127.0.0.1 --port 8000
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
The MCP endpoint will be available at:
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
http://127.0.0.1:8000/sse
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Configure your client to connect to that URL as a remote MCP server.
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Using from the Terminal
|
|
175
|
+
|
|
176
|
+
You can interact with podman-mcp directly from your Linux console using the Claude Code CLI — no IDE required.
|
|
177
|
+
|
|
178
|
+
### Claude Code CLI
|
|
179
|
+
|
|
180
|
+
Once podman-mcp is registered with `--scope user`, start an interactive session:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
claude
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Then ask naturally:
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
How many images do I have locally?
|
|
190
|
+
```
|
|
191
|
+
```
|
|
192
|
+
Pull nginx:latest
|
|
193
|
+
```
|
|
194
|
+
```
|
|
195
|
+
Show logs from my nexus container
|
|
196
|
+
```
|
|
197
|
+
```
|
|
198
|
+
List all running containers
|
|
199
|
+
```
|
|
200
|
+
```
|
|
201
|
+
Remove the alpine image
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Claude will automatically use the podman-mcp tools to answer.
|
|
205
|
+
|
|
206
|
+
### Other AI CLIs (HTTP mode)
|
|
207
|
+
|
|
208
|
+
For AI tools that support remote MCP over HTTP, start the server in SSE mode first:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
python3 /absolute/path/to/podman-mcp/server.py --transport sse --host 127.0.0.1 --port 8000
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Then point your AI CLI client to:
|
|
215
|
+
|
|
216
|
+
```
|
|
217
|
+
http://127.0.0.1:8000/sse
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Available Tools
|
|
223
|
+
|
|
224
|
+
### Images
|
|
225
|
+
|
|
226
|
+
| Tool | Description | Parameters |
|
|
227
|
+
|---|---|---|
|
|
228
|
+
| `list_images` | List all local images | — |
|
|
229
|
+
| `pull_image` | Pull an image from a registry | `image: str` |
|
|
230
|
+
| `remove_image` | Remove an image | `image: str`, `force: bool` |
|
|
231
|
+
| `build_image` | Build an image from a Dockerfile | `tag: str`, `dockerfile: str`, `context: str` |
|
|
232
|
+
| `tag_image` | Tag an image with a new name | `source: str`, `target: str` |
|
|
233
|
+
| `push_image` | Push an image to a registry | `image: str` |
|
|
234
|
+
| `image_history` | Show layer history of an image | `image: str` |
|
|
235
|
+
|
|
236
|
+
### Containers
|
|
237
|
+
|
|
238
|
+
| Tool | Description | Parameters |
|
|
239
|
+
|---|---|---|
|
|
240
|
+
| `list_containers` | List containers | `all: bool` (include stopped) |
|
|
241
|
+
| `run_container` | Run a container | `image: str`, `args: str` |
|
|
242
|
+
| `stop_container` | Stop a running container | `name: str` |
|
|
243
|
+
| `remove_container` | Remove a container | `name: str`, `force: bool` |
|
|
244
|
+
| `container_logs` | Fetch container logs | `name: str`, `tail: int` |
|
|
245
|
+
| `exec_in_container` | Run a command inside a container | `name: str`, `command: str` |
|
|
246
|
+
| `inspect_container` | Inspect container configuration | `name: str` |
|
|
247
|
+
| `container_stats` | Show resource usage for running containers | `name: str` (empty for all) |
|
|
248
|
+
|
|
249
|
+
### Networks
|
|
250
|
+
|
|
251
|
+
| Tool | Description | Parameters |
|
|
252
|
+
|---|---|---|
|
|
253
|
+
| `network_list` | List all networks | — |
|
|
254
|
+
| `network_create` | Create a new network | `name: str` |
|
|
255
|
+
| `network_remove` | Remove a network | `name: str` |
|
|
256
|
+
|
|
257
|
+
### Volumes
|
|
258
|
+
|
|
259
|
+
| Tool | Description | Parameters |
|
|
260
|
+
|---|---|---|
|
|
261
|
+
| `volume_list` | List all volumes | — |
|
|
262
|
+
| `volume_create` | Create a new volume | `name: str` |
|
|
263
|
+
| `volume_remove` | Remove a volume | `name: str` |
|
|
264
|
+
|
|
265
|
+
### Pods
|
|
266
|
+
|
|
267
|
+
| Tool | Description | Parameters |
|
|
268
|
+
|---|---|---|
|
|
269
|
+
| `pod_list` | List pods | `all: bool` (include stopped) |
|
|
270
|
+
| `pod_create` | Create a new pod | `name: str` |
|
|
271
|
+
| `pod_remove` | Remove a pod | `name: str`, `force: bool` |
|
|
272
|
+
|
|
273
|
+
### System
|
|
274
|
+
|
|
275
|
+
| Tool | Description | Parameters |
|
|
276
|
+
|---|---|---|
|
|
277
|
+
| `system_info` | Podman disk usage and system stats | — |
|
|
278
|
+
| `login_registry` | Login to a container registry | `registry: str`, `username: str`, `password: str` |
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Usage Examples
|
|
283
|
+
|
|
284
|
+
Once registered, interact with Podman using natural language. Examples by category:
|
|
285
|
+
|
|
286
|
+
### Images
|
|
287
|
+
|
|
288
|
+
```
|
|
289
|
+
How many images do I have locally?
|
|
290
|
+
```
|
|
291
|
+
```
|
|
292
|
+
Pull the python:3.12-slim image from Docker Hub
|
|
293
|
+
```
|
|
294
|
+
```
|
|
295
|
+
Build an image tagged myapp:latest from the Dockerfile in the current directory
|
|
296
|
+
```
|
|
297
|
+
```
|
|
298
|
+
Show the layer history of the debian:latest image
|
|
299
|
+
```
|
|
300
|
+
```
|
|
301
|
+
Tag myapp:latest as localhost:8082/myapp:1.0
|
|
302
|
+
```
|
|
303
|
+
```
|
|
304
|
+
Push localhost:8082/myapp:1.0 to the registry
|
|
305
|
+
```
|
|
306
|
+
```
|
|
307
|
+
Remove the alpine image
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Containers
|
|
311
|
+
|
|
312
|
+
```
|
|
313
|
+
List all running containers
|
|
314
|
+
```
|
|
315
|
+
```
|
|
316
|
+
Show me all containers, including stopped ones
|
|
317
|
+
```
|
|
318
|
+
```
|
|
319
|
+
Run nginx in detached mode, exposing port 8080 on the host
|
|
320
|
+
```
|
|
321
|
+
```
|
|
322
|
+
Show the last 200 log lines from the api container
|
|
323
|
+
```
|
|
324
|
+
```
|
|
325
|
+
What is the IP address of the db container?
|
|
326
|
+
```
|
|
327
|
+
```
|
|
328
|
+
Show CPU and memory usage for all running containers
|
|
329
|
+
```
|
|
330
|
+
```
|
|
331
|
+
Execute the command "df -h" inside the api container
|
|
332
|
+
```
|
|
333
|
+
```
|
|
334
|
+
Remove all stopped containers
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### Networks & Volumes
|
|
338
|
+
|
|
339
|
+
```
|
|
340
|
+
List all networks
|
|
341
|
+
```
|
|
342
|
+
```
|
|
343
|
+
Create a network called backend-net
|
|
344
|
+
```
|
|
345
|
+
```
|
|
346
|
+
List all volumes
|
|
347
|
+
```
|
|
348
|
+
```
|
|
349
|
+
Create a volume called postgres-data
|
|
350
|
+
```
|
|
351
|
+
```
|
|
352
|
+
Remove the volume named postgres-data
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### Pods
|
|
356
|
+
|
|
357
|
+
```
|
|
358
|
+
List all pods, including stopped ones
|
|
359
|
+
```
|
|
360
|
+
```
|
|
361
|
+
Create a pod called my-pod
|
|
362
|
+
```
|
|
363
|
+
```
|
|
364
|
+
Remove the pod my-pod and all its containers
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### System & Registry
|
|
368
|
+
|
|
369
|
+
```
|
|
370
|
+
Show Podman disk usage and system stats
|
|
371
|
+
```
|
|
372
|
+
```
|
|
373
|
+
Login to localhost:8082 with my credentials
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
## Project Structure
|
|
379
|
+
|
|
380
|
+
```
|
|
381
|
+
podman-mcp/
|
|
382
|
+
├── server.py # MCP server — all tools are defined here
|
|
383
|
+
├── requirements.txt # Python dependencies
|
|
384
|
+
├── CONTRIBUTING.md # How to contribute
|
|
385
|
+
├── LICENSE # MIT License
|
|
386
|
+
└── README.md
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
## Adding New Tools
|
|
392
|
+
|
|
393
|
+
Open [server.py](server.py) and add a new function decorated with `@mcp.tool()`:
|
|
394
|
+
|
|
395
|
+
```python
|
|
396
|
+
@mcp.tool()
|
|
397
|
+
def your_tool_name(param: str) -> str:
|
|
398
|
+
"""Clear description — Claude uses this to decide when to call the tool."""
|
|
399
|
+
return run(f"<podman subcommand> {param}")
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
No re-registration is needed. Restart your AI client session to pick up the new tool.
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
## Contributing
|
|
407
|
+
|
|
408
|
+
Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
## License
|
|
413
|
+
|
|
414
|
+
[MIT](LICENSE)
|