feat(mcpkit)!: deferred tool registration + Risk/Group primitives (MC-43) - #26
Merged
Merged
Conversation
…-43) - add mcpkit.Risk (ReadOnly/Write/Destructive), a required positional AddTool param that fail-closes on unannotated write/destructive tools - auto-derive ToolAnnotations from Risk via mcpx.RiskAnnotations (MC-42) when the caller left Annotations nil; an explicit Annotations still wins - add mcpkit.Group(name) ToolOption, arbitrary per-tool bookkeeping consumed by the registry's byGroup map - defer tool registration out of AddTool into an unexported registry of pendingTool closures; App.finalize (called once, idempotently, from Run/Connect/HTTPHandler) registers every pending tool against the live mcpx.Server - this is the load-bearing MC-43 step of the MC-40 tier/gate epic: it introduces the deferred-registration seam a later gate (MC-44) will filter before anything registers, but MC-43 itself is behavior-preserving -- every tool still ends up registered, just at Run/Connect/HTTPHandler time instead of at New - update every AddTool caller (mcpkit_test.go, testkit/harness_test.go, examples/server, examples/minimal, examples/http) to pass an explicit Risk; all are ReadOnly query/demo tools BREAKING CHANGE: AddTool now requires a Risk argument and registers tools at Run/Connect/HTTPHandler instead of at New. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jgangemi
enabled auto-merge (squash)
July 12, 2026 19:41
Coverage Report for CI Build 29206278140Coverage increased (+0.07%) to 95.934%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
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.
BREAKING CHANGE: AddTool now requires a Risk argument and registers tools at Run/Connect/HTTPHandler instead of at New.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com