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.
The FastMCP server is the core tool execution layer:
main.py (accepts --host and --port arguments)config/server.py, tools registered via @mcp.tool() decorators at import timeutils/commands.pyhttpx) with credentials resolved from Kubernetes SecretsreadOnlyHint, destructiveHint) drive the Engine’s approval policyGET /mcp/v1/healthkubectl - Kubernetes operations: tools/kubectl.pyhelm - Helm chart management: tools/helm.pyargo - Argo Rollouts progressive delivery: tools/argo.pyjenkins - Jenkins CI/CD pipelines: tools/jenkins.pyEvery tool carries MCP annotations that the Engine uses for its approval gate:
readOnlyHint: true - read-only tools execute without approval (e.g. k8s_get, k8s_logs)readOnlyHint: false - mutating tools require explicit approval (e.g. k8s_apply, k8s_scale)destructiveHint: true - destructive tools are flagged for extra caution (e.g. k8s_delete, k8s_drain, helm_uninstall, argo_abort_rollout)Each tool also has a tags list (e.g. k8s, helm, argo, jenkins, metrics) and a human-readable title.
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
# Navigate to the mcp directory
cd mcp
uv sync --extra dev
# To replicate the CI environment:
uv sync --frozen --extra dev
# 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.
| 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 |
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.
Defined in .env.example:
APP_NAME, APP_VERSION, APP_DESCRIPTION - application metadataDEBUG - debug mode toggleLOG_LEVEL - logging level (default INFO)MAX_RETRY_ATTEMPTS, RETRY_BASE_DELAY, RETRY_MAX_DELAY, RETRY_EXPONENTIAL_BASE - retry policyJenkins 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:
kubectl get secret <name> -n <namespace> -o json with a 5-second timeoutusername and api-token from the Secret’s base64-encoded datahttpx.AsyncClient with CSRF crumb supportTests 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
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
@mcp.tool() with title, tags, and annotationsField descriptions for all parametersToolOutput typed dicts with output and error fieldsconfig/server.py to trigger decorator registrationutils/commands.py for subprocess execution with consistent error handlingreadOnlyHint and destructiveHint annotations accurately for each tool