You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(mcp): prompts as slash commands — /mcp__server__prompt (#116)
Completes MCP feature parity (DEVELOPMENT_PLAN §3.3): a server's prompts are
listed on connect and invokable as `/mcp__<server>__<prompt> [args]` slash
commands in the REPL. PR 2 of 2 (stacked on the resources PR).
core (mcp/client.ts):
- connectMcpServer lists prompts on connect (capability-gated, same graceful
degradation as resources). McpClientHandle gains `prompts: McpPromptMeta[]`.
- getMcpPrompt(handle, name, args) — fetches a prompt, flattens its messages
to a single string.
- mcpPromptCommands(handles) — surfaces prompts as `/mcp__server__prompt`
command descriptors.
- resolveMcpPromptInvocation(line, handles) — parses a REPL line: `key=value`
tokens plus bare tokens mapped positionally onto the prompt's declared
argument names; null for non-invocations / unknown server|prompt.
cli (repl.ts):
- `/mcp__server__prompt …` lines fetch the rendered prompt and submit it as
the user message; startup banner lists resource + prompt counts and the
available prompt commands.
Tests: +6 (prompts listed on connect + getMcpPrompt round-trip with args
forwarded, against a real spawned stdio server; resolveMcpPromptInvocation
positional/key=value/mixed/no-args/unknown cases). Core suite 575 green.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments