Skip to content

feat(mcp): reconcile sources and refresh session tools - #1673

Open
JAORMX wants to merge 15 commits into
plan/mcp-source-reconciliationfrom
impl/mcp-source-reconciliation-simple
Open

JAORMX wants to merge 15 commits into
plan/mcp-source-reconciliationfrom
impl/mcp-source-reconciliation-simple

Conversation

@JAORMX

@JAORMX JAORMX commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Stage

Implementation — stacked on #1527

Contract and baseline

  • Plan / Interface PR: docs: plan MCP source reconciliation #1527
  • Exact amended plan baseline: 316f99d100298f7da57966de25c322baac0a8661
  • Includes main through 6c75a42d9cad502685a42f5418f2bc99b9ae6376 without rewriting integrated history.
  • The directing human explicitly authorizes implementation before plan merge. This PR targets plan/mcp-source-reconciliation; humans merge the plan first, then retarget/review this PR for main.
  • Interfaces match the explicitly authorized amended contract: Yes. The plan is still unmerged; no merged approval is claimed.

Summary

  • Automatically reconcile ToolHive workloads and MCP tool/resource/prompt notifications through one bounded, coalesced source reconciler.
  • Publish complete immutable direct-MCP runtimes; keep active runs and resource/prompt operations pinned until settlement, with bounded retirement and revision-based engine rebuilding.
  • Preserve existing exact-name authority. Removed names become unavailable; previously granted same names can reappear. New names require explicit owner refresh.
  • Add Session.GrantToolAuthority, direct refresh gRPC/HTTP controls, cached revision/status, SDK support, and unified mecatui /mcp-refresh routing.
  • Keep broker consent/cancellation and direct refresh separate; retain /tools-connect as a broker-only compatibility alias.
  • No durable capability digests, revoked records, snapshot migration, or new endpoint-credential policy.

Acceptance coverage

All 12 amended ACs are implemented and traced:

  • AC1.1–1.3: ordered sources, LKG/empty handling, real notifications/polling, input bounds, no automatic consent, shutdown.
  • AC2.1–2.3: all-or-nothing publication, production engine variants, runtime consistency across prompt/retry/restored approval/delegation/direct teams and resource/prompt operations.
  • AC3.1–3.3: removed/reappearing names, state-preserving authority union, delegation/resume name semantics.
  • AC4.1–4.3: owner/lifecycle/mutation/ambiguous-save/cancellation matrices, pinned response revisions, gRPC/HTTP/TUI parity and broker isolation.

The plan's landed status in this diff is a proposed transition, effective only when the implementation merges.

Verification

Passed on final candidate:

  • task generate
  • task lint
  • task test (race and module/standalone gates)
  • task api:check
  • task sdk:api:check, task sdk:test (276 tests), task sdk:build
  • task docs, task site:build
  • task ac-trace-strict
  • go run ./cmd/mecademo

Optional Bun-only e2e was not rerun locally because Bun is unavailable; required SDK gates pass.

Final panel:

PANEL: ship_blockers=0 important=1 advisory=2 reviewer_failures=0

Non-blocking suggestions retained as optional follow-ups: consolidate candidate pagination if the abstraction proves worthwhile; use typed sorting and non-cryptographic polling jitter. No technical contract deviations.

Two pre-existing strict-trace references were corrected to the actual current provider/SDK proof names without changing tested behavior. Generated protobuf/API output accounts for a substantial portion of the diff. The discarded broader implementation is preserved separately and is not part of this stack.

Tracking: #1511

JAORMX and others added 15 commits September 16, 2026 11:29
Co-Authored-By: mecatl <noreply@stacklok.com>
Co-Authored-By: mecatl <noreply@stacklok.com>
Co-Authored-By: mecatl <noreply@stacklok.com>
Co-Authored-By: mecatl <noreply@stacklok.com>
Co-Authored-By: OpenAI Codex <noreply@openai.com>
Co-Authored-By: mecatl <noreply@stacklok.com>
Co-Authored-By: mecatl <noreply@stacklok.com>
Co-authored-by: mecatl <noreply@mecatl.dev>
Co-Authored-By: mecatl <noreply@stacklok.com>
Co-Authored-By: OpenAI Codex <codex@openai.com>
Preserve incoming client-MCP authority hardening alongside immutable runtime publication, renumber the proposed reconciliation ADR and named proofs to 0346, and repair the landed SDK acceptance proof to match main's authorized callback behavior.

Co-Authored-By: OpenAI Codex <codex@openai.com>
Co-Authored-By: OpenAI Codex <codex@openai.com>
Co-Authored-By: Mecatl <mecatl@users.noreply.github.com>
Co-Authored-By: Mecatl <mecatl@users.noreply.github.com>
Co-Authored-By: Mecatl <mecatl@users.noreply.github.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.

1 participant