Skip to content

fix: enforce MCP tool contracts and effect annotations - #1084

Merged
intel352 merged 6 commits into
mainfrom
fix/mcp-tool-contracts
Oct 20, 2026
Merged

intel352 merged 6 commits into
mainfrom
fix/mcp-tool-contracts

Conversation

@intel352

@intel352 intel352 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Wrong-type MCP arguments could reach handlers, and in-process callers could receive a nil error for a failed tool or engine invocation. Enforce the existing input schemas, type string-array items, reject partial skeleton input, preserve errors through the SDK dispatcher, and sort in-process inventories. Successful text results and analytical negative reports retain their behavior.

Audit all 33 default tools and the conditional engine tool with explicit effect annotations. Correct the tool/argument reference, startup/restart behavior and validation limits, including live discovery descriptions for ignored compatibility arguments and the separate expression validator and omitted after_step behavior. This change retains mcp-go v0.54.1; a separate stacked PR will upgrade the existing SDK and test July 2026 compatibility.

Validation at 40ef2b46d9364d11899e77115b762a084d6320e2 (normal integration of merged PR1083):

  • Full MCP tests, relevant CLI tests, race checks and CI-version lint pass.
  • A newly built CLI passes all four legacy revisions, 33-tool/5-resource discovery, valid/invalid calls, framing, EOF and bounded SIGTERM shutdown.
  • A separate entered-handler engine double proves cooperative cancellation through real SDK stdio. The ordinary CLI proves notification robustness and continued service.
  • Independent specification and code-quality reviews pass. Public-data audit passes; MCP/CLI code and root dependencies match the previously reviewed contracts head; all incoming package files exactly match merged PR1083. Protected workflows are unchanged.
  • Clean-source binary SHA256: 855b1300cc7f52540a51c14fe62fc4bb7bb96da58d51717d47d045b43637d691 (vcs.modified=false).

These are source corrections, not claims about the existing v0.86.2 release, host certification or application runtime acceptance. No installation, deployment, credentials or hosted transport is included. Full CI passed at this exact integration head, including all required Go/build/tidy/UI checks, lint, examples, policy, CodeQL security/quality and the PR OSV scan. At the integration head, full MCP tests, the root standalone package integration test and all four legacy real-CLI protocol revisions pass. Independent integration specification and quality reviews both pass.

The preexisting benchmark listing warning is nonblocking under the owner's explicit instruction; no benchmark or workflow-policy override is included.

@intel352
intel352 marked this pull request as ready for review October 20, 2026 01:33
@intel352
intel352 merged commit 6e6a59e into main Oct 20, 2026
26 of 27 checks passed
@intel352
intel352 deleted the fix/mcp-tool-contracts branch October 20, 2026 01:33
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