mcpproxy-go icon indicating copy to clipboard operation
mcpproxy-go copied to clipboard

[Feature]: Preserve the new tool listing fields (title, icons, _meta, defer_loading, execution)

Open felipecrs opened this issue 1 week ago • 4 comments

Problem / motivation

The 2026 protocol added fields to tool listings that go beyond annotations, and the pinned mcp-go already parses them: top-level title, icons, _meta, defer_loading and execution (mcp/tools.go, mcp-go v1.0.0).

Discovery keeps none of them. Each tool is reduced to description, schemas and the five annotation hints (client.go#L515-L549, client.go#L559-L565), and ToolMetadata has nowhere to store the rest (config.go#L1523-L1541). Since everything downstream re-renders from those records, the fields never reach a client: not on the direct surface (mcp_routing.go#L386-L392), not in describe_tool, not in the REST tool maps (server.go#L4331-L4346).

Two of the losses bite directly: title is the display name clients prefer before falling back to annotations.title, and defer_loading is how a server tells a client to load a tool lazily. Swallowing those removes information the client was meant to act on.

Proposed solution

Capture the fields at discovery, add them to ToolMetadata, and re-emit them wherever tool listings are built today. The UI already renders annotation pieces (AnnotationBadges.vue), so surfacing titles and icons there is a natural follow-on.

Two decisions worth making explicitly:

  • whether a changed title or icon set should register as a contract delta for review, since today only description and schema changes do
  • whether captured defer_loading should influence mcpproxy's own tool search against servers that use it

Capturing execution.taskSupport also matters for any future tasks-extension support.

Alternatives considered

Fetching fresh upstream listings on demand instead of storing the fields. Rejected: review, quarantine and search all read from the stored records.

Which edition?

Both / not sure

Pre-submission checklist

  • [x] I searched existing issues and discussions for a similar request

felipecrs avatar Nov 25 '26 16:11 felipecrs

Thanks for the detailed write-up. The spec is up as https://github.com/smart-mcp-proxy/mcpproxy-go/pull/2062 (specs/137-tool-listing-fields/). It is docs only and still in review.

Decisions:

  • Stored: all five fields, after validation and caps. Titles are at most 256 characters with no control or bidi characters. Icons must be https or an image data: URI, at most 8, 32 KiB each, and the proxy never fetches them. _meta is capped at 16 KiB. The per-server budget is 2 MiB.
  • Titles (top-level and annotations.title) are text an agent reads, so they are reviewed, but a title change never holds the tool. An unapproved title is withheld from every agent-facing surface until approved:
    • scan mode approves it after a title-only TPA scan with no findings;
    • manual mode needs a reviewer;
    • auto mode, or quarantine off, adopts it. This also closes today's gap, where annotations.title reaches agents without being hashed or scanned.
  • Icons, _meta, defer_loading, execution are never hashed and never hold a tool.
  • Rug-pull hash: unchanged, so no tool changes status on upgrade. The review fingerprint moves to rv3 to cover titles. Only a review-bound approval with an explicit per-tool approve_titles intent can approve a title. No title is grandfathered at upgrade.
  • Where each field is re-emitted:
    • The direct surface gets everything except execution.
    • retrieve_tools (full mode) and describe_tool get title. describe_tool also gets defer_loading and task_support.
    • REST gets everything. _meta and pending titles are shown to admins only.
    • The Web UI shows titles and icons, and loads remote icons only on request.
  • defer_loading has no effect on retrieve_tools, because every upstream tool is already deferred behind it. It is forwarded unchanged on the direct surface.
  • execution.taskSupport is captured and shown, and not forwarded until #2043.

Delivery: PR-1 capture and store; PR-2 title review and withholding on every surface; PR-3 re-emitting the new fields; PR-4 Web UI.

Dumbris avatar Nov 26 '26 21:11 Dumbris

The spec for this is now merged (#2062): specs/137-tool-listing-fields.

The decisions are as listed in my earlier comment. The later review rounds tightened implementation details without changing any of them: dry-run scans never feed approval decisions, admission is tied to the exact contracts that were scanned, and a title is approved in the same transaction as its contract.

Next, implementation in four PRs: capture and store; title review and withholding; re-emitting the fields; Web UI. Thanks again @felipecrs for the detailed report.

Dumbris avatar Nov 27 '26 17:11 Dumbris

Spec 137 PR-1 is up: #2096. Auto-merge is armed and waits for CI.

In this PR

  • Discovery captures title, icons, _meta, defer_loading and execution.taskSupport. Validation and caps live in the new package internal/toollisting: FR-002, FR-003, FR-004, FR-004a and FR-005.
  • The fields are stored in ToolMetadata.Listing, along with ListingDigest.
  • Administrators see them on the REST API. Agent tokens see none of them.
  • Invalid annotations.title values are cleared.
  • The identity hash and the approval hash are unchanged.

Remaining

  • PR-2: title review and the approved title.
  • PR-3: re-emission on MCP surfaces, plus extras on the index fallback.
  • PR-4: Web UI.
  • The controller fallback Server.GetServerTools gets no listing yet (FR-020a scanner input).
  • Spec gap to settle: FR-020 says icons, defer_loading and task_support go to everyone, but Delivery says PR-1 makes no agent-facing change. PR-1 keeps every new field admin-only.

Dumbris avatar Nov 28 '26 18:11 Dumbris

Spec 137 PR-2a is up: #2138. Auto-merge is armed and waits for CI.

In this PR

  • Titles (the top-level title and annotations.title) are shown to agents only once approved. A title never holds its tool: an unapproved title is withheld, and the tool stays callable.
  • scan mode adopts a title after a title-only scan comes back clean. manual waits for a reviewer. auto, or quarantine off, adopts it.
  • The approval record is the only title source. StateView and the search index carry no titles. The direct surfaces check every title again when they build a response.
  • Approving a title needs a review-bound approval that names it: approve_titles on tools/approve, or mcpproxy review approve <server> --approve-titles. The review fingerprint is now rv3.
  • Agents and scoped callers see only approved titles and a title_pending flag. The pending text is shown to administrators only.
  • The approval hash, the identity hash and every approval status are unchanged.

Remaining

  • PR-2b: earlier stored copies of tool metadata (tool-call history, activity bodies, timelines, read_cache).
  • PR-2c: scanner output provenance.
  • PR-2d: scan-job hardening, title re-checks on config, scan and bundle events, and title approval in the server approval.
  • PR-2e: follow-up list_changed after a withheld title is served again.
  • PR-3: re-emission of the new fields.
  • PR-4: Web UI.
  • Still open from PR-1: FR-020 vs the Delivery section on who receives icons, defer_loading and task_support. That belongs to PR-3.

Dumbris avatar Dec 03 '26 17:12 Dumbris