Notes

Why our MCP server stopped answering before sign-in

John Vinktar ·

Until yesterday Vinktar's MCP server answered initialize and tools/list for anyone and asked for a token at the first tools/call. I built it that way on purpose. It was wrong, and the reason is who the caller is.

Deferred sign-in works on the web because the person who hits the wall is the person who can climb it. Behind an agent the caller is a model. It reaches the wall only if it picks one of our tools, and the refusal arrives as a failed tool call. A coding agent that sees a tool fail tends to route around it. Telling the human to sign in is one option among several, so a step a person had to perform depended on two decisions made by a system I don't control.

Refusing at connect removes both.

HTTP/2 401
www-authenticate: Bearer resource_metadata="https://mcp.vinktar.com/.well-known/oauth-protected-resource/mcp"

Authorization in MCP is specified at the HTTP layer, and clients build their state machine there. Given a 401 at connect, Claude Code lists the server as needing authentication and offers the sign-in itself. Given a 200, the server is connected, and a 401 on a later call goes to the model as a failed call. I checked eleven hosted servers, from Sentry to Stripe, and all eleven refuse at connect.

Two costs I had not priced. A tool list served before sign-in can't be shaped by a grant, so ours sent all 31 tools and 123 KB of schema to every session, including write tools a read-only connection would later be refused. And /mcp had grown three behaviours by query string, one of them an unauthenticated write path with its own rate limiter and a claim flow. Making the endpoint always refuse removed about 650 lines and added 67.

It costs a browser round trip before the first tool call, and agents without a browser have no path at all. Anonymous discovery is gone too. Registry crawlers that read our tool list through a tokenless session now get a 401. That wants a static description of the server, which we don't serve yet.

A step the human has to perform belongs where the client can see it and draw it. Put it behind the model and it happens when the model decides to mention it.

Read the other notes