feat(mcp): make bundled servers stateless-first - #3642
Open
Morgan Carr (morgan-coded) wants to merge 1 commit into
Open
feat(mcp): make bundled servers stateless-first#3642Morgan Carr (morgan-coded) wants to merge 1 commit into
Morgan Carr (morgan-coded) wants to merge 1 commit into
Conversation
Signed-off-by: morgan-coded <256248948+morgan-coded@users.noreply.github.com>
Morgan Carr (morgan-coded)
requested review from
MohammadHaroonAbuomar and
liamcrumm
as code owners
August 7, 2026 03:37
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Welcome to the Agent Governance Toolkit! Thanks for your first pull request. |
PR Review Summary
Verdict: AI review comments are untrusted advisory output. The summary reports workflow-generated completion status only, not model-authored pass/fail claims. |
|
🔴 Contributor Check: HIGH
Automated check by AGT Contributor Check. |
Contributor
There was a problem hiding this comment.
Pull request overview
TL;DR: 0 blockers, 0 warnings. No issues found. Clean change.
Changes:
- Add stateless-first
server/discoverto the bundled MCP servers (Claude Code, OpenCode, Antigravity) while keepinginitialize/notifications/initializedas compatibility paths. - Validate per-request
_metafor statelesstools/listandtools/call, rejecting malformed_metawhile treating absent_metaas legacy. - Extend each package’s MCP server test suite to cover discovery parity, stateless
_metavalidation, and legacy compatibility.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
agent-governance-opencode/server/agt-mcp.mjs |
Implements server/discover, adds _meta validation for tool methods, and echoes validated _meta in tool call results. |
agent-governance-opencode/test/mcp-server.test.mjs |
Adds parity + stateless _meta behavior tests and a helper for isolated server state. |
agent-governance-claude-code/server/agt-mcp.mjs |
Implements server/discover, adds _meta validation for tool methods, and echoes validated _meta in tool call results. |
agent-governance-claude-code/test/mcp-server.test.mjs |
Adds parity + stateless _meta behavior tests while keeping legacy lifecycle coverage. |
agent-governance-antigravity-cli/assets/extensions/agt-global-policy/mcp/server.mjs |
Implements server/discover, adds _meta validation for tool methods, and echoes validated _meta in tool call results (stdio server). |
agent-governance-antigravity-cli/test/mcp-server.test.mjs |
Adds parity + stateless _meta behavior tests for the stdio server, preserving legacy compatibility checks. |
Author
|
@microsoft-github-policy-service agree |
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.
RFC #2597 is the scope authority for making the Claude Code, OpenCode, and Antigravity MCP servers stateless-first while preserving the legacy lifecycle.
This adds
server/discoverwith the same capabilities,serverInfo, and full tool declaration asinitializeplustools/list, whileinitializeandnotifications/initializedstay unchanged as compatibility paths.The RFC answers my July scoping question:
_metais per-request across list/read/call, so these tool-only servers validate client info and capabilities on list/call, reject invalid stateless calls, and preserve valid caller context in the result.One boundary worth naming: ADR 0027 identifies a stateless peer by the
MCP-Protocol-Version: 2026-07-28transport header, and stdio has no equivalent, so these servers treat absent_metaas legacy and reject only_metathat is present and malformed — which is what this issue asks for, accepting stateless requests that carry_meta. Rejecting absent_metawould need a server-level stateless-only mode; say the word if you want that as a follow-up.Each package keeps its own test idiom and its native gates pass:
npm run checkandnpm testare green at 22, 30, and 27 tests for Claude Code, OpenCode, and Antigravity.No protocol session state or identifier is added.
Closes #3131