Skip to content

feat(prompts): polish for upstream prompt aggregation (F6/F7, F9, F14, F15) - #1006

Merged
Dumbris merged 1 commit into
mainfrom
feat/prompts-polish
Aug 19, 2026
Merged

feat(prompts): polish for upstream prompt aggregation (F6/F7, F9, F14, F15)#1006
Dumbris merged 1 commit into
mainfrom
feat/prompts-polish

Conversation

@Dumbris

@Dumbris Dumbris commented Aug 19, 2026

Copy link
Copy Markdown
Member

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 full CallTool dedup 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

  • 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 by F7 below rather than a hard reject that could break an existing config.)
  • 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. PATCH {"expose_prompts": false} now persists and reads back instead of returning "No fields to update". The upstream_servers MCP-tool arg and the Web UI toggle are a small follow-up — omitted here to avoid churning the frozen tool-surface goldens.
  • F14 (P3) — bound the prompts/list cursor-follow. mcp-go already follows NextCursor, but only under ctx cancellation; this drives 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. (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), GetPrompt reconnect-on-use (recovers / no-reconnect-when-off), and REST PATCH expose_prompts (persist + omit-preserves).

Deferred to follow-ups

F13 (prompts/list_changed), the upstream_servers MCP-tool expose_prompts arg + Web UI toggle, the full CallTool/GetPrompt dedup, and the per-prompt approval-hash/rug-pull baseline.

🤖 Generated with Claude Code

…, 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
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

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

View logs

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 78.26087% with 20 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/upstream/manager.go 72.72% 5 Missing and 1 partial ⚠️
internal/runtime/runtime.go 0.00% 4 Missing ⚠️
internal/contracts/converters.go 25.00% 2 Missing and 1 partial ⚠️
internal/upstream/manager_prompts.go 62.50% 2 Missing and 1 partial ⚠️
internal/httpapi/server.go 71.42% 1 Missing and 1 partial ⚠️
internal/upstream/core/prompts.go 92.00% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown

📦 Build Artifacts

Workflow Run: View Run
Branch: feat/prompts-polish

Available Artifacts

  • archive-darwin-amd64 (29 MB)
  • archive-darwin-arm64 (26 MB)
  • archive-linux-amd64 (17 MB)
  • archive-linux-arm64 (15 MB)
  • archive-windows-amd64 (28 MB)
  • archive-windows-arm64 (25 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (23 MB)
  • installer-dmg-darwin-arm64 (20 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 32241275117 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@Dumbris
Dumbris merged commit 7e99d4d into main Aug 19, 2026
41 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants