Repository navigation
feat(api): tell an MCP client that cannot ask its user what to do instead - #3622
Merged
Merged
Conversation
…tead A client on an MCP revision before 2026-07-28 cannot answer the endpoint's question, so a call that needs its user's yes is refused and not sent, as before. The refusal now names the client's revision (protocol_version) and the one that can ask (required_protocol_version), and its hint tells the agent to have the person update the client or make the call in the Console or with `zitadel api`. A client that opens with initialize on such a revision is told the same in the server's instructions. ADR 092 records the owner's decision of 2026-12-03 that there is no fallback (the SDK sends no request of the server's own in stateless mode), moves remembered consent, a sign-in answered from a live session and a person ending a grant to what §8 has built, and answers open question 5. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The suggested CLI recovery for revokeMyPersonalAccessToken cannot work because the operation requires a person's credential, while the CLI uses a project secret and rejects person-only operations.
1 open issue
What changed in this PR
Improves recovery guidance for older MCP clients while preserving the API endpoint’s stateless behavior and destructive-call refusals.
Changes:
- Adds protocol-version details and recovery hints to refusals and initialization instructions.
- Tests guidance for older clients and requests without a protocol header.
- Updates ADR 092’s implementation status and the pending release notes.
| File | Description |
|---|---|
docs/adrs/092-mcp-server.md |
Records refusal guidance and updates shipped OAuth capabilities. |
apps/api/internal/mcp/handler.go |
Adds actionable refusal messages and initialization guidance. |
apps/api/internal/mcp/handler_test.go |
Tests version-specific refusals and instructions. |
.changeset/mcp-endpoint.md |
Documents the guidance in pending release notes. |
Review effort: Balanced
The refusal an MCP client that cannot ask its user gets suggested `zitadel api <operation>` for every call. The CLI sends the project's secret, which is no person, and refuses a person's own operation, so for revokeMyPersonalAccessToken that recovery could not work. The catalog now reads x-zitadel-self, and such a call's hint names the Console alone. The instructions a client gets as it connects say the CLI is for calls that are not the person's own. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
This branch was successfully deployed
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.

Context
docs/adrs/092-mcp-server.md).2026-07-28is refused with a message that gives the agent little to act on. Its item 6: ADR 092 §8 still lists as not built three thingsmainhas.Summary
The endpoint stays stateless, and a destructive call from an older client stays refused. The owner decided on 2026-12-03 against a fallback:
streamable.go: "stateless servers cannot make requests");What changes is what the client is told.
The refusal is something an agent can act on.
confirm()answers through the newcannotAsk:{ "message": "deleteUser needs its user's yes, and this client speaks MCP 2025-06-18, which cannot ask its user, so it was not sent", "protocol_version": "2025-06-18", "required_protocol_version": "2026-07-28", "hint": "Ask the user to update this client to one that speaks MCP 2026-07-28 or later, which can ask them, or to make the call themselves: in the Console, or with the zitadel CLI's `zitadel api deleteUser`, which sends it with the project's secret and asks them first." }protocol_version.zitadel apidoes (SKILL.md).x-zitadel-self, such asrevokeMyPersonalAccessToken) is pointed to the Console alone: the CLI sends the project's secret, which is no person, and refuses such a call. The catalog now readsx-zitadel-selffor this.It is said up front. A client that opens with
initializeon an earlier revision gets one more sentence in the server's instructions: which calls are refused, and what to tell the person instead. A2026-07-28client gets no such sentence.Unchanged:
x-zitadel-asks(createMyPersonalAccessToken) is still sent where the client cannot ask;cancelInvitationis still sent unasked.ADR 092:
main:prompt=consentfor a first-party client;revokeMyConsentends that client's refresh grants, perservice/consent.go.client_id.Validation
go test ./internal/mcp/...(inapps/api): pass. New and changed tests:TestDestructiveCallIsRefusedWhenTheClientCannotAsk, with the revision named and with no header;TestInstructionsTellAClientThatCannotAskWhatIsRefused, which covers an old client'sinitializeand a2026-07-28client;TestRefusedOwnCallIsNotSentToTheCLI: a refusedrevokeMyPersonalAccessTokennames the Console and notzitadel api;x-zitadel-asksand unasked tests still pass.go vet ./internal/mcp/...: clean.$(go env GOROOT)/bin/gofmt -l internal/mcp: clean.node scripts/go-lint.mjs: the Go analyzers passed in all four build configurations. Its last step, Biome onapps/server/bin, could not run because the worktree has nonode_modules; this PR touches no JavaScript.node scripts/check-pr-title.mjs --title "feat(api): tell an MCP client that cannot ask its user what to do instead": ok.Release notes / changeset
.changeset/mcp-endpoint.md. This edits the pending changeset for the endpoint, which has not been released, instead of adding a new one. It lists@zitadel/server. The added text says that a client on an MCP revision before2026-07-28has such a call refused, with an answer that names the revision it needs and where the person makes the call instead (the Console or, unless the call is one of the person's own,zitadel api), and that the server's instructions say so when it connects.Notes
2026-07-28. Our research notes of 2026-12-01 found none confirmed (VS Code and Zed were on2025-11-25).https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
Generated by Claude Code