[{"data":1,"prerenderedAt":799},["ShallowReactive",2],{"docs-\u002Fmcp\u002Foauth\u002F":3},{"id":4,"title":5,"body":6,"breadcrumb":760,"coderail":767,"dateModified":786,"datePublished":786,"description":787,"extension":788,"meta":789,"navigation":790,"next":791,"path":792,"prev":793,"schemaType":794,"seo":795,"stem":796,"wide":797,"__hash__":798},"docs\u002Fmcp\u002Foauth.md","OAuth flow",{"type":7,"value":8,"toc":752},"minimark",[9,23,28,35,38,104,110,128,144,148,159,247,369,396,399,412,416,435,443,462,468,474,478,487,557,627,638,642,645,695,712,716,719,725,748],[10,11,12,13,17,18,22],"p",{},"MCP browser clients such as Claude.ai authenticate to the TagManifest MCP server with ",[14,15,16],"strong",{},"OAuth 2.1 + PKCE",". The flow issues short-lived Bearer JWTs, so a user never pastes a long-lived key into their browser client. The token is meant for the ",[19,20,21],"code",{},"\u002Fmcp"," endpoint. It also works on the REST endpoints, within the scopes the user granted. Most people never touch these endpoints directly — the client drives the whole exchange after you paste the server URL. This page documents the flow for anyone building a custom MCP client.",[24,25,27],"h2",{"id":26},"overview","Overview",[10,29,30,31,34],{},"The server advertises its endpoints at ",[19,32,33],{},"https:\u002F\u002Fdeveloper.tagmanifest.com\u002F.well-known\u002Foauth-authorization-server",". A conforming client discovers the registration, authorization, and token endpoints there, then runs the standard authorization-code flow with PKCE. Sign-in is handled by Google. The first time a user connects a client, a consent screen lists the requested scopes and the user approves them. On a later sign-in with the same client, the screen is skipped when the saved approval already covers the scopes asked for.",[10,36,37],{},"Two scopes are granted:",[39,40,41,54],"table",{},[42,43,44],"thead",{},[45,46,47,51],"tr",{},[48,49,50],"th",{},"Scope",[48,52,53],{},"Grants",[55,56,57,79],"tbody",{},[45,58,59,65],{},[60,61,62],"td",{},[19,63,64],{},"mcp:read",[60,66,67,68,71,72,71,75,78],{},"Read-only tools (",[19,69,70],{},"list_rules",", ",[19,73,74],{},"get_rule",[19,76,77],{},"account_status",").",[45,80,81,86],{},[60,82,83],{},[19,84,85],{},"mcp:tools",[60,87,88,89,71,92,71,95,71,98,71,101,78],{},"Scanning and evaluation tools (",[19,90,91],{},"scan_url",[19,93,94],{},"scan_container",[19,96,97],{},"evaluate_rule",[19,99,100],{},"get_health_score",[19,102,103],{},"compare_containers",[10,105,106,107,109],{},"A client that requests no scope is granted both. ",[19,108,85],{}," also covers the read-only tools.",[10,111,112,113,116,117,119,120,123,124,127],{},"Scopes the server does not have are ignored: a request for ",[19,114,115],{},"mcp:read offline_access"," is treated as ",[19,118,64],{},", and the token response's ",[19,121,122],{},"scope"," field says what was granted. A request that names no supported scope at all is returned to the client with ",[19,125,126],{},"error=invalid_scope",".",[10,129,130,131,133,134,137,138,140,141,127],{},"A token's scope applies wherever the token is used. The refusal looks different on each surface. On the REST endpoints that run scans, a token granted only ",[19,132,64],{}," gets HTTP 403 with ",[19,135,136],{},"insufficient_scope",". On ",[19,139,21],{},", a scanning tool called with that token gets HTTP 200 with a JSON-RPC error, code ",[19,142,143],{},"-32602",[24,145,147],{"id":146},"client-registration","Client registration",[10,149,150,151,154,155,158],{},"Clients that do not have credentials register dynamically. ",[19,152,153],{},"POST \u002Foauth\u002Fregister"," answers with HTTP 201 and a ",[19,156,157],{},"client_id"," (public clients receive no secret and must use PKCE).",[160,161,166],"pre",{"className":162,"code":163,"language":164,"meta":165,"style":165},"language-bash shiki shiki-themes github-light github-dark","curl -X POST https:\u002F\u002Fdeveloper.tagmanifest.com\u002Foauth\u002Fregister \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"client_name\": \"My MCP Client\",\n    \"redirect_uris\": [\"https:\u002F\u002Fmyapp.example.com\u002Fcallback\"],\n    \"grant_types\": [\"authorization_code\", \"refresh_token\"],\n    \"response_types\": [\"code\"],\n    \"token_endpoint_auth_method\": \"none\"\n  }'\n","bash","",[19,167,168,191,202,211,217,223,229,235,241],{"__ignoreMap":165},[169,170,173,177,181,185,188],"span",{"class":171,"line":172},"line",1,[169,174,176],{"class":175},"sScJk","curl",[169,178,180],{"class":179},"sj4cs"," -X",[169,182,184],{"class":183},"sZZnC"," POST",[169,186,187],{"class":183}," https:\u002F\u002Fdeveloper.tagmanifest.com\u002Foauth\u002Fregister",[169,189,190],{"class":179}," \\\n",[169,192,194,197,200],{"class":171,"line":193},2,[169,195,196],{"class":179},"  -H",[169,198,199],{"class":183}," \"Content-Type: application\u002Fjson\"",[169,201,190],{"class":179},[169,203,205,208],{"class":171,"line":204},3,[169,206,207],{"class":179},"  -d",[169,209,210],{"class":183}," '{\n",[169,212,214],{"class":171,"line":213},4,[169,215,216],{"class":183},"    \"client_name\": \"My MCP Client\",\n",[169,218,220],{"class":171,"line":219},5,[169,221,222],{"class":183},"    \"redirect_uris\": [\"https:\u002F\u002Fmyapp.example.com\u002Fcallback\"],\n",[169,224,226],{"class":171,"line":225},6,[169,227,228],{"class":183},"    \"grant_types\": [\"authorization_code\", \"refresh_token\"],\n",[169,230,232],{"class":171,"line":231},7,[169,233,234],{"class":183},"    \"response_types\": [\"code\"],\n",[169,236,238],{"class":171,"line":237},8,[169,239,240],{"class":183},"    \"token_endpoint_auth_method\": \"none\"\n",[169,242,244],{"class":171,"line":243},9,[169,245,246],{"class":183},"  }'\n",[160,248,252],{"className":249,"code":250,"language":251,"meta":165,"style":165},"language-json shiki shiki-themes github-light github-dark","{\n  \"client_id\": \"mcp_9f2a…\",\n  \"client_id_issued_at\": 1796040000,\n  \"redirect_uris\": [\"https:\u002F\u002Fmyapp.example.com\u002Fcallback\"],\n  \"grant_types\": [\"authorization_code\", \"refresh_token\"],\n  \"response_types\": [\"code\"],\n  \"token_endpoint_auth_method\": \"none\",\n  \"scope\": \"mcp:read mcp:tools\",\n  \"client_name\": \"My MCP Client\"\n}\n","json",[19,253,254,260,274,286,300,317,329,341,353,363],{"__ignoreMap":165},[169,255,256],{"class":171,"line":172},[169,257,259],{"class":258},"sVt8B","{\n",[169,261,262,265,268,271],{"class":171,"line":193},[169,263,264],{"class":179},"  \"client_id\"",[169,266,267],{"class":258},": ",[169,269,270],{"class":183},"\"mcp_9f2a…\"",[169,272,273],{"class":258},",\n",[169,275,276,279,281,284],{"class":171,"line":204},[169,277,278],{"class":179},"  \"client_id_issued_at\"",[169,280,267],{"class":258},[169,282,283],{"class":179},"1796040000",[169,285,273],{"class":258},[169,287,288,291,294,297],{"class":171,"line":213},[169,289,290],{"class":179},"  \"redirect_uris\"",[169,292,293],{"class":258},": [",[169,295,296],{"class":183},"\"https:\u002F\u002Fmyapp.example.com\u002Fcallback\"",[169,298,299],{"class":258},"],\n",[169,301,302,305,307,310,312,315],{"class":171,"line":219},[169,303,304],{"class":179},"  \"grant_types\"",[169,306,293],{"class":258},[169,308,309],{"class":183},"\"authorization_code\"",[169,311,71],{"class":258},[169,313,314],{"class":183},"\"refresh_token\"",[169,316,299],{"class":258},[169,318,319,322,324,327],{"class":171,"line":225},[169,320,321],{"class":179},"  \"response_types\"",[169,323,293],{"class":258},[169,325,326],{"class":183},"\"code\"",[169,328,299],{"class":258},[169,330,331,334,336,339],{"class":171,"line":231},[169,332,333],{"class":179},"  \"token_endpoint_auth_method\"",[169,335,267],{"class":258},[169,337,338],{"class":183},"\"none\"",[169,340,273],{"class":258},[169,342,343,346,348,351],{"class":171,"line":237},[169,344,345],{"class":179},"  \"scope\"",[169,347,267],{"class":258},[169,349,350],{"class":183},"\"mcp:read mcp:tools\"",[169,352,273],{"class":258},[169,354,355,358,360],{"class":171,"line":243},[169,356,357],{"class":179},"  \"client_name\"",[169,359,267],{"class":258},[169,361,362],{"class":183},"\"My MCP Client\"\n",[169,364,366],{"class":171,"line":365},10,[169,367,368],{"class":258},"}\n",[10,370,371,372,375,376,379,380,383,384,387,388,391,392,395],{},"A redirect URI must be ",[19,373,374],{},"https:\u002F\u002F",", or ",[19,377,378],{},"http:\u002F\u002F"," on ",[19,381,382],{},"localhost"," or ",[19,385,386],{},"127.0.0.1",", and must not contain a fragment (",[19,389,390],{},"#","). At authorization the ",[19,393,394],{},"redirect_uri"," must match a registered one exactly, including any query string. The one exception is the port of a loopback address, which may differ.",[10,397,398],{},"Registration has limits:",[400,401,402,406,409],"ul",{},[403,404,405],"li",{},"at most 5 redirect URIs, each at most 2,048 characters and 8,192 characters in total",[403,407,408],{},"a request body of at most 16 KB; a larger one gets HTTP 413",[403,410,411],{},"at most 20 registrations per IP address per day; the next one gets HTTP 429",[24,413,415],{"id":414},"authorize","Authorize",[10,417,418,419,422,423,426,427,430,431,434],{},"Generate a PKCE ",[19,420,421],{},"code_verifier",", derive its ",[19,424,425],{},"code_challenge"," with the ",[14,428,429],{},"S256"," method, then send the user to ",[19,432,433],{},"GET \u002Foauth\u002Fauthorize",":",[160,436,441],{"className":437,"code":439,"language":440,"meta":165},[438],"language-text","https:\u002F\u002Fdeveloper.tagmanifest.com\u002Foauth\u002Fauthorize\n  ?response_type=code\n  &client_id=mcp_9f2a…\n  &redirect_uri=https:\u002F\u002Fmyapp.example.com\u002Fcallback\n  &scope=mcp:read%20mcp:tools\n  &code_challenge=E9Melhoa…\n  &code_challenge_method=S256\n  &state=xyz\n","text",[19,442,439],{"__ignoreMap":165},[10,444,445,446,448,449,451,452,454,455,457,458,461],{},"The user signs in with Google and approves the ",[19,447,64],{}," \u002F ",[19,450,85],{}," scopes on the consent screen. The screen is skipped when the user has already approved these scopes for this client. The server then redirects back to your ",[19,453,394],{}," with an authorization ",[19,456,19],{}," and the ",[19,459,460],{},"state"," you sent:",[160,463,466],{"className":464,"code":465,"language":440,"meta":165},[438],"https:\u002F\u002Fmyapp.example.com\u002Fcallback?code=7d1c…&state=xyz\n",[19,467,465],{"__ignoreMap":165},[10,469,470,471,473],{},"Verify ",[19,472,460],{}," matches the value you generated before continuing.",[24,475,477],{"id":476},"token-exchange","Token exchange",[10,479,480,481,484,485,434],{},"Exchange the authorization code for tokens at ",[19,482,483],{},"POST \u002Foauth\u002Ftoken",", sending the original PKCE ",[19,486,421],{},[160,488,490],{"className":162,"code":489,"language":164,"meta":165,"style":165},"curl -X POST https:\u002F\u002Fdeveloper.tagmanifest.com\u002Foauth\u002Ftoken \\\n  -H \"Content-Type: application\u002Fx-www-form-urlencoded\" \\\n  -d grant_type=authorization_code \\\n  -d code=7d1c… \\\n  -d client_id=mcp_9f2a… \\\n  -d redirect_uri=https:\u002F\u002Fmyapp.example.com\u002Fcallback \\\n  -d code_verifier=dBjftJeZ4CVP…\n",[19,491,492,505,514,523,532,541,550],{"__ignoreMap":165},[169,493,494,496,498,500,503],{"class":171,"line":172},[169,495,176],{"class":175},[169,497,180],{"class":179},[169,499,184],{"class":183},[169,501,502],{"class":183}," https:\u002F\u002Fdeveloper.tagmanifest.com\u002Foauth\u002Ftoken",[169,504,190],{"class":179},[169,506,507,509,512],{"class":171,"line":193},[169,508,196],{"class":179},[169,510,511],{"class":183}," \"Content-Type: application\u002Fx-www-form-urlencoded\"",[169,513,190],{"class":179},[169,515,516,518,521],{"class":171,"line":204},[169,517,207],{"class":179},[169,519,520],{"class":183}," grant_type=authorization_code",[169,522,190],{"class":179},[169,524,525,527,530],{"class":171,"line":213},[169,526,207],{"class":179},[169,528,529],{"class":183}," code=7d1c…",[169,531,190],{"class":179},[169,533,534,536,539],{"class":171,"line":219},[169,535,207],{"class":179},[169,537,538],{"class":183}," client_id=mcp_9f2a…",[169,540,190],{"class":179},[169,542,543,545,548],{"class":171,"line":225},[169,544,207],{"class":179},[169,546,547],{"class":183}," redirect_uri=https:\u002F\u002Fmyapp.example.com\u002Fcallback",[169,549,190],{"class":179},[169,551,552,554],{"class":171,"line":231},[169,553,207],{"class":179},[169,555,556],{"class":183}," code_verifier=dBjftJeZ4CVP…\n",[160,558,560],{"className":249,"code":559,"language":251,"meta":165,"style":165},"{\n  \"access_token\": \"eyJhbGciOiJ…\",\n  \"token_type\": \"Bearer\",\n  \"expires_in\": 3600,\n  \"refresh_token\": \"mcr_4b8e…\",\n  \"scope\": \"mcp:read mcp:tools\"\n}\n",[19,561,562,566,578,590,602,614,623],{"__ignoreMap":165},[169,563,564],{"class":171,"line":172},[169,565,259],{"class":258},[169,567,568,571,573,576],{"class":171,"line":193},[169,569,570],{"class":179},"  \"access_token\"",[169,572,267],{"class":258},[169,574,575],{"class":183},"\"eyJhbGciOiJ…\"",[169,577,273],{"class":258},[169,579,580,583,585,588],{"class":171,"line":204},[169,581,582],{"class":179},"  \"token_type\"",[169,584,267],{"class":258},[169,586,587],{"class":183},"\"Bearer\"",[169,589,273],{"class":258},[169,591,592,595,597,600],{"class":171,"line":213},[169,593,594],{"class":179},"  \"expires_in\"",[169,596,267],{"class":258},[169,598,599],{"class":179},"3600",[169,601,273],{"class":258},[169,603,604,607,609,612],{"class":171,"line":219},[169,605,606],{"class":179},"  \"refresh_token\"",[169,608,267],{"class":258},[169,610,611],{"class":183},"\"mcr_4b8e…\"",[169,613,273],{"class":258},[169,615,616,618,620],{"class":171,"line":225},[169,617,345],{"class":179},[169,619,267],{"class":258},[169,621,622],{"class":183},"\"mcp:read mcp:tools\"\n",[169,624,625],{"class":171,"line":231},[169,626,368],{"class":258},[10,628,629,630,633,634,637],{},"The ",[19,631,632],{},"access_token"," is a Bearer JWT. ",[19,635,636],{},"expires_in"," is in seconds. An authorization code expires 10 minutes after it is issued and can be used once.",[24,639,641],{"id":640},"refresh-rotation","Refresh rotation",[10,643,644],{},"Access tokens are short-lived. When one expires, exchange the refresh token for a new pair at the same endpoint:",[160,646,648],{"className":162,"code":647,"language":164,"meta":165,"style":165},"curl -X POST https:\u002F\u002Fdeveloper.tagmanifest.com\u002Foauth\u002Ftoken \\\n  -H \"Content-Type: application\u002Fx-www-form-urlencoded\" \\\n  -d grant_type=refresh_token \\\n  -d refresh_token=mcr_4b8e… \\\n  -d client_id=mcp_9f2a…\n",[19,649,650,662,670,679,688],{"__ignoreMap":165},[169,651,652,654,656,658,660],{"class":171,"line":172},[169,653,176],{"class":175},[169,655,180],{"class":179},[169,657,184],{"class":183},[169,659,502],{"class":183},[169,661,190],{"class":179},[169,663,664,666,668],{"class":171,"line":193},[169,665,196],{"class":179},[169,667,511],{"class":183},[169,669,190],{"class":179},[169,671,672,674,677],{"class":171,"line":204},[169,673,207],{"class":179},[169,675,676],{"class":183}," grant_type=refresh_token",[169,678,190],{"class":179},[169,680,681,683,686],{"class":171,"line":213},[169,682,207],{"class":179},[169,684,685],{"class":183}," refresh_token=mcr_4b8e…",[169,687,190],{"class":179},[169,689,690,692],{"class":171,"line":219},[169,691,207],{"class":179},[169,693,694],{"class":183}," client_id=mcp_9f2a…\n",[10,696,697,698,701,702,705,706,708,709,127],{},"Refresh tokens ",[14,699,700],{},"rotate",": each refresh returns a new ",[19,703,704],{},"refresh_token"," and invalidates the one you sent. Always store the newest refresh token and discard the previous value. A refresh token expires after 30 days. It must be sent with the ",[19,707,157],{}," it was issued to; any other client is refused with ",[19,710,711],{},"invalid_grant",[24,713,715],{"id":714},"using-the-token","Using the token",[10,717,718],{},"Send the access token as a Bearer credential on every request to the MCP endpoint:",[160,720,723],{"className":721,"code":722,"language":440,"meta":165},[438],"POST https:\u002F\u002Fdeveloper.tagmanifest.com\u002Fmcp\nAuthorization: Bearer eyJhbGciOiJ…\n",[19,724,722],{"__ignoreMap":165},[726,727,728],"callout",{},[10,729,730,733,734,737,738,743,744,127],{},[14,731,732],{},"Prefer the built-in path."," In Claude.ai, adding the connector at ",[19,735,736],{},"https:\u002F\u002Fdeveloper.tagmanifest.com\u002Fmcp"," runs this entire flow for you — see ",[739,740,742],"a",{"href":741},"\u002Fmcp\u002Fconnect\u002F","Connect to Claude",". If you need a headless credential instead of a browser session, use the ",[739,745,747],{"href":746},"\u002Fmcp\u002Fapi-key\u002F","API-key flow",[749,750,751],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}",{"title":165,"searchDepth":193,"depth":193,"links":753},[754,755,756,757,758,759],{"id":26,"depth":193,"text":27},{"id":146,"depth":193,"text":147},{"id":414,"depth":193,"text":415},{"id":476,"depth":193,"text":477},{"id":640,"depth":193,"text":641},{"id":714,"depth":193,"text":715},[761,764,766],{"label":762,"href":763},"API Reference","\u002F",{"label":765},"MCP server",{"label":5},{"cards":768,"onpage":775},[769],{"title":770,"tabs":771},"OAuth endpoints",[772],{"label":773,"language":440,"code":774},"URL","# Dynamic client registration\nPOST https:\u002F\u002Fdeveloper.tagmanifest.com\u002Foauth\u002Fregister\n\n# Authorization (PKCE S256)\nGET  https:\u002F\u002Fdeveloper.tagmanifest.com\u002Foauth\u002Fauthorize\n\n# Token exchange + refresh\nPOST https:\u002F\u002Fdeveloper.tagmanifest.com\u002Foauth\u002Ftoken\n\n# Discovery\nGET  https:\u002F\u002Fdeveloper.tagmanifest.com\u002F.well-known\u002Foauth-authorization-server\n",[776,777,779,780,782,784],{"id":26,"label":27},{"id":778,"label":147},"register",{"id":414,"label":415},{"id":781,"label":477},"token",{"id":783,"label":641},"refresh",{"id":785,"label":715},"using-tokens",null,"How MCP browser clients authenticate with TagManifest using OAuth 2.1 + PKCE — dynamic client registration, authorization, token exchange, and refresh-token rotation.","md",{},true,{"href":746,"title":747},"\u002Fmcp\u002Foauth",{"href":741,"title":742},"TechArticle",{"title":5,"description":787},"mcp\u002Foauth",false,"Cy9GWtAM5LTd8lR19i88DvpYLYFkSeEXkfjKOF4Wd2c",1796069482552]