Skip to content

Commit 871df15

Browse files
authored
Merge pull request #5 from Rhevin/fix/ci_issue
fix: CI issues
2 parents edcec90 + 4681770 commit 871df15

2 files changed

Lines changed: 18 additions & 27 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,3 @@ jobs:
3131

3232
- name: Ruff format check
3333
run: ruff format --check .
34-
35-
test:
36-
runs-on: ubuntu-latest
37-
strategy:
38-
matrix:
39-
python-version: ["3.10", "3.11", "3.12", "3.13"]
40-
steps:
41-
- uses: actions/checkout@v4
42-
43-
- uses: actions/setup-python@v5
44-
with:
45-
python-version: ${{ matrix.python-version }}
46-
cache: pip
47-
48-
- name: Install dependencies
49-
run: |
50-
python -m pip install --upgrade pip
51-
pip install -r requirements.txt
52-
pip install pytest
53-
54-
- name: Run tests
55-
run: pytest -v

server.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
# ── Helper ─────────────────────────────────────────────────────────
1616

17+
1718
def run(cmd: str) -> str:
1819
"""Run a shell command and return its output."""
1920
try:
@@ -23,7 +24,11 @@ def run(cmd: str) -> str:
2324
output = result.stdout.strip()
2425
if result.returncode != 0:
2526
error = result.stderr.strip()
26-
return f"Error: {error}" if error else f"Command failed with code {result.returncode}"
27+
return (
28+
f"Error: {error}"
29+
if error
30+
else f"Command failed with code {result.returncode}"
31+
)
2732
return output if output else "Done."
2833
except subprocess.TimeoutExpired:
2934
return "Error: Command timed out after 30 seconds."
@@ -33,6 +38,7 @@ def run(cmd: str) -> str:
3338

3439
# ── Docker Container Tools ─────────────────────────────────────────
3540

41+
3642
@mcp.tool()
3743
def docker_list_containers(all: bool = False) -> str:
3844
"""List Docker containers. Set all=True to include stopped containers."""
@@ -175,10 +181,13 @@ def docker_stats(containers: Optional[list[str]] = None) -> str:
175181

176182
# ── Docker Image Tools ─────────────────────────────────────────────
177183

184+
178185
@mcp.tool()
179186
def docker_images() -> str:
180187
"""List all Docker images."""
181-
return run("docker images --format 'table {{.Repository}}\\t{{.Tag}}\\t{{.ID}}\\t{{.Size}}'")
188+
return run(
189+
"docker images --format 'table {{.Repository}}\\t{{.Tag}}\\t{{.ID}}\\t{{.Size}}'"
190+
)
182191

183192

184193
@mcp.tool()
@@ -208,6 +217,7 @@ def docker_rmi(images: list[str], force: bool = False) -> str:
208217

209218
# ── Docker Compose Tools ───────────────────────────────────────────
210219

220+
211221
@mcp.tool()
212222
def docker_compose_up(
213223
project_dir: str, detach: bool = True, services: Optional[list[str]] = None
@@ -253,6 +263,7 @@ def docker_compose_ps(project_dir: str) -> str:
253263

254264
# ── Docker System Tools ────────────────────────────────────────────
255265

266+
256267
@mcp.tool()
257268
def docker_system_prune(all: bool = False, volumes: bool = False) -> str:
258269
"""Remove unused Docker data (containers, images, networks, build cache).
@@ -277,6 +288,7 @@ def docker_system_df() -> str:
277288

278289
# ── Docker Network Tools ───────────────────────────────────────────
279290

291+
280292
@mcp.tool()
281293
def docker_network_ls() -> str:
282294
"""List Docker networks."""
@@ -300,6 +312,7 @@ def docker_network_create(name: str, driver: Optional[str] = None) -> str:
300312

301313
# ── Docker Volume Tools ────────────────────────────────────────────
302314

315+
303316
@mcp.tool()
304317
def docker_volume_ls() -> str:
305318
"""List Docker volumes."""
@@ -318,6 +331,7 @@ def docker_volume_create(name: str) -> str:
318331

319332
# ── OrbStack VM Tools ─────────────────────────────────────────────
320333

334+
321335
@mcp.tool()
322336
def orb_list() -> str:
323337
"""List OrbStack Linux machines (VMs)."""
@@ -395,6 +409,7 @@ def orb_info() -> str:
395409

396410
# ── Kubernetes Tools ───────────────────────────────────────────────
397411

412+
398413
@mcp.tool()
399414
def kubectl_get(
400415
resource: str,
@@ -417,9 +432,7 @@ def kubectl_get(
417432

418433

419434
@mcp.tool()
420-
def kubectl_describe(
421-
resource: str, name: str, namespace: Optional[str] = None
422-
) -> str:
435+
def kubectl_describe(resource: str, name: str, namespace: Optional[str] = None) -> str:
423436
"""Describe a Kubernetes resource in detail.
424437
425438
Args:

0 commit comments

Comments
 (0)