feat(prompts): polish for upstream prompt aggregation (F6/F7, F9, F14, F15) - #1006
Merged
Conversation
…, F15) Step 2b of the PR #973 follow-up: correctness/robustness polish for prompt aggregation. Feature remains OFF by default (aggregate_upstream_prompts). - F6 (P2): reject ':' in server names at config validation. ':' is the "server:prompt"/"server:tool" routing separator, so a name containing it misroutes; no working config uses it. ('__', the direct-mode separator, is kept for back-compat and handled below.) - F7 (P2): collision detection in buildAggregatedServerPrompts. Two pairs that flatten to the same "server__prompt" display name are now resolved deterministically (first-writer-wins) with a Warn, instead of mcp-go's silent last-writer-wins overwrite. - F9 (P2): wire per-server expose_prompts through REST + contracts. Adds the field to AddServerRequest (create + PATCH), the contracts Server type + both converters, the TS generator (contracts.ts regenerated), the GET read-path projections, and swagger — so PATCH {"expose_prompts":false} persists and is read back instead of returning "No fields to update". (The upstream_servers MCP-tool arg and the Web UI toggle are a small follow-up; not in this PR.) - F14 (P3): bound the prompts/list cursor-follow. mcp-go already follows NextCursor but only under ctx cancellation; drive it via ListPromptsByPage with a page cap (50) and item cap (200, aligned with the per-server cap) so a hostile endless-cursor upstream can't spin forever. - F15 (P3): give Manager.GetPrompt the reconnect_on_use recovery CallTool has (extracted into a shared tryReconnectOnUse helper) — a disconnected reconnect_on_use server now recovers for prompts/get as it does for tool calls. Tests: ':' name rejection, display-name collision (kept-first + logged), bounded pagination (multi-page / item-cap / endless-cursor), GetPrompt reconnect-on-use (recovers / no-reconnect-when-off), and REST PATCH expose_prompts (persist + omit-preserves). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H7J8Yv5zr4tMQZaY3ot3Za
Deploying mcpproxy-docs with
|
| Latest commit: |
e455e4e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://23adc293.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://feat-prompts-polish.mcpproxy-docs.pages.dev |
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 32241275117 --repo smart-mcp-proxy/mcpproxy-go
|
This was referenced Aug 19, 2026
Dumbris
added a commit
that referenced
this pull request
Aug 19, 2026
…l arg (#1011) Completes the prompt-aggregation feature at the MCP/REST level for release. - Rug-pull approve surface (spec 100 FR-7): quarantine_security gains inspect_prompts, approve_prompt, approve_all_prompts operations, delegating to the ApprovePrompt/ApproveAllPrompts mutators. A held (pending/changed) prompt is now approvable by an agent/operator via any MCP client instead of only programmatically or by flipping the server to trust:auto. - F9: the upstream_servers MCP tool gains the expose_prompts arg (add/patch), so the per-server prompt-aggregation override is reachable from the tool, not just the REST PATCH shipped in #1006. - Regenerated the three frozen tool-surface goldens for both schema additions (merge-base via the write-goldens env hook; pre099 via byte-preserving splice; prefeature via map update). - Docs: security-quarantine.md documents the prompt rug-pull baseline and the new quarantine_security prompt operations. Tests: quarantine_security prompt op handlers (inspect/approve/approve-all + missing-arg error) and the F9 patch-builder expose_prompts mapping. Fast-follow (Web UI): a per-server expose_prompts toggle and a rug-pull "N prompts need approval" banner in ServerDetail.vue (the latter needs REST twins). The feature is complete via MCP + REST; the operator UI is polish. Claude-Session: https://claude.ai/code/session_01H7J8Yv5zr4tMQZaY3ot3Za Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 2b of the PR #973 follow-up — the polish PR. Correctness/robustness cleanups for prompt aggregation. The feature stays OFF by default (
aggregate_upstream_prompts).Scope was set by an integration cross-check of five candidate findings; F13 (consume upstream
prompts/list_changed) and the fullCallTooldedup were deliberately deferred as too large/risky for a polish PR (F13 is a reactive feature with a new goroutine + flaky push-notification test; the CallTool hot-path refactor is higher-risk than the bug it fixes).What's included
:in server names at config validation.:is theserver:prompt/server:toolrouting separator, so a name containing it misroutes; no working config uses it. (__, the direct-mode separator, is kept for back-compat and handled by F7 below rather than a hard reject that could break an existing config.)buildAggregatedServerPrompts. Two pairs that flatten to the sameserver__promptdisplay name are now resolved deterministically (first-writer-wins) with aWarn, instead of mcp-go's silent last-writer-wins overwrite.expose_promptsthrough REST + contracts. Adds the field toAddServerRequest(create + PATCH), the contractsServertype + both converters, the TS generator (contracts.tsregenerated), theGETread-path projections, and swagger.PATCH {"expose_prompts": false}now persists and reads back instead of returning"No fields to update". Theupstream_serversMCP-tool arg and the Web UI toggle are a small follow-up — omitted here to avoid churning the frozen tool-surface goldens.prompts/listcursor-follow. mcp-go already followsNextCursor, but only underctxcancellation; this drives it viaListPromptsByPagewith a page cap (50) and item cap (200, aligned with the per-server cap) so a hostile endless-cursor upstream can't spin forever.Manager.GetPromptthereconnect_on_userecoveryCallToolhas (extracted into a sharedtryReconnectOnUsehelper). A disconnectedreconnect_on_useserver now recovers forprompts/getas it does for tool calls. (Minimal variant —CallTool's hot path is untouched.)Tests
:-name rejection, display-name collision (kept-first + logged), bounded pagination (multi-page / item-cap / endless-cursor terminates),GetPromptreconnect-on-use (recovers / no-reconnect-when-off), and REST PATCHexpose_prompts(persist + omit-preserves).Deferred to follow-ups
F13 (
prompts/list_changed), theupstream_serversMCP-toolexpose_promptsarg + Web UI toggle, the fullCallTool/GetPromptdedup, and the per-prompt approval-hash/rug-pull baseline.🤖 Generated with Claude Code