Skip to content

feat(api): tell an MCP client that cannot ask its user what to do instead - #3622

Merged
fforootd merged 2 commits into
mainfrom
claude/mcp-old-client-refusal
Dec 3, 2026
Merged

fforootd merged 2 commits into
mainfrom
claude/mcp-old-client-refusal

Conversation

@fforootd

@fforootd fforootd commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Context

  • Refs ADR 092 §6 and §8 (docs/adrs/092-mcp-server.md).
  • Follows a review of the MCP endpoint on 2026-12-03. Its item 1: a destructive call (deploy, delete, rollback) from a client older than MCP 2026-07-28 is refused with a message that gives the agent little to act on. Its item 6: ADR 092 §8 still lists as not built three things main has.

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:

  • the Go MCP SDK refuses every request from server to client in stateless mode (streamable.go: "stateless servers cannot make requests");
  • an endpoint with sessions would hold each session on the instance that opened it, which a deployment of several instances cannot promise.

What changes is what the client is told.

  • The refusal is something an agent can act on. confirm() answers through the new cannotAsk:

    {
      "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."
    }
    • A client that names no revision is told "an MCP revision before 2026-07-28", and the answer carries no protocol_version.
    • The hint says the CLI uses the project's secret because zitadel api does (SKILL.md).
    • A person's own call (x-zitadel-self, such as revokeMyPersonalAccessToken) 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 reads x-zitadel-self for this.
  • It is said up front. A client that opens with initialize on an earlier revision gets one more sentence in the server's instructions: which calls are refused, and what to tell the person instead. A 2026-07-28 client gets no such sentence.

  • Unchanged:

    • a call marked x-zitadel-asks (createMyPersonalAccessToken) is still sent where the client cannot ask;
    • cancelInvitation is still sent unasked.
  • ADR 092:

Validation

  • go test ./internal/mcp/... (in apps/api): pass. New and changed tests:
    • TestDestructiveCallIsRefusedWhenTheClientCannotAsk, with the revision named and with no header;
    • TestInstructionsTellAClientThatCannotAskWhatIsRefused, which covers an old client's initialize and a 2026-07-28 client;
    • TestRefusedOwnCallIsNotSentToTheCLI: a refused revokeMyPersonalAccessToken names the Console and not zitadel api;
    • the existing x-zitadel-asks and 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 on apps/server/bin, could not run because the worktree has no node_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: .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 before 2026-07-28 has 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

  • How many clients this affects depends on which ones speak 2026-07-28. Our research notes of 2026-12-01 found none confirmed (VS Code and Zed were on 2025-11-25).
  • A separate PR is changing how long a grant lives (ADR 082 and the §8 bullet "The token ends with its session"). This PR leaves those alone.

https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U


Generated by Claude Code

…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
Copilot AI balanced review requested due to automatic review settings December 3, 2026 14:19
@vercel

vercel Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cloud Ready Ready Preview Dec 3, 2026 2:29pm UTC

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread apps/api/internal/mcp/handler.go Resolved
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
@fforootd
fforootd added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit 8fdf455 Dec 3, 2026
16 checks passed
@fforootd
fforootd deleted the claude/mcp-old-client-refusal branch December 3, 2026 16:52

This branch was successfully deployed

1 active deployment
Preview — 6efb80d4 Deployed Dec 3, 2026 by vercel[bot]
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.

3 participants