Labsco
remiphilippe logo

Dev/Infra

from remiphilippe

MCP server that gives LLMs full control over local Kubernetes dev environments via k3d, kubectl, Tilt, Helm, and kustomize

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

devinfra-mcp

MCP server that gives LLMs full control over local Kubernetes dev environments. Built in Go, it exposes 63 tools across 8 groups for managing k3d clusters, kubectl operations, Helm charts, Kustomize overlays, Tilt dev workflows, Artifact Hub lookups, and documentation search.

Features

  • k3d (9 tools) โ€” create, delete, start, stop, list clusters and nodes
  • kubectl (16 tools) โ€” get, describe, apply, delete, logs, port-forward, raw command escape hatch
  • Helm (10 tools) โ€” install, upgrade, uninstall, template, status, show values/chart, repo management (via Go SDK)
  • Kustomize (5 tools) โ€” build, build-and-apply, edit image/namespace, list resources (via Go API)
  • Tilt (10 tools) โ€” up, down, ci, logs, status, get, describe, trigger, session (queries via HTTP API)
  • Artifact Hub (6 tools) โ€” search, package info, values, schema, readme, templates
  • Doc search (4 tools) โ€” full-text search over tilt, k3d, kubectl, and Helm docs (Bleve index, 257+ pages)
  • CI (3 tools) โ€” composite bootstrap, teardown, and diagnostic collection

Architecture

Hybrid approach โ€” each tool group uses the best integration method:

ComponentIntegrationWhy
HelmGo SDK (helm.sh/helm/v3)Type safety, no CLI dependency
KustomizeGo API (sigs.k8s.io/kustomize/api)Designed for embedding
Tilt queriesHTTP API (auto-discovered apiserver)Structured JSON, no process spawn
Tilt lifecycleCLI shell-outCLI-first, no public Go SDK
kubectlCLI shell-outAvoids client-go bloat, inherits user auth
k3dCLI shell-outNo public Go API

The server includes an embedded Bleve full-text search index over 4 documentation sources:

SourceDocsRepository
tilt~54tilt-dev/tilt.build
k3d~33k3d-io/k3d
k8s~75kubernetes/website (kubectl reference)
helm~95helm/helm-www
# Clone doc sources (uses sparse checkout for large repos)
make docs-clone

# Build the Bleve search index
make docs-index

Development

make build              # Build binary to bin/devinfra-mcp
make test               # Unit tests
make test-integration   # Integration tests (needs Docker)
make e2e                # Full e2e: create k3d cluster, test, teardown
make lint               # golangci-lint
make vet                # go vet
make check              # vet + lint + test

Prompts

Reusable workflow templates the LLM can invoke for multi-step operations:

PromptDescriptionArguments
bootstrap_dev_envCreate k3d cluster, merge kubeconfig, apply kustomize, start tiltcluster_name, kustomize_path, tiltfile_path
teardown_dev_envStop tilt and delete k3d clustercluster_name
debug_podDescribe, logs, and events for a failing podpod_name, namespace
deploy_and_verifyKustomize build + apply, rollout status, verify podskustomize_path, namespace, deployment_name
cluster_health_checkCluster info, node status, resource usage, warning eventsโ€”
ci_runBootstrap CI cluster, run tilt ci, diagnostics on failure, teardowncluster_name, tiltfile_path
search_and_applySearch docs for a concept and show relevant patternstopic
helm_deploy_and_verifyArtifact Hub lookup, helm install, rollout status, verifychart, release, namespace

Resources

Read-only data the LLM can pull into context:

Resource URIDescription
k8s://cluster/{name}/infoCluster info (nodes, version, endpoint)
k8s://cluster/{name}/namespacesList of namespaces
k8s://namespace/{ns}/podsPods (JSON)
k8s://namespace/{ns}/servicesServices (JSON)
k8s://namespace/{ns}/deploymentsDeployments (JSON)
k8s://namespace/{ns}/eventsRecent events (JSON)
k8s://tilt/statusTilt resource status (if running)
k8s://tilt/sessionTilt Session object for CI monitoring
k8s://kubeconfigCurrent kubeconfig (minified)
k8s://helm/releasesHelm releases in current context
docs://{source}/{slug}Doc page (source: tilt, k3d, k8s, helm)

Project Structure

cmd/devinfra-mcp/main.go           Entry point, wires all components
internal/
  executor/                        Shell-out abstraction (all CLI calls go through here)
  tools/                           63 MCP tools across 8 groups
    k3d.go, kubectl.go, helm.go,
    kustomize.go, tilt.go,
    artifacthub.go, docsearch.go, ci.go
  helmclient/                      Helm Go SDK wrapper (Client interface + mock)
  kustomizeclient/                 Kustomize Go API wrapper (Client interface + mock)
  tilt/                            Tilt HTTP API client (Client interface + mock)
  artifacthub/                     Artifact Hub HTTP client with response caching
  docsearch/                       Bleve index builder + markdown scraper
  config/                          JSON config loading with defaults
  safety/                          Context blocklist, input sanitization
  prompts/                         MCP prompt templates
  resources/                       MCP resource providers (cluster state, docs)