feat: add MCP server command exposing the CLI to AI agents#5089
Open
wuyuwenj wants to merge 1 commit into
Open
feat: add MCP server command exposing the CLI to AI agents#5089wuyuwenj wants to merge 1 commit into
wuyuwenj wants to merge 1 commit into
Conversation
Add 'superplane mcp', a stdio Model Context Protocol server that walks the Cobra command tree and auto-exposes every leaf command as an MCP tool, so agents like Claude Code and Codex can drive SuperPlane directly. Tool input schemas are derived from each command's flags; tools execute by shelling out to this same binary with --output json, reusing the existing CLI context and auth. Adds a --read-only flag to expose only read commands. Also add a url field to canvas JSON output so agents receive a canonical, clickable canvas link instead of constructing one. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
👋 Commands for maintainers:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
superplane mcp, a new CLI subcommand that runs a Model Context Protocol server over stdio, auto-exposing the entire SuperPlane CLI as MCP tools. This lets AI coding agents (Claude Code, Codex, etc.) operate SuperPlane directly— listing canvases, creating workflows, inspecting executions, managing secrets — without the developer memorizing CLI flags or leaving their editor.
How it works
superplane mcpwalks the Cobra command tree and registers one MCP tool per runnable leaf command (~71 tools). Tool names are derived from the command path (canvases_list,secrets_create,executions_list, …) and inputschemas are derived from each command's flags (
string → string,bool → boolean,StringArray → array[string], positional args →args: array[string]).os.Executable()with the mapped command path, flags, and--output json, capturing stdout as structured JSON. Non-zero exits return an MCP tool error with stderr. This reuses the CLI's existing auth context(
~/.superplane.yaml) with zero additional configuration.--read-onlyflag: Exposes only read commands (list,get,describe,show, …) for safe, restricted usage.Installation (one command)