MCPcopy Create free account
hub / github.com/modelcontextprotocol/typescript-sdk / tryMetadataDiscovery

Function tryMetadataDiscovery

src/client/auth.ts:811–816  ·  view source on GitHub ↗

* Tries to discover OAuth metadata at a specific URL

(url: URL, protocolVersion: string, fetchFn: FetchLike = fetch)

Source from the content-addressed store, hash-verified

809 * Tries to discover OAuth metadata at a specific URL
810 */
811async function tryMetadataDiscovery(url: URL, protocolVersion: string, fetchFn: FetchLike = fetch): Promise<Response | undefined> {
812 const headers = {
813 'MCP-Protocol-Version': protocolVersion
814 };
815 return await fetchWithCorsRetry(url, headers, fetchFn);
816}
817
818/**
819 * Determines if fallback to root discovery should be attempted

Callers 1

Calls 1

fetchWithCorsRetryFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…