skyflo

Skyflo MCP Server

MCP server exposing schema-validated infrastructure tools for Kubernetes, Helm, Argo Rollouts, and Jenkins to the Engine over Streamable HTTP transport. Tool annotations drive the approval gate for every mutating operation.

See docs/architecture.md for full system context.

Architecture

FastMCP Server

The FastMCP server is the core tool execution layer:

Tools

Categories

  1. kubectl - Kubernetes operations: tools/kubectl.py
  2. helm - Helm chart management: tools/helm.py
  3. argo - Argo Rollouts progressive delivery: tools/argo.py
  4. jenkins - Jenkins CI/CD pipelines: tools/jenkins.py

Annotations

Every tool carries MCP annotations that the Engine uses for its approval gate:

Each tool also has a tags list (e.g. k8s, helm, argo, jenkins, metrics) and a human-readable title.

Installation

Prerequisites

Setup

  1. Install uv package manager:
# Install uv for macOS or Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Or install with pip
pip install uv
  1. Install dependencies:
# Navigate to the mcp directory
cd mcp

uv sync --extra dev

# To replicate the CI environment:
uv sync --frozen --extra dev
  1. Start the server:
# Start with HTTP transport
uv run python main.py --host 0.0.0.0 --port 8888

The server uses Streamable HTTP transport and provides an MCP interface for the Engine to execute infrastructure tools.

Development Commands

Command Description
uv run python main.py Start development server
uv run ruff check . Run Ruff linter to check for code issues
uv run ruff format . Format code with Ruff
uv run pytest tests Run tests with pytest
uv run pytest --cov tests Run tests with coverage report
uv run mypy --install-types --non-interactive main.py config/ utils/ Run mypy for type checking

Configuration

FastMCP

This project includes a fastmcp.json for MCP client integrations and dependency metadata. It defines the server entrypoint and required Python dependencies without embedding them in code.

Environment Variables

Defined in .env.example:

Jenkins Credential Resolution

Jenkins tools receive api_url and credentials_ref as parameters from the Engine (injected via integration metadata). The credentials_ref points to a Kubernetes Secret in namespace/name format. At runtime, the MCP server:

  1. Validates the reference format and characters
  2. Calls kubectl get secret <name> -n <namespace> -o json with a 5-second timeout
  3. Decodes username and api-token from the Secret’s base64-encoded data
  4. Creates an authenticated httpx.AsyncClient with CSRF crumb support

Testing

Tests are organized in a structured directory layout that mirrors the source code:

tests/
├── tools/                   # Tests for tool implementations
│   ├── test_argo.py        # Argo Rollouts tests
│   ├── test_helm.py        # Helm tests
│   ├── test_jenkins.py     # Jenkins tests
│   └── test_kubectl.py     # Kubernetes tests
└── utils/                  # Tests for utility functions
    └── test_commands.py    # Command execution tests
# Navigate to mcp directory
cd mcp

# Run all tests with default coverage (30%)
./run_tests.sh

# Run tests with custom coverage threshold
./run_tests.sh --coverage 80

Component Structure

mcp/
├── main.py                  # CLI entrypoint (--host, --port)
├── config/
│   └── server.py            # FastMCP instance, health check, tool imports
├── tools/                   # Tool implementations
│   ├── __init__.py          # Package initialization
│   ├── kubectl.py           # Kubernetes tools (22)
│   ├── helm.py              # Helm tools (16)
│   ├── argo.py              # Argo Rollouts tools (13)
│   └── jenkins.py           # Jenkins tools (13)
├── utils/
│   ├── commands.py          # Async subprocess execution
│   └── models.py            # Shared type definitions (ToolOutput)
├── tests/                   # Mirrors source structure
│   ├── tools/               # Tool-level tests
│   └── utils/               # Utility tests
├── __about__.py             # Version information
├── .env.example             # Environment variable template
├── fastmcp.json             # MCP client integration metadata
├── run_tests.sh             # Test runner with coverage threshold
├── pyproject.toml           # Project dependencies and tooling
└── README.md                # Documentation

Best Practices

Community