Repository navigation
Conversation
…he calling client Upstreams were initialized with empty client capabilities and their server-to-client requests were refused, so e.g. ssh-mcp's approval before a destructive command always failed through mcpproxy. mcpproxy now declares elicitation (form and URL), sampling and roots to stdio and streamable-HTTP upstreams and forwards each request to the MCP client whose tool call caused it. The client's session travels in the call context; a request that carries no call (stdio, or the upstream's GET stream) goes to the only call in flight to that server. When nobody can be asked, elicitation is declined, sampling fails and roots/list is empty. Closes smart-mcp-proxy#1964, closes smart-mcp-proxy#1965, part of smart-mcp-proxy#1966.
A URL-mode elicitation ends with the upstream's notifications/elicitation/complete; the client waits for it. mcpproxy dropped every upstream notification but list_changed, so a client that accepted a URL elicitation waited forever. Each upstream connection now remembers which client session a URL elicitation went to (up to an hour, forgotten when not accepted) and pushes the completion to that session only, also when it arrives on the upstream's GET stream after the call has returned.
c17a2e7 to
72a842a
Compare
… calls for client features - enable_client_features (global, default on, restart-gated like enable_prompts) and per-server client_features (reconnects the server) turn the forwarding off; a server with it off is offered no capability. - Every relayed request is a client_request activity row (server, method, request, answer, outcome forwarded|unanswered|failed), scanned for sensitive data like prompt_get. - Elicitation messages start with "[server] " so the user can tell who asks. - roots/list with no calling client goes to the last client that called the server; the server is sent notifications/roots/list_changed when that client changes or reports new roots, and roots declare listChanged.
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
…into claude/upstream-capability-forward-issues-ed9989
…client (smart-mcp-proxy#1977) Squash of upstream PR smart-mcp-proxy#1977 (not yet merged upstream).
|
Thanks for this, @felipecrs. It is well structured: per-call routing, the capability and mode checks, the refusal for 2026-07-28 clients, and the Because mcpproxy puts untrusted upstream servers behind one client, I would like three things changed before this leaves draft. Everything else can be a follow-up. 1. Opt in per server instead of on by default. Today any server an agent happens to call can ask the user for a form or a URL (any host), ask the client's model something ( 2. Do not store what the user or the model answered. 3. Cap the load. The GET-stream path starts one goroutine per request frame. Please add a per-upstream limit on in-flight relay requests (4 is plenty) and shed the rest with decline or error. Smaller things, fine to defer: restrict URL elicitation to Tests I would like with the changes: a quarantined server asks and is declined with no row, a scoped token cannot read relay content, two concurrent clients on one HTTP upstream are routed separately, and a GET-stream flood is shed. Progress forwarding (#1967) can follow once these gates exist. Happy to pair on any of it. |
Dumbris
left a comment
There was a problem hiding this comment.
Requesting changes per the review above (#1977 (comment)): opt-in per server, no stored answers/completions/roots, and a cap on in-flight relay requests before this leaves draft. The branch also conflicts with main now — a merge of main is enough, no rebase needed. Thanks for the work on this.
…rs out of the log client_features lists what a server may use (none by default, none when quarantined); client_request rows keep only the shape of the answer and are administrator-only; at most 4 requests of one upstream are answered at a time.
|
Thanks for the review! All three points and the requested tests are in via 019399e, and |
…client (smart-mcp-proxy#1977) Squash of upstream PR smart-mcp-proxy#1977 (not yet merged upstream).
Closes #1964
Closes #1965
Closes #1966
Upstream servers can now ask the user, the client's model and the client's roots through mcpproxy, the way they could if the client connected to them directly.
What's new
call_tool_*, direct names,/mcp/s/<server>,code_execution). URL-mode elicitation completions (notifications/elicitation/complete) reach the same client.[server].notifications/roots/list_changedwhen that client changes or reports new roots.decline, sampling an error, roots empty.client_features: ["elicitation", "sampling", "roots"], none by default (a change reconnects the server). A server is offered only what it lists, and a quarantined one nothing.enable_client_features: falseis a global kill switch (restart).client_requestactivity row, readable by administrators only: server, method, what was asked (capped and scanned for sensitive data),outcome(forwarded/unanswered/failed) and the shape of the answer (action, field names and sizes, response size, root count), never its content.Docs:
docs/features/client-requests.md.Limits
call_tool_timeout. A prompt left open past it stays on the client's screen (mcp-go never withdraws it); answering it then does nothing.[server]marker: clients show mcpproxy as the requester.Tested by hand
Windows build of this branch, with Claude Code and VS Code as clients:
rm -rfreached Claude Code; approve ran the command, decline and Esc refused it.code_execution.The switches, the
[server]marker, the audit rows, the in-flight limit and roots outside a call came after these runs and are covered by tests only.