Skip to content

feat(server): private short-lived MCP cache hints on list/read results (Spec 113-f) - #1510

Merged
Dumbris merged 3 commits into
mainfrom
113-f-mcp-cache-hints
Oct 6, 2026
Merged

Dumbris merged 3 commits into
mainfrom
113-f-mcp-cache-hints

Conversation

@Dumbris

@Dumbris Dumbris commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Problem

Spec 058 FR-019 requires ttlMs and cacheScope on list/read results. mcp-go v1.0.0 emits them (SEP-2549) with a library default of ttl 0 / private; mcpproxy never configured them explicitly, so scope and TTL were an unpinned library default. Talk gap G9.

What changed

  • cacheHintServerOptions() in internal/server/mcp.go: WithCacheHints plus per-method WithMethodCacheHints (tools/list, prompts/list, resources/list, resources/templates/list, resources/read, server/discover), all private, ttl 5000 ms.
  • Ticks T063/T064 in specs/058-mcp-2026-upgrade/tasks.md.
  • internal/server/cache_hints_test.go: drives a modern-era request and asserts private scope and the short TTL on each list method.

Tests

  • New tests failed to compile before the change (helpers undefined), pass after.
  • go test -race internal/server/... passes, bare and -tags server, with the CI skip regex.
  • personal and server-edition builds OK. golangci-lint (both runs) reports 15/18 issues, all in files this PR does not touch (e.g. tests/oauthserver, SA1019 on Go 1.26); none in changed files.
  • Not run: scripts/test-api-e2e.sh (the change only adds server options; the shared machine was saturated).

Assumptions

  • All listings are caller-dependent (profile Spec 108, agent-token scope Spec 105, quarantine), so none is provably caller-independent and none is public.
  • 5 s TTL is a conservative freshness window; list_changed still notifies connected sessions.
  • The client-facing transport is pinned to the legacy era (FR-028), where mcp-go does not emit these fields, so the hints take effect only when that pin is lifted. The test therefore uses an unpinned transport.

Spec: #1495
Review: opencode github-copilot/gpt-6.1-sol, 2 rounds, clean; follow-ups: hints are inert on the production transport until the FR-028 legacy-era pin is lifted (test uses an unpinned transport)

…ead results (Spec 113-f)

Spec 058 FR-019 (T063/T064): configure mcp-go WithCacheHints and
WithMethodCacheHints explicitly. Every mcpproxy listing is filtered per
caller (profile, agent-token scope, quarantine), so cacheScope is private
and ttlMs is a short 5s window.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 594ad4d
Status: ✅  Deploy successful!
Preview URL: https://21f15394.mcpproxy-docs.pages.dev
Branch Preview URL: https://113-f-mcp-cache-hints.mcpproxy-docs.pages.dev

View logs

The hints were only set on p.server; /mcp, /mcp/all, /mcp/code and /mcp/call are
served by the routing-mode servers, which did not carry them.
@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

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: 113-f-mcp-cache-hints

Available Artifacts

  • archive-darwin-amd64 (31 MB)
  • archive-darwin-arm64 (28 MB)
  • archive-linux-amd64 (19 MB)
  • archive-linux-arm64 (17 MB)
  • archive-windows-amd64 (31 MB)
  • archive-windows-arm64 (27 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (27 MB)
  • installer-dmg-darwin-arm64 (24 MB)
  • smart-mcp-proxymcpproxy-goQWMZVB.dockerbuild (0 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 37439871806 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@Dumbris
Dumbris enabled auto-merge (squash) October 6, 2026 17:24
@Dumbris
Dumbris merged commit 435aecb into main Oct 6, 2026
71 of 73 checks passed
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