gridctl

module
v0.1.0-beta.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2026 License: Apache-2.0

README ΒΆ

gridctl

The developer cockpit for MCP servers and Agent Skills.

One YAML. One endpoint. Every MCP server and Agent Skill.

Release License Build Go Report Security Policy OpenSSF Best Practices


Gridctl

Gridctl aggregates tools from MCP servers and Agent Skills into a single gateway. Define your stack in YAML, apply with one command, and connect Claude Desktop β€” or any MCP client β€” through one endpoint.

gridctl apply stack.yaml

Designed for fast, ephemeral, stateless environments β€” inspired by Containerlab.

⚑️ Why gridctl

MCP servers are everywhere β€” different transports, different hosting models, different .json files accumulating like dust. Skills are a separate sprawl on top. Switching projects shouldn't mean rewriting every client config.

Gridctl gives you one declarative file for everything you want connected, one local endpoint your client talks to, and a UI that shows you what's actually running. Build fast, throw it away, rebuild it tomorrow.

version: "1"
name: stack

mcp-servers:

  # Containerized stdio MCP server
  - name: github
    image: ghcr.io/github/github-mcp-server:latest
    transport: stdio
    tools: ["get_file_contents", "search_code", "list_commits", "get_pull_request"]
    env:
      GITHUB_PERSONAL_ACCESS_TOKEN: "${GITHUB_PERSONAL_ACCESS_TOKEN}"

  # External SaaS MCP server (OAuth flow)
  - name: atlassian
    command: ["npx", "mcp-remote", "https://mcp.atlassian.com/v1/sse"]

  # Any REST API as MCP tools via OpenAPI
  - name: my-api
    openapi:
      spec: https://api.example.com/openapi.json
      baseUrl: https://api.example.com

Three servers, three transports, one endpoint. Navigate to localhost:8180 to visualize the stack πŸ‘‰

Gridctl Interface

πŸͺ› Install

curl -fsSL https://raw.githubusercontent.com/gridctl/gridctl/main/install.sh | sh

Installs the latest release to ~/.local/bin/gridctl. Full instructions for Homebrew, pre-built binaries, building from source, container runtime setup, and updating/uninstalling are in the Installation guide.

🚦 Quick Start

# Apply the example stack
gridctl apply examples/getting-started/skills-basic.yaml

# Check what's running
gridctl status

# Open the web UI
open http://localhost:8180

# Clean up
gridctl destroy examples/getting-started/skills-basic.yaml

πŸ–₯️ Connect LLM Application

The easiest way to connect is with gridctl link, which auto-detects installed LLM clients and injects the gateway configuration:

gridctl link              # Interactive: detect and select clients
gridctl link claude       # Link a specific client
gridctl link --all        # Link all detected clients at once

Supported clients: Claude Desktop, Claude Code, Cursor, Windsurf, VS Code, Gemini, OpenCode, Continue, Cline, AnythingLLM, Roo, Zed, Goose

Manual configuration
Most Applications
{
  "mcpServers": {
    "gridctl": {
      "url": "http://localhost:8180/sse"
    }
  }
}
Claude Desktop
{
  "mcpServers": {
    "gridctl": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "http://localhost:8180/sse", "--allow-http", "--transport", "sse-only"]
    }
  }
}

Restart Claude Desktop after editing. All tools from your stack are now available.

🎬 Features

Stack as Code

Declarative, version-controlled MCP environments. Validate before you commit, plan before you apply, and detect the moment your environment drifts from what's in version control. Drift detection runs in the background β€” the canvas flags servers running but absent from your spec, and declarations in your spec that haven't been deployed.

gridctl validate stack.yaml    # Lint and schema-check the spec (exit 0/1/2)
gridctl plan stack.yaml        # Diff against running state
gridctl apply stack.yaml       # Apply the spec
gridctl export                 # Reverse-engineer stack.yaml from a running stack

Learn more β†’ Configuration Reference

gridctl optimize & Cost Observability

Every tool call is priced against an embedded snapshot of LiteLLM model rates. gridctl optimize scans the running gateway and surfaces actionable findings with weekly USD impact β€” unused servers, unused tools, schema overhead, format-conversion shortfalls, and expensive-model-on-cheap-task patterns β€” plus a paste-ready YAML remediation for each.

gridctl optimize                          # styled findings table
gridctl optimize --format json            # machine-readable OptimizeReport
gridctl optimize --severity warn,critical # narrow to actionable findings

Learn more β†’ Cost Observability

Output Format Conversion

Tool call results default to JSON. Set output_format at the gateway or per-server level to convert structured responses into TOON or CSV before they reach the client β€” reducing token consumption by 25–61% for tabular and key-value data. Non-JSON responses and payloads over 1 MB are passed through unchanged.

gateway:
  output_format: toon      # Default for all servers: json, toon, csv, text

mcp-servers:
  - name: analytics
    output_format: csv     # Override per server

Learn more β†’ Configuration Reference

Skills (Early Access)

Three flavors of skills surface to upstream clients as MCP prompts and tools β€” prompt-only (SKILL.md body delivered verbatim), TypeScript (skill.ts in a goja + esbuild sandbox), and Go (skill.go compiled as a Go plugin). The hybrid pattern lets a code skill read its own SKILL.md body at runtime and feed it to an LLM as the system prompt β€” edit the markdown, change runtime behavior, no code change.

gridctl agent init --name my-skill        # Scaffold (TS default; --lang go or --prompt-only)
gridctl agent build my-skill              # esbuild for TS; go build -buildmode=plugin for Go
gridctl run my-skill --input '{...}'      # Run end-to-end and stream typed events

Learn more β†’ Skills guide

Visual Agent IDE (Early Access)

gridctl agent dev --root . boots a local IDE on port 8181 β€” React Flow canvas, file watcher (sub-300 ms re-render), live trace overlay, click-to-$EDITOR jumps. Every skill invocation also writes a JSONL event ledger to ~/.gridctl/runs/<run_id>.jsonl, so gridctl runs inspect, runs trace, and runs resume give you a typed timeline and time-travel resume from any checkpoint.

Learn more β†’ Skills guide

πŸ“™ Examples

Example What It Shows
mcp-basic.yaml Stack with multiple MCP servers and tool filtering
local-mcp.yaml Local process and SSH-tunneled MCP transports
openapi-basic.yaml Turn a REST API into MCP tools via OpenAPI spec
code-mode-basic.yaml Gateway code mode with search + execute meta-tools
github-mcp.yaml GitHub MCP server integration
registry-basic.yaml Skills registry with a single server
incident-triage-hybrid Hybrid pattern: Go handler reads its own SKILL.md body as the LLM system prompt
multi-agent-skills.yaml Multi-agent orchestrator handing off between skills
vault-basic.yaml Reference vault secrets with ${vault:KEY} syntax
otlp-jaeger.yaml Export traces to Jaeger via OTLP

πŸ“– Documentation

Full index at docs/.

🀝 Contributing

See CONTRIBUTING.md. PRs welcome for new transport types, example stacks, and documentation improvements.

πŸͺͺ License

Apache 2.0


Built for engineers who'd rather be building and hate the absence of repeatable environments.

Directories ΒΆ

Path Synopsis
cmd
gridctl command
examples
_mock-servers/local-stdio-server command
Mock MCP Server for testing local process (stdio) MCP server support.
Mock MCP Server for testing local process (stdio) MCP server support.
_mock-servers/mock-mcp-server command
Mock MCP Server for testing external HTTP/SSE MCP server support.
Mock MCP Server for testing external HTTP/SSE MCP server support.
registry/items/incident-triage-hybrid command
Incident-triage-hybrid is the hybrid-pattern reference: a Go skill whose handler reads its own SKILL.md body β€” the severity matrix, decision rules, runbook, and stakeholder template β€” and feeds it as the LLM system prompt.
Incident-triage-hybrid is the hybrid-pattern reference: a Go skill whose handler reads its own SKILL.md body β€” the severity matrix, decision rules, runbook, and stakeholder template β€” and feeds it as the LLM system prompt.
registry/items/triage-go command
Triage-go is the typed Go counterpart to examples/registry/items/triage-ts.
Triage-go is the typed Go counterpart to examples/registry/items/triage-ts.
internal
api
probe
Package probe implements the ephemeral MCP server probe used by the wizard to enumerate a server's tool list before it has been deployed.
Package probe implements the ephemeral MCP server probe used by the wizard to enumerate a server's tool list before it has been deployed.
pkg
agent
Package agent is the gridctl agent runtime.
Package agent is the gridctl agent runtime.
agent/compose
Package compose hosts the agent runtime's graph-level primitives that sit just above the eino adapter β€” primitives the rest of pkg/agent composes against without ever importing eino types directly.
Package compose hosts the agent runtime's graph-level primitives that sit just above the eino adapter β€” primitives the rest of pkg/agent composes against without ever importing eino types directly.
agent/dev/devserver
Package devserver hosts the HTTP surface the agent IDE talks to.
Package devserver hosts the HTTP surface the agent IDE talks to.
agent/dev/parser
Package parser extracts a flat node list from a typed-skill source file.
Package parser extracts a flat node list from a typed-skill source file.
agent/dev/scaffold
Package scaffold renders the starter files `gridctl agent init` drops into a fresh project.
Package scaffold renders the starter files `gridctl agent init` drops into a fresh project.
agent/dev/watcher
Package watcher recursively watches a project directory for typed-skill source changes and pushes events to subscribers.
Package watcher recursively watches a project directory for typed-skill source changes and pushes events to subscribers.
agent/gateway
Package gateway adapts the existing pkg/mcp.Gateway into the agent.ToolCaller surface the runtime invokes during agentic loops.
Package gateway adapts the existing pkg/mcp.Gateway into the agent.ToolCaller surface the runtime invokes during agentic loops.
agent/internal/eino
Package eino is the boundary between gridctl's agent runtime and the upstream cloudwego/eino library.
Package eino is the boundary between gridctl's agent runtime and the upstream cloudwego/eino library.
agent/llm
Package llm hosts the gridctl LLM provider abstraction.
Package llm hosts the gridctl LLM provider abstraction.
agent/llm/anthropic
Package anthropic implements agent.ChatModel against the Anthropic Messages API.
Package anthropic implements agent.ChatModel against the Anthropic Messages API.
agent/llm/gateway
Package gateway is the LLM-side passthrough provider.
Package gateway is the LLM-side passthrough provider.
agent/llm/google
Package google implements agent.ChatModel against the Google Gemini Generative Language API.
Package google implements agent.ChatModel against the Google Gemini Generative Language API.
agent/llm/observed
Package observed wraps an agent.ChatModel with the gridctl observability surface β€” OTel spans, pricing.CalculateBreakdown for USD cost, and metrics.Accumulator.RecordCost with a synthetic provider name (no MCP envelope spoofing).
Package observed wraps an agent.ChatModel with the gridctl observability surface β€” OTel spans, pricing.CalculateBreakdown for USD cost, and metrics.Accumulator.RecordCost with a synthetic provider name (no MCP envelope spoofing).
agent/llm/openai
Package openai implements agent.ChatModel against the OpenAI Chat Completions API.
Package openai implements agent.ChatModel against the OpenAI Chat Completions API.
agent/orchestrator
Package orchestrator is the gridctl single-writer multi-agent primitive.
Package orchestrator is the gridctl single-writer multi-agent primitive.
agent/persist
Package persist is the JSONL run-state ledger for the gridctl agent runtime.
Package persist is the JSONL run-state ledger for the gridctl agent runtime.
agent/runner
Package runner orchestrates skill-run execution against the daemon's wired runtime, persisting the typed event ledger as it goes.
Package runner orchestrates skill-run execution against the daemon's wired runtime, persisting the typed event ledger as it goes.
agent/runtime
Package runtime aggregates the agent runtime's process-wide state into a single handle the gateway hangs off via SetAgentRuntime.
Package runtime aggregates the agent runtime's process-wide state into a single handle the gateway hangs off via SetAgentRuntime.
agent/sandbox
Package sandbox runs typed TypeScript skills in goja with the gridctl-shaped agent bindings (tool, llm, parallel, handoff, approval) injected as globals.
Package sandbox runs typed TypeScript skills in goja with the gridctl-shaped agent bindings (tool, llm, parallel, handoff, approval) injected as globals.
agent/skill
Package skill is the gridctl typed Skill SDK.
Package skill is the gridctl typed Skill SDK.
controller
Package controller implements the stack lifecycle management for gridctl.
Package controller implements the stack lifecycle management for gridctl.
format
Package format provides output format conversion for MCP tool call results.
Package format provides output format conversion for MCP tool call results.
git
Package git contains shared git helpers used by both the skills importer (pkg/skills) and the MCP server source builder (pkg/builder).
Package git contains shared git helpers used by both the skills importer (pkg/skills) and the MCP server source builder (pkg/builder).
jsonrpc
Package jsonrpc provides shared JSON-RPC 2.0 types used by MCP and A2A protocols.
Package jsonrpc provides shared JSON-RPC 2.0 types used by MCP and A2A protocols.
logging
Package logging provides shared logging utilities for gridctl.
Package logging provides shared logging utilities for gridctl.
mcp
metrics
Package metrics provides token usage metrics collection and aggregation.
Package metrics provides token usage metrics collection and aggregation.
optimize
Package optimize produces actionable findings from gateway-observed data β€” server registrations, per-server token + cost totals, and per-(server, tool) call counts β€” to help platform engineers reduce spend on a running gridctl stack.
Package optimize produces actionable findings from gateway-observed data β€” server registrations, per-server token + cost totals, and per-(server, tool) call counts β€” to help platform engineers reduce spend on a running gridctl stack.
output
Package output provides terminal output formatting for gridctl with amber color theme.
Package output provides terminal output formatting for gridctl with amber color theme.
pricing
Package pricing computes USD cost for MCP tool calls using model rate tables sourced from LiteLLM's `model_prices_and_context_window.json`.
Package pricing computes USD cost for MCP tool calls using model rate tables sourced from LiteLLM's `model_prices_and_context_window.json`.
provisioner
Package provisioner detects installed LLM clients and manages their MCP gateway configuration, enabling zero-friction connection between gridctl and tools like Claude Desktop, Cursor, VS Code, and others.
Package provisioner detects installed LLM clients and manages their MCP gateway configuration, enabling zero-friction connection between gridctl and tools like Claude Desktop, Cursor, VS Code, and others.
registry
Package registry β€” acceptance criteria runner.
Package registry β€” acceptance criteria runner.
telemetry
Package telemetry implements opt-in disk persistence for the three signal types gridctl already captures in memory: logs, metrics, and traces.
Package telemetry implements opt-in disk persistence for the three signal types gridctl already captures in memory: logs, metrics, and traces.
token
Package token provides token counting for MCP tool call content.
Package token provides token counting for MCP tool call content.
tracing
Package tracing provides distributed tracing for the gridctl MCP gateway.
Package tracing provides distributed tracing for the gridctl MCP gateway.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL