How ai-skill-mcp/mcp_argo_pipeline works
Purpose and Entry Points
This repository exposes selected Argo WorkflowTemplates as an MCP server, scoped to one named pipeline per process. The sole Python entry point is server.py; start_serve.sh is the server-oriented launcher that selects a pipeline and prepares dependencies. Clients use stdio locally or Streamable HTTP remotely.
Paths: server.py, start_serve.sh, README.md
Pipeline-Scoped Configuration
At startup, the process requires MCP_PIPELINE and resolves its pipeline definition: server name, kubeconfig, HTTP port, instructions, namespace, and permitted template names. Configuration file locations can be overridden with environment variables, separating deployment settings from source.
Paths: common/pipeline_config.py, pipelines.yaml.example, common/runtime.py
MCP Server and Transport Boundary
The server constructs the MCP-facing service for the chosen pipeline and selects stdio or streamable-http transport through MCP_TRANSPORT. Pipeline instructions become the MCP interaction context, while exposed operations are constrained to that pipeline’s configured templates.
Paths: server.py, common/pipeline_server.py, common/runtime.py
Authentication Boundary
HTTP transport requires Bearer authentication. Tokens are loaded per pipeline and map to identity metadata such as username and unit; this identity can be propagated into server-side request handling or workflow submission context. Stdio is intended for local MCP clients and does not use the remote HTTP authorization boundary.
Paths: common/bearer_auth.py, auth.yaml.example, common/pipeline_server.py
Argo Workflow Integration
The core execution boundary is the Argo client: MCP requests are translated into operations against Kubernetes-hosted Argo WorkflowTemplates. Only templates explicitly configured for the active pipeline should be reachable, preventing a pipeline server from becoming a general cluster workflow endpoint.
Paths: common/argo_client.py, common/pipeline_server.py, common/pipeline_config.py
Startup Validation and Runtime Dependencies
Before serving, startup checks validate kubeconfig access and configured template accessibility; MCP_SKIP_STARTUP_CHECKS=1 bypasses this for troubleshooting. The service therefore depends materially on Kubernetes credentials, an accessible Kubernetes API/Argo installation, and the configured WorkflowTemplates.
Paths: common/startup_checks.py, common/argo_client.py, common/runtime.py
Deployment Model
Dependencies are managed with uv. start_serve.sh performs frozen synchronization unless disabled, then launches a single pipeline server, typically as an HTTP service on its configured port. Multiple pipelines are deployed as separate processes/endpoints rather than multiplexed through one server.
Paths: start_serve.sh, pyproject.toml, uv.lock
Main entry points: pipeline_server.py Pipeline MCP service · pipeline_config.py Pipeline configuration · argo_client.py Argo client · runtime.py Runtime settings
Components 17
Startup & Configuration
- Server launcher · Selects a pipeline, syncs dependencies, and starts one server process.
start_serve.sh - Runtime settings · Reads transport, pipeline, and startup-check settings.
common/runtime.py - Pipeline configuration · Resolves the selected pipeline's namespace, templates, kubeconfig, port, and instructions.
common/pipeline_config.py - Pipeline definitions
pipelines.yaml.example - Startup checks · Verifies kubeconfig and configured template accessibility unless skipped.
common/startup_checks.py - uv dependencies · Frozen synchronization uses the project manifest and lockfile.
pyproject.toml - Dependency lockfile
uv.lock
Pipeline MCP Service
- Python entry point
server.py - Pipeline MCP service · Exposes only operations permitted for the active pipeline.
common/pipeline_server.py - Local stdio client · Local clients bypass HTTP bearer authentication.
- Streamable HTTP · Remote MCP endpoint for the selected pipeline.
- Bearer authentication · Maps per-pipeline tokens to identity metadata.
common/bearer_auth.py - Token configuration
auth.yaml.example
Argo Execution Boundary
- Argo client · Translates MCP operations into Argo WorkflowTemplate operations.
common/argo_client.py - Kubernetes credentials
- Kubernetes API & Argo
- Configured WorkflowTemplates · Only templates allowed by the active pipeline are reachable.
Connections 23
- Server launcher → uv dependencies: syncs dependencies
- Dependency lockfile → uv dependencies: pins
- Server launcher → Python entry point: launches
- Python entry point → Runtime settings: reads
- Runtime settings → Pipeline configuration: selects MCP_PIPELINE
- Pipeline definitions → Pipeline configuration: defines pipelines
- Python entry point → Startup checks: runs before serving
- Startup checks → Argo client: validates access through
- Pipeline configuration → Startup checks: supplies kubeconfig and templates
- Python entry point → Pipeline MCP service: constructs
- Pipeline configuration → Pipeline MCP service: scopes operations and instructions
- Runtime settings → Local stdio client: selects transport
- Runtime settings → Streamable HTTP: selects transport
- Local stdio client → Pipeline MCP service: MCP requests
- Streamable HTTP → Bearer authentication: requires
- Token configuration → Bearer authentication: provides tokens
- Bearer authentication → Pipeline MCP service: provides identity
- Streamable HTTP → Pipeline MCP service: authorized MCP requests
- Pipeline MCP service → Argo client: submits permitted operations
- Pipeline configuration → Argo client: supplies namespace and allowlist
- Kubernetes credentials → Argo client: authenticates
- Argo client → Kubernetes API & Argo: calls
- Kubernetes API & Argo → Configured WorkflowTemplates: hosts