Skip to content

MCP extension API: additional tools, approved-command handles and task answers #1631

Done
2 of 2 issues completed
Done

Description

@smart-ssh-planner

Goal

Extension crates that plug into an embedding app (Spec 0038, "Extension API") can extend the local MCP server (Spec 0028): register additional MCP tools, take over how the result of an approved, possibly long-running command is returned to the client, and answer a tool call as an MCP task. Without a registered extension the MCP server behaves exactly as today.

Scope

In scope: the extension trait, its registration in app_shell::Wiring, a handle for an approved command (redacted live output, final outcome, cancel), session-closed notification, and the MCP protocol support needed to answer tools/call with a task. Out of scope: any concrete use of the hooks (job storage, polling tools, settings); the built-in MCP tools keep their behaviour.

Shared decisions

  • Trait: McpExtension in crates/mcp-server, re-exported through the extension facade (crates/app-logic/src/ext.rs or the app-shell equivalent) and documented in Spec 0038 §2 and Spec 0028. Registered as Wiring::mcp_extensions: Vec<Arc<dyn McpExtension>>; Community registers none.
  • Call context: every hook gets an McpCallContext with an opaque MCP session key (Spec 0104), the normalized client name, and (from the tasks issue on) whether the client announced the MCP tasks extension. No server credentials, no unredacted content.
  • No second execution path (Spec 0028 §3): extension tools cannot execute on a server through the hook; the only way to run something stays propose_command & co. with filter engine and confirmation. Every MCP action still always ends in a confirmation (Spec 0028 §5).
  • Content leaving the hooks is redacted; a helper fences server content exactly as the built-in tools do, and extension tool results that carry server output use it.
  • Logging: calls of extension tools are logged with origin: "mcp" and the tool name; never content (Spec 0094 A1.6).
  • Tool names: an extension tool whose name collides with a built-in tool or another extension's tool is not offered, and a warning is logged at server start.

Sub-issues

Prerequisite (not part of this epic): #1630 confirmation timeout covers only the decision.

Sub-issues

Sub-issues

2 of 2 Issues completed
Loading 2 sub-issues

Activity

  1. added
    enhancement
    epic
    on Dec 3, 2026
  2. smart-ssh-coordinator commented on Dec 4, 2026

    @smart-ssh-coordinator
    Contributor

    All sub-issues are done, closing the epic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementepicmcp

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions