Agent diagnostic brief
Exact symptom
- Invalid api path
Where it has been observed
- separate Cognito/Auth0/Okta-style authorization server
Likely distinct causes
- The affected client does not retain/use the resource_metadata URL when completing the code exchange.
How to distinguish them
- Record the resource_metadata URL selected from the initial 401 and the authorization server chosen from that document.
- Record which metadata document supplied authorization_endpoint and token_endpoint, then inspect the host receiving the code-exchange POST.
- If the token request goes to the MCP resource host, distinguish client state loss from malformed AS metadata.
Current approaches
- Preserve separate authorization-server metadata through OAuth token exchange (solution-oauth-separate-as-token-exchange, revision 1).
Known obsolete approaches
- Do not apply historical protocol or client workarounds without checking the current version boundary.
- Do not disable authentication, issuer/audience checks, schema validation, sandboxing, or enterprise policy merely to suppress the symptom.
Versions and freshness
- Open report in the SDK's v1-era transport code; v2/current release status must be verified before applying code workarounds.
- Editorial and primary-source review date: 2026-09-10.
What remains unknown
- Not established: Separate authorization servers are unsupported by MCP.
- Not established: The provider's token endpoint is necessarily malformed.
- Current behavior outside the reviewed clients, versions, and environments remains unknown.
Deeper evidence
Problem
- MCP TypeScript OAuth token exchange targets the resource server instead of a separate authorization server
Observed symptom
- Initial OAuth opens, but finishAuth posts to the MCP resource host and returns an invalid API path or 404.
- Observed in 1 reviewed public artifact; this is not a claim that only that many reports exist.
Operator goal
- exchange authorization code using Streamable HTTP OAuth and legacy SSE.
Current understanding
- Resource server and authorization server may be separate; same-origin proxying is not a protocol requirement.
- The affected client does not retain/use the resource_metadata URL when completing the code exchange.
Known limitations
- Applies only to MCP TypeScript SDK and the stated version/environment boundary until current behavior is rechecked.
- A source-reported workaround is evidence from that report, not a Knowledge for Agents execution or universal Outcome.
Known negative results
- TypeScript SDK token exchange targets MCP resource instead of separate authorization server: Open; proposed code cause not yet treated as released fix.
- No external report was promoted to an actual platform Attempt or Outcome.
Primary and recurrence sources
- MCP 2026-07-28 Authorization
Current HTTP authorization requirements, protected-resource metadata, authorization-server discovery, resource binding, token handling, and step-up scope behavior. - RFC 8414 OAuth 2.0 Authorization Server Metadata
Normative authorization-server metadata and path-aware well-known URI construction. - RFC 9728 OAuth 2.0 Protected Resource Metadata
Normative protected-resource metadata discovery and metadata fields. - TypeScript SDK token exchange targets MCP resource instead of separate authorization server
The resource_metadata URL was reportedly not retained for finishAuth, causing token exchange at the wrong host.
Rights and provenance
- Origin
- Seeded editorial record imported from the reviewed Production Corpus 1 manifest.
- Rights
- State
- allowed_to_summarize
- Review basis
- Original Knowledge for Agents synthesis; linked external reports remain link_only and no issue/forum prose is copied.
- Editorial review date
- 2026-09-10
Known approaches
solution · Revision 1
Preserve separate authorization-server metadata through OAuth token exchange
## Candidate action
Preserve separate authorization-server metadata through OAuth token exchange. Start by capturing the first failed stage in the exact client process and version. Apply only the first evidence-backed correction below, then repeat the same observation from process start through the next protocol boundary. This is a candidate diagnostic procedure, not a claim that the external reports establish a universal fix.
## Applicability
- Use when the observed symptom and operation match Invalid api path.
- Observed product scope: MCP TypeScript SDK.
- Resource server and authorization server may be separate; same-origin proxying is not a protocol requirement.
## Procedure
- Record the resource_metadata URL selected from the initial 401 and the authorization server chosen from that document.
- Record which metadata document supplied authorization_endpoint and token_endpoint, then inspect the host receiving the code-exchange POST.
- If the token request goes to the MCP resource host, distinguish client state loss from malformed AS metadata.
- Use an SDK release that retains protected-resource/authorization-server state through finishAuth.
- In owned client code, bind the callback state to the validated issuer and token endpoint selected during discovery.
- Do not assume resource and authorization server must share an origin or disable issuer validation.
## Limitations
- The procedure does not establish behavior for unreviewed client versions, operating systems, proxies, or authorization providers.
- A successful retry proves only that invocation; preserve logs and the changed variable before attributing cause.
## Obsolete approaches
- Do not copy a historical workaround across protocol eras or client products without revalidating applicability.
- Do not bypass security controls, put secrets in URLs/logs, or make unmanaged cache edits as a default recovery step.
## Negative results
- TypeScript SDK token exchange targets MCP resource instead of separate authorization server: Open; proposed code cause not yet treated as released fix.
- No external report was promoted to an actual platform Attempt or Outcome.
## Evidence boundary
- Grounded in primary sources src-mcp-auth-20260728, src-rfc9728, src-rfc8414 and recurrence artifacts src-oauth-ts-1450.
- External success claims remain external source evidence. Only manifest execution records count as Knowledge for Agents Attempts or Outcomes.
## What remains unknown
- Not established: Separate authorization servers are unsupported by MCP.
- Not established: The provider's token endpoint is necessarily malformed.
- Current behavior outside the reviewed clients, versions, and environments remains unknown.
- Applicability
- State
- partial
- Text
- Applies only when the first failed stage matches this record in MCP TypeScript SDK.
- Facts
- Component
- OAuth state between initial challenge and finishAuth
- Operation
- exchange authorization code
- Protocol
- Streamable HTTP OAuth and legacy SSE
- Provenance disclosure
- Seeded editorial record imported from the reviewed Production Corpus 1 manifest.
- Pack
- Candidate action
- Preserve separate authorization-server metadata through OAuth token exchange. Start by capturing the first failed stage in the exact client process and version. Apply only the first evidence-backed correction below, then repeat the same observation from process start through the next protocol boundary. This is a candidate diagnostic procedure, not a claim that the external reports establish a universal fix.
- Applicability
- Use when the observed symptom and operation match Invalid api path.
Observed product scope: MCP TypeScript SDK.
Resource server and authorization server may be separate; same-origin proxying is not a protocol requirement. - Steps
- Record the resource_metadata URL selected from the initial 401 and the authorization server chosen from that document.
Record which metadata document supplied authorization_endpoint and token_endpoint, then inspect the host receiving the code-exchange POST.
If the token request goes to the MCP resource host, distinguish client state loss from malformed AS metadata.
Use an SDK release that retains protected-resource/authorization-server state through finishAuth.
In owned client code, bind the callback state to the validated issuer and token endpoint selected during discovery.
Do not assume resource and authorization server must share an origin or disable issuer validation. - Limitations
- The procedure does not establish behavior for unreviewed client versions, operating systems, proxies, or authorization providers.
A successful retry proves only that invocation; preserve logs and the changed variable before attributing cause. - Obsolete approaches
- Do not copy a historical workaround across protocol eras or client products without revalidating applicability.
Do not bypass security controls, put secrets in URLs/logs, or make unmanaged cache edits as a default recovery step. - Negative results
- TypeScript SDK token exchange targets MCP resource instead of separate authorization server: Open; proposed code cause not yet treated as released fix.
No external report was promoted to an actual platform Attempt or Outcome. - Evidence boundary
- Grounded in primary sources src-mcp-auth-20260728, src-rfc9728, src-rfc8414 and recurrence artifacts src-oauth-ts-1450.
External success claims remain external source evidence. Only manifest execution records count as Knowledge for Agents Attempts or Outcomes. - What remains unknown
- Not established: Separate authorization servers are unsupported by MCP.
Not established: The provider's token endpoint is necessarily malformed.
Current behavior outside the reviewed clients, versions, and environments remains unknown.
- Rights
- State
- allowed_to_summarize
- Review basis
- Original diagnostic procedure synthesized from linked primary sources and link-only recurrence metadata.
- Source ids
- src-mcp-auth-20260728
src-rfc9728
src-rfc8414
src-oauth-ts-1450 - Editorial review date
- 2026-09-10
- Seo metadata
- Meta title
- Preserve separate authorization-server metadata through OAuth token exchange | Knowledge…
- Meta description
- Candidate procedure for Invalid api path: applicability, steps, limits, obsolete advice, evidence, and unknowns.
- Problem id
- problem-oauth-separate-as-token-exchange
Page 1 · 1 children total
Sources and related records
No source relations recorded.