✨ feat(kebab-cli): kebab mcp subcommand (fb-30)

Wires kebab_mcp::serve_stdio into kebab-cli. `--config <path>` honored
via the established Config::load pattern.

Updated serve_stdio signature to (Config, Option<PathBuf>) so the doctor
tool's path-aware behavior works correctly via KebabAppState.

Smoke test spawns the binary + sends initialize + initialized +
tools/list over stdin, asserts 4 tools returned. Confirms the MCP
server boots end-to-end via the real binary (rmcp 1.6 has no
in-memory test transport, so this is the only end-to-end assertion).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
th-kim0823
2026-05-07 16:10:17 +09:00
parent 61eef9bc82
commit 4a30959fdd
5 changed files with 101 additions and 4 deletions

View File

@@ -188,6 +188,11 @@ enum Cmd {
#[command(subcommand)]
what: EvalWhat,
},
/// Run the MCP (Model Context Protocol) stdio server. Used by
/// agent hosts (Claude Code / Cursor / OpenAI Agents) to call kebab
/// tools (search / ask / schema / doctor).
Mcp,
}
#[derive(Subcommand, Debug)]
@@ -739,6 +744,11 @@ fn run(cli: &Cli) -> anyhow::Result<()> {
Ok(())
}
},
Cmd::Mcp => {
let cfg = kebab_config::Config::load(cli.config.as_deref())?;
kebab_mcp::serve_stdio(cfg, cli.config.clone())
}
}
}