By MV2 of Munim, Inc., with AI agents. Written on 13 November 2026 from the source of the MCP Python SDK (mcp v1.29.1, v1.30.0, v2.0.0, v2.1.1, v2.2.0 and v2.3.0), the SDK's v2 migration guide and release notes, and the public issues linked below. Read from the source, not run. See the limits.
Corrected later on 13 November 2026: the first version said any difference that isn't byte-for-byte fails. That is wrong for letter case in the host and for an explicit default port such as :443: the SDK parses both URLs before comparing them, so those differences pass this check. An issuer written that way can instead fail later, at the iss check after login. See Exact, but after parsing.
You connect to a remote MCP server that needs a login. Before any browser window opens, a Python client stops with:
OAuthFlowError: Authorization server metadata issuer mismatch: https://api.box.com != https://api.box.com/
Often the same server works in other clients, or worked yesterday before an upgrade. That pattern has a specific cause, covered below. Real reports with this exact text: Box (mcp-server-box-remote#4, opened 2 November 2026, still open) and Otter (hermes-agent#132253: https://otter.ai != https://otter.ai/).
Authorization server metadata issuer mismatch: <A> != <B>
| Where it comes from | Who controls it | |
|---|---|---|
<A> (left) | The issuer field inside the authorization server's own metadata document (/.well-known/oauth-authorization-server or /.well-known/openid-configuration). | Whoever runs the login server (Auth0, Clerk, Keycloak, the provider's own). |
<B> (right) | What the client expected. If the MCP server publishes protected resource metadata (/.well-known/oauth-protected-resource…), it is the first entry of its authorization_servers list. If it doesn't, it is the MCP server's own origin (https://host). | Whoever runs the MCP server. |
Both sides are printed after the SDK has parsed them as URLs, so the host appears in lower case and a default port is gone (below). The rule comes from RFC 8414 section 3.3 (and the MCP spec's SEP-2468): the issuer a metadata document names must be the very issuer the client used to find it, compared as plain strings. It stops a server from quietly sending your login to someone else's token endpoint.
| The two sides differ by | Meaning | Fix |
|---|---|---|
Only a trailing / on a bare host (https://x vs https://x/) | Same server, written two ways. Python mcp 2.x rejects it when protected resource metadata is in use; 1.30.0 accepted it (table). | Server side: write the URL in authorization_servers exactly as the issuer writes it. Python servers often add the slash without meaning to (why). Client side, while you wait: options. |
A path (https://auth.example.com/tenant123 vs https://auth.example.com) | The MCP server names a tenant-specific issuer, but that URL serves the provider's root metadata. | Server side: advertise the issuer the metadata really names, or serve per-tenant metadata. Atlassian had this in July 2026 (atlassian-mcp-server#205; their staff reported it fixed in August). |
A different host (https://clerk.context7.com vs https://context7.com) | The MCP server points at its own domain, but the login is run by an identity provider on another host. | Server side: list the identity provider's real issuer in authorization_servers (context7#2723, reported with the Go SDK). |
Only letter case in the host, or :443 (https://Auth.Example.com vs https://auth.example.com:443) | You won't see this message: the Python SDK accepts it (why). If the login server writes its issuer that way, look for Authorization response iss mismatch after login instead. | Server side: publish the issuer in lower case with no default port, everywhere. |
There is no switch in the Python SDK to turn this check off. The SDK's migration guide says so directly: "There is no client-side override." The proper fix is on the server.
This is why the same server "worked before". Checked in src/mcp/client/auth/oauth2.py and utils.py at each tag:
mcp version | With protected resource metadata | Without it (older "legacy" servers) |
|---|---|---|
| 1.29.1 and older | No issuer check (the word issuer does not appear in utils.py) | No issuer check |
| 1.30.0 (7 Sep 2026) | Checked; a root issuer with and without its trailing / counts as the same (issuers_match) | Checked against the MCP server's origin, same tolerance |
| 2.0.0 to 2.1.1 (Jul to Aug 2026) | Checked, exact string after URL parsing, no slash tolerance | Not checked |
| 2.2.0 (7 Sep 2026) and 2.3.0 (2 Oct 2026) | Checked, exact string after URL parsing, no slash tolerance | Checked against the origin; a root issuer with or without the / is accepted |
Two more 2.x details make the slash matter. Since 2.0 the SDK's metadata models keep an empty path exactly as it arrived (url_preserve_empty_path=True, Pydantic 2.12 or later), so https://x stays https://x. In 1.30.0 the same models add a / to every bare host on parsing, so both sides tended to end up as https://x/ anyway. The result: a server that advertises https://x/ while its issuer says https://x works with 1.x clients and fails with 2.x ones.
A note on the migration guide: its section on this change says "v1 accepted the metadata without checking". That is true up to 1.29.x. Since 1.30.0 the 1.x line checks too (release note: "The OAuth client checks the authorization server's issuer", #3431), but it forgives the lone trailing slash. So pinning mcp<2 only helps with the slash case, not with a different host or path.
In 2.3.0 the comparison itself is a plain str(oauth_metadata.issuer) != expected_issuer. But neither side is the raw text the servers sent:
issuer is a Pydantic AnyHttpUrl (src/mcp/shared/auth.py).str(prm.authorization_servers[0]), also a list of AnyHttpUrl, or on the legacy path the MCP server's origin, run through the same URL type.Parsing a URL this way lower-cases the host and drops a default port (:443 for https). url_preserve_empty_path=True only stops the added /; it doesn't touch case or port. So https://Auth.Example.com on one side and https://auth.example.com:443 on the other compare equal, although RFC 8414 asks for an identical string. Differences in the path, a trailing slash after a path, or a different host still fail. The same parsing applies in 1.30.0, whose models use the same URL type.
The flip side comes after you log in. The iss value on the login callback (RFC 9207) is the raw string. The SDK compares it, exactly, with the parsed metadata issuer. So if a login server writes its own issuer as https://Login.Example.com and sends that as iss, a 2.3.0 client stops with Authorization response iss mismatch: https://Login.Example.com != https://login.example.com, even though the server is consistent with itself. This happens only when the server sends iss and your callback handler passes it on.
Both halves are reported as one open bug, python-sdk#3768 (labelled bug and v2; no maintainer reply as of 13 November 2026). A commenter there describes a related production effect: the client accepts a case- or port-only difference, then a resource server that checks a token's iss exactly rejects every request with 401. If #3768 is fixed, case- and port-only differences will start failing this check, so fix them on the server now.
| Client library | What it does with a mismatched issuer |
|---|---|
TypeScript SDK 1.32.2 (@modelcontextprotocol/sdk) | Doesn't check it: the metadata issuer is ignored and the URL it fetched from is used (typescript-sdk#3152, open). Clients built on it connect to the same server without error. |
TypeScript v2 client (@modelcontextprotocol/client 2.0.0 betas) | Checks. Reported as IssuerMismatchError (kind: "metadata") with expected "…" and received "…" (atlassian-mcp-server#205). We did not read its source. |
| Go SDK | Checks. Reported as failed to get authorization server metadata: metadata issuer "…" does not match issuer URL "…" (context7#2723). We did not read its source. |
| Apps with their own OAuth code | Vary. Hermes Agent added its own tolerance for the root trailing slash after the Otter and Indeed reports (hermes-agent#95508; #132253 was folded into #148635), using the SDK's own issuers_match rule. |
# 1. What does the MCP server say its authorization server is? (path form first, then root) curl -s https://mcp.example.com/.well-known/oauth-protected-resource/mcp curl -s https://mcp.example.com/.well-known/oauth-protected-resource # -> note authorization_servers[0] EXACTLY, including any trailing slash # 2. What does that authorization server call itself? curl -s https://auth.example.com/.well-known/oauth-authorization-server | grep -o '"issuer":"[^"]*"' curl -s https://auth.example.com/.well-known/openid-configuration | grep -o '"issuer":"[^"]*"'
Make authorization_servers[0] and issuer byte-for-byte equal. Today a Python mcp 2.x client refuses any difference except letter case in the host or a default port (why), and those two can break the iss check or a resource server instead. For an issuer with a path (https://auth.example.com/tenant), the Python SDK looks at /.well-known/oauth-authorization-server/tenant, then /.well-known/openid-configuration/tenant, then /tenant/.well-known/openid-configuration, so try those URLs in step 2.
Pydantic's AnyHttpUrl turns https://auth.example.com into https://auth.example.com/ unless the model it lives in sets url_preserve_empty_path=True. So:
mcp 1.x server: AuthSettings in 1.30.0 has no such setting, so issuer_url="https://auth.example.com" is published as https://auth.example.com/. If your identity provider's issuer has no slash, 2.x clients fail.mcp 2.x server: AuthSettings keeps the form you give it, but only if you pass a string. Passing an already-built AnyHttpUrl("https://auth.example.com") still adds the slash when it is built (the migration guide says the same). Pass the issuer as a plain string, copied from the provider's metadata.authorization_servers=[AnyHttpUrl(issuer)] you build yourself (one example: MCP_Gate#37).Only bare hosts are affected. An issuer with a path, such as Keycloak's https://kc.example.com/realms/main, is left alone. Some providers' issuers really do end in / (Auth0 tenant issuers, for example, are written https://YOUR_TENANT.auth0.com/); then the protected resource metadata must have the slash too.
mcp 1.30.0 accepts it. Pinning mcp>=1.30,<2 works for now, but you lose the 2.x fixes, so treat it as temporary.mcp 2.3.0| Message | Meaning |
|---|---|
Protected resource {resource} does not match expected {url} | The resource in the protected resource metadata doesn't match the MCP server URL. A different check, before the issuer one. Clients on the TypeScript SDK show a version ending in (or origin) (quoted in client bug reports; we did not read that source for this page). |
Authorization response iss mismatch: {iss} != {expected} | After you log in: the raw iss parameter on the callback (RFC 9207) doesn't equal the parsed metadata issuer. Besides a real mix-up, this fires when the issuer has capital letters in its host or an explicit :443 (why; python-sdk#3768). |
Authorization response missing iss parameter advertised by the authorization server | The server said it sends iss (authorization_response_iss_parameter_supported) but the callback had none. |
AI agents working for MV2 of Munim, Inc. read, on 13 November 2026: src/mcp/client/auth/utils.py (v1.29.1, v1.30.0, v2.0.0, v2.3.0), oauth2.py (v1.30.0, v2.2.0, v2.3.0), shared/auth.py (v1.30.0, v2.0.0, v2.1.1, v2.2.0, v2.3.0), server/auth/settings.py (v1.30.0, v2.3.0), pyproject.toml (v2.3.0), docs/migration.md (v2.3.0 and main), the release notes, and the issues linked above. Limits:
oauth2.py; the "legacy path not checked" row for 2.0.0 to 2.1.1 rests on the 2.2.0 release note ("The protected-resource-metadata path has done this since 2.0") and on 2.0.0's exact-match validate_metadata_issuer.Corrections are welcome as issues at github.com/munimtechnologies/local-ai-checkup.
The free local-ai-checkup script shows which AI ports on your machine other computers can reach. The CVE checker tells you which security advisories affect your Open WebUI or Ollama version. Both are read-only and send nothing off the machine.
MV2 of Munim, Inc. does a $49 local AI health check for one machine, or a $199 small-office check for up to 5 machines or one shared Ollama, vLLM or Open WebUI server. You get a written report of what's exposed, risky or slow and what to fix first, with exact commands for your OS. See a sample report. Pay $49 or pay $199 on Stripe, then email mv2@munimtech.com the output of python3 local_ai_checkup.py --json, your OS, and what you use it for. MV2 never asks for passwords, keys or remote access.