This page is for people building an MCP client. If you use Claude Code, Codex or Cursor, the
client does all of this for you — see the quickstarts.The theme MCP server follows the
MCP authorization specification:
OAuth 2.1 with PKCE, Protected Resource Metadata (RFC 9728), Authorization Server Metadata
(RFC 8414), Dynamic Client Registration (RFC 7591) and Resource Indicators (RFC 8707).
Fetch the protected resource metadata to find the authorization server, then fetch
/.well-known/oauth-authorization-server for its endpoints. Read endpoints from the metadata rather
than hard-coding them.
client_name is what the merchant sees on the consent screen, and what the issued key is named after.
Use your product’s real name.Because anyone can register a client, the consent screen labels a registered client
Unverified app and shows the host the authorization goes to. Only PlatformDTC’s own clients,
such as the dtc CLI (a pre-registered client that does not use this endpoint), are shown as verified.
Create a PKCE verifier (43–128 characters) and its S256 challenge, then send the user’s browser
to the authorization endpoint:
GET https://api.platformdtc.com/oauth/authorize ?response_type=code &client_id=<client_id> &redirect_uri=http://127.0.0.1:53682/callback &scope=read_themes%20write_themes%20publish_themes &state=<random> &code_challenge=<base64url(sha256(verifier))> &code_challenge_method=S256 &resource=https://api.platformdtc.com/mcp/theme
The server validates the client, the exact redirect_uri, the PKCE challenge (S256 only) and the
resource, then redirects the user to the PlatformDTC consent page. There the user signs in, sees
your client_name, the host you will redirect to and the requested scopes, chooses a store, may
remove scopes, and approves or denies.On approval the browser returns to your redirect_uri:
Check that state matches. The granted scopes may be fewer than you requested — read scope
from the token response, and do not offer actions the grant does not cover.
The access token is an sq_agt_* Agent Gateway key: bound to the store the user chose, carrying
only the granted scopes, expiring after 1 hour, and named OAuth: <client_name>. It works on the
MCP server and directly on the Agent Gateway/themes endpoints.
Refresh tokens rotate: every refresh returns a new refresh token, and the old one stops working.
A refresh token is valid for 60 days from its last use.
Reusing an old refresh token revokes the whole token family, and the user has to authorize again.
Store the new refresh token before using the new access token, and never run two refreshes for the
same credentials at the same time — serialize them in your client.
Refresh tokens are stored only as a hash on our side; if you lose one, authorize again.
A CI job or a server with no browser can skip OAuth and send a static sq_agt_* key, created under
Agents → Access → API keys with the theme scopes it needs:
Authorization: Bearer sq_agt_…
A static key does not expire on a timer. Give it the fewest scopes the job needs and revoke it when
the job is retired.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"PlatformDTC","description":"Build agent-native commerce. The PlatformDTC Agent Gateway lets autonomous agents (OpenClaw and others) run every capability of your store — build, catalog, ads, marketing, analytics, orders — over one scoped, idempotent, job-aware API.","colors":{"primary":"#111111","light":"#111111","dark":"#e5e5e5"},"logo":{"light":"/assets/logo.svg","dark":"/assets/logo-dark.svg"},"favicon":"/assets/logo.svg","appearance":{"default":"light","strict":false},"background":{"color":{"light":"#ffffff","dark":"#0b0b0c"}},"navbar":{"links":[{"icon":"layout-dashboard","href":"https://platformdtc.com/agents/connect","label":"Dashboard"},{"icon":"newspaper","href":"https://platformdtc.com/blog","label":"Blog"},{"icon":"activity","href":"https://status.platformdtc.com","label":"Status"}],"primary":{"type":"button","label":"Get an API key","href":"https://platformdtc.com/agents/access/api-keys"}},"footer":{"socials":{"x":"https://x.com/platformdtc","linkedin":"https://www.linkedin.com/company/platformdtc"}},"fonts":{"heading":{"family":"Inter","weight":500},"body":{"family":"Inter"}},"icons":{"library":"lucide"},"styling":{"codeblocks":{"theme":{"light":"github-dark","dark":"github-dark"}}},"integrations":{"telemetry":{"enabled":false}},"navigation":{"languages":[{"language":"en","href":""}]}},"deployment":{"deploymentMetadataValue":{"hasAudioNarration":false,"customDomains":[],"gitSource":{"type":"github","owner":"local","repo":"local","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"local","isBase":true},"buildId":"local","clientVersion":"0.0.4044"},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false,"isLoggedInCli":false,"mintExport":{}},"customCss":[{"filePath":"style.css","content":":root{--dtc-mono:\"JetBrains Mono\", ui-monospace, SFMono-Regular, \"SF Mono\", Menlo,\n Consolas, monospace;--dtc-border:rgba(17, 17, 17, 0.08);--dtc-muted:#6a737d}.dark{--dtc-border:rgba(255, 255, 255, 0.1);--dtc-muted:#9aa4af}html{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}h1{letter-spacing:-.02em;font-weight:600}h2,h3{letter-spacing:-.015em}main article{max-width:46rem}#sidebar a,nav#sidebar a{font-size:.875rem;line-height:1.5}#sidebar .group-label,#sidebar [class*=uppercase]{font-size:.6875rem;letter-spacing:.08em;color:var(--dtc-muted)}#table-of-contents a,[id*=toc] a{color:var(--dtc-muted);font-size:.8125rem}code,pre,pre code{font-family:var(--dtc-mono);font-size:.85em}.prose pre,pre{border:1px solid var(--dtc-border);border-radius:10px}:not(pre)>code{background:rgba(17,17,17,.05);border:1px solid var(--dtc-border);border-radius:5px;padding:.1em .35em;font-weight:450}.dark :not(pre)>code{background:rgba(255,255,255,.06)}.card,a[class*=card]{border:1px solid var(--dtc-border);border-radius:12px;transition:transform .12s ease,border-color .12s ease,box-shadow .12s ease}.card:hover,a[class*=card]:hover{transform:translateY(-2px);border-color:rgba(17,17,17,.16);box-shadow:0 6px 24px rgba(17,17,17,.06)}.dark .card:hover,.dark a[class*=card]:hover{border-color:rgba(255,255,255,.2);box-shadow:0 6px 24px rgba(0,0,0,.4)}#content-area:has(#dtc-hero) #header{display:none!important}#dtc-hero{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:44px;align-items:center;background:#f9f8f6;border:1px solid rgba(17,17,17,.06);border-radius:24px;padding:40px;margin:4px 0 8px}.dark #dtc-hero{background:#111214;border-color:rgba(255,255,255,.08)}@media (max-width:900px){#dtc-hero{grid-template-columns:1fr;gap:28px;padding:28px}}.dtc-hero-eyebrow{margin:0 0 14px;font-size:.8125rem;font-weight:600;letter-spacing:.04em;color:var(--dtc-muted)}.dtc-hero-title{margin:0 0 16px;font-size:44px;line-height:1.1;font-weight:500;letter-spacing:-.88px;color:#0a0a0a;hyphens:none;overflow-wrap:normal;word-break:keep-all;text-wrap:balance}.dark .dtc-hero-title{color:#f5f5f5}@media (max-width:600px){.dtc-hero-title{font-size:36px;letter-spacing:-.7px}}.dtc-hero-sub{margin:0 0 28px;font-size:1.0625rem;line-height:1.6;color:#4a5056;max-width:30rem}.dark .dtc-hero-sub{color:#b3b9c0}.dtc-hero-actions{display:flex;gap:12px;flex-wrap:wrap}.dtc-btn{display:inline-flex;align-items:center;height:44px;padding:0 20px;border-radius:9999px;font-size:14px;font-weight:500;text-decoration:none!important;transition:transform .12s ease,opacity .12s ease,background .12s ease}.dtc-btn:hover{transform:translateY(-1px)}.dtc-btn-primary{background:#0a0a0a;color:#f9f8f6!important}.dtc-btn-primary:hover{background:#232323}.dark .dtc-btn-primary{background:#f5f5f5;color:#0a0a0a!important}.dtc-btn-secondary{background:0 0;border:1px solid rgba(10,10,10,.15)}.dtc-btn-secondary:hover{background:rgba(10,10,10,.04)}.dark .dtc-btn-secondary{color:#f5f5f5!important;border-color:rgba(255,255,255,.18)}#dtc-hero .dtc-hero-code{min-width:0}#dtc-hero .dtc-hero-code pre,#dtc-hero .dtc-hero-code>div{margin:0!important}#dtc-hero .dtc-hero-code pre{border-radius:12px;min-height:168px}a[href$=\"/agents/access/api-keys\"]{background:#0a0a0a!important;color:#f9f8f6!important;border-radius:9999px!important}a[href$=\"/agents/access/api-keys\"]:hover{background:#232323!important}a[href$=\"/agents/access/api-keys\"] *{color:#f9f8f6!important}.dark a[href$=\"/agents/access/api-keys\"]{background:#f5f5f5!important;color:#0a0a0a!important}.dark a[href$=\"/agents/access/api-keys\"] *,.dtc-btn-secondary{color:#0a0a0a!important}a[href$=\"/agents/access/api-keys\"]>*{background:0 0!important;border-color:transparent!important}"}],"page":{"pagePath":"themes/oauth","slug":"/themes/oauth","pageMetadata":{"title":"OAuth for MCP clients","summary":"For developers of MCP clients: discovery, dynamic client registration, authorization code with PKCE and resource indicators, token refresh and revocation for the theme MCP server.","href":"/themes/oauth"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`This page is for people building an `,_jsx(_components.strong,{children:`MCP client`}),`. If you use Claude Code, Codex or Cursor, the\nclient does all of this for you — see the quickstarts.`]}),`\n`,_jsxs(_components.p,{children:[`The theme MCP server follows the\n`,_jsx(_components.a,{href:`https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization`,children:`MCP authorization specification`}),`:\nOAuth 2.1 with PKCE, Protected Resource Metadata (RFC 9728), Authorization Server Metadata\n(RFC 8414), Dynamic Client Registration (RFC 7591) and Resource Indicators (RFC 8707).`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{}),_jsx(_components.th,{})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Protected resource`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`https://api.platformdtc.com/mcp/theme`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Resource metadata`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`https://api.platformdtc.com/.well-known/oauth-protected-resource/mcp/theme`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Authorization server metadata`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`https://api.platformdtc.com/.well-known/oauth-authorization-server`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Registration`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`POST https://api.platformdtc.com/oauth/register`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Authorization`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`GET https://api.platformdtc.com/oauth/authorize`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Token`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`POST https://api.platformdtc.com/oauth/token`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Revocation`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`POST https://api.platformdtc.com/oauth/revoke`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Scopes`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`read_themes`}),`, `,_jsx(_components.code,{children:`write_themes`}),`, `,_jsx(_components.code,{children:`publish_themes`}),`, `,_jsx(_components.code,{children:`write_apps`}),` (App Store partner apps)`]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`1-discover`,children:`1. Discover`}),`\n`,_jsxs(_components.p,{children:[`Call the server without a token. It answers `,_jsx(_components.code,{children:`401`}),` and points at its metadata:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`http`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-dark github-dark`,style:{backgroundColor:`#24292e`,\"--shiki-dark-bg\":`#24292e`,color:`#e1e4e8`,\"--shiki-dark\":`#e1e4e8`},language:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`HTTP`}),_jsx(_components.span,{style:{color:`#E1E4E8`,\"--shiki-dark\":`#E1E4E8`},children:`/`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:`1.1`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` 401`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` Unauthorized`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#85E89D`,\"--shiki-dark\":`#85E89D`},children:`WWW-Authenticate`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` Bearer resource_metadata=\"https://api.platformdtc.com/.well-known/oauth-protected-resource/mcp/theme\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Fetch the protected resource metadata to find the authorization server, then fetch\n`,_jsx(_components.code,{children:`/.well-known/oauth-authorization-server`}),` for its endpoints. Read endpoints from the metadata rather\nthan hard-coding them.`]}),`\n`,_jsx(Heading,{level:`2`,id:`2-register`,children:`2. Register`}),`\n`,_jsxs(_components.p,{children:[`Register once per installation. Clients are `,_jsx(_components.strong,{children:`public clients`}),` — there is no client secret — so\n`,_jsx(_components.code,{children:`token_endpoint_auth_method`}),` is `,_jsx(_components.code,{children:`none`}),`.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`10`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-dark github-dark`,style:{backgroundColor:`#24292e`,\"--shiki-dark-bg\":`#24292e`,color:`#e1e4e8`,\"--shiki-dark\":`#e1e4e8`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#B392F0`,\"--shiki-dark\":`#B392F0`},children:`curl`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -X`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` POST`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` https://api.platformdtc.com/oauth/register`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -H`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -d`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` \"client_name\": \"Acme Theme Assistant\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` \"redirect_uris\": [\"http://127.0.0.1:53682/callback\"],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` \"grant_types\": [\"authorization_code\", \"refresh_token\"],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` \"response_types\": [\"code\"],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` \"token_endpoint_auth_method\": \"none\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` }'`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:`# -> { \"client_id\": \"…\", \"client_name\": \"Acme Theme Assistant\", \"redirect_uris\": [ … ], … }`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`client_name`}),` is what the merchant sees on the consent screen, and what the issued key is named after.\nUse your product’s real name.`]}),`\n`,_jsxs(_components.p,{children:[`Because anyone can register a client, the consent screen labels a registered client\n`,_jsx(_components.strong,{children:`Unverified app`}),` and shows the host the authorization goes to. Only PlatformDTC’s own clients,\nsuch as the `,_jsx(_components.code,{children:`dtc`}),` CLI (a pre-registered client that does not use this endpoint), are shown as verified.`]}),`\n`,_jsx(Heading,{level:`2`,id:`3-authorize`,children:`3. Authorize`}),`\n`,_jsxs(_components.p,{children:[`Create a PKCE verifier (43–128 characters) and its `,_jsx(_components.strong,{children:`S256`}),` challenge, then send the user’s browser\nto the authorization endpoint:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`10`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-dark github-dark`,style:{backgroundColor:`#24292e`,\"--shiki-dark-bg\":`#24292e`,color:`#e1e4e8`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET https://api.platformdtc.com/oauth/authorize`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` ?response_type=code`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \u0026client_id=\u003cclient_id>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \u0026redirect_uri=http://127.0.0.1:53682/callback`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \u0026scope=read_themes%20write_themes%20publish_themes`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \u0026state=\u003crandom>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \u0026code_challenge=\u003cbase64url(sha256(verifier))>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \u0026code_challenge_method=S256`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \u0026resource=https://api.platformdtc.com/mcp/theme`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`The server validates the client, the exact `,_jsx(_components.code,{children:`redirect_uri`}),`, the PKCE challenge (`,_jsx(_components.code,{children:`S256`}),` only) and the\n`,_jsx(_components.code,{children:`resource`}),`, then redirects the user to the PlatformDTC consent page. There the user signs in, sees\nyour `,_jsx(_components.code,{children:`client_name`}),`, the host you will redirect to and the requested scopes, `,_jsx(_components.strong,{children:`chooses a store`}),`, may\nremove scopes, and approves or denies.`]}),`\n`,_jsxs(_components.p,{children:[`On approval the browser returns to your `,_jsx(_components.code,{children:`redirect_uri`}),`:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-dark github-dark`,style:{backgroundColor:`#24292e`,\"--shiki-dark-bg\":`#24292e`,color:`#e1e4e8`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`http://127.0.0.1:53682/callback?code=\u003ccode>\u0026state=\u003crandom>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Check that `,_jsx(_components.code,{children:`state`}),` matches. The granted scopes may be `,_jsx(_components.strong,{children:`fewer`}),` than you requested — read `,_jsx(_components.code,{children:`scope`}),`\nfrom the token response, and do not offer actions the grant does not cover.`]}),`\n`,_jsx(Heading,{level:`2`,id:`4-exchange-the-code`,children:`4. Exchange the code`}),`\n`,_jsx(CodeBlock,{numberOfLines:`8`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-dark github-dark`,style:{backgroundColor:`#24292e`,\"--shiki-dark-bg\":`#24292e`,color:`#e1e4e8`,\"--shiki-dark\":`#e1e4e8`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#B392F0`,\"--shiki-dark\":`#B392F0`},children:`curl`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -X`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` POST`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` https://api.platformdtc.com/oauth/token`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -H`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` \"Content-Type: application/x-www-form-urlencoded\"`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -d`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` grant_type=authorization_code`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -d`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` code=`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:`cod`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:`e`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`>`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -d`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` redirect_uri=http://127.0.0.1:53682/callback`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -d`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` client_id=`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:`client_i`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:`d`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`>`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -d`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` code_verifier=`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:`verifie`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:`r`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`>`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -d`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` resource=https://api.platformdtc.com/mcp/theme`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{numberOfLines:`7`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-dark github-dark`,style:{backgroundColor:`#24292e`,\"--shiki-dark-bg\":`#24292e`,color:`#e1e4e8`,\"--shiki-dark\":`#e1e4e8`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#E1E4E8`,\"--shiki-dark\":`#E1E4E8`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \"access_token\"`}),_jsx(_components.span,{style:{color:`#E1E4E8`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:`\"sq_agt_…\"`}),_jsx(_components.span,{style:{color:`#E1E4E8`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \"token_type\"`}),_jsx(_components.span,{style:{color:`#E1E4E8`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:`\"Bearer\"`}),_jsx(_components.span,{style:{color:`#E1E4E8`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \"expires_in\"`}),_jsx(_components.span,{style:{color:`#E1E4E8`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:`3600`}),_jsx(_components.span,{style:{color:`#E1E4E8`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \"refresh_token\"`}),_jsx(_components.span,{style:{color:`#E1E4E8`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:`\"…\"`}),_jsx(_components.span,{style:{color:`#E1E4E8`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \"scope\"`}),_jsx(_components.span,{style:{color:`#E1E4E8`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:`\"read_themes write_themes\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#E1E4E8`,\"--shiki-dark\":`#E1E4E8`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The `,_jsxs(_components.strong,{children:[`access token is an `,_jsx(_components.code,{children:`sq_agt_*`}),` Agent Gateway key`]}),`: bound to the store the user chose, carrying\nonly the granted scopes, expiring after `,_jsx(_components.strong,{children:`1 hour`}),`, and named `,_jsx(_components.code,{children:`OAuth: \u003cclient_name>`}),`. It works on the\nMCP server and directly on the `,_jsx(_components.a,{href:`/api-reference/overview`,children:`Agent Gateway`}),` `,_jsx(_components.code,{children:`/themes`}),` endpoints.`]}),`\n`,_jsx(Heading,{level:`2`,id:`5-call-the-server`,children:`5. Call the server`}),`\n`,_jsx(CodeBlock,{numberOfLines:`5`,language:`http`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-dark github-dark`,style:{backgroundColor:`#24292e`,\"--shiki-dark-bg\":`#24292e`,color:`#e1e4e8`,\"--shiki-dark\":`#e1e4e8`},language:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`POST`}),_jsx(_components.span,{style:{color:`#E1E4E8`,\"--shiki-dark\":`#E1E4E8`},children:` /mcp/theme `}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`HTTP`}),_jsx(_components.span,{style:{color:`#E1E4E8`,\"--shiki-dark\":`#E1E4E8`},children:`/`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:`1.1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#85E89D`,\"--shiki-dark\":`#85E89D`},children:`Host`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` api.platformdtc.com`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#85E89D`,\"--shiki-dark\":`#85E89D`},children:`Authorization`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` Bearer sq_agt_…`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#85E89D`,\"--shiki-dark\":`#85E89D`},children:`Content-Type`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` application/json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#85E89D`,\"--shiki-dark\":`#85E89D`},children:`Accept`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` application/json, text/event-stream`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`6-refresh`,children:`6. Refresh`}),`\n`,_jsx(CodeBlock,{numberOfLines:`5`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-dark github-dark`,style:{backgroundColor:`#24292e`,\"--shiki-dark-bg\":`#24292e`,color:`#e1e4e8`,\"--shiki-dark\":`#e1e4e8`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#B392F0`,\"--shiki-dark\":`#B392F0`},children:`curl`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -X`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` POST`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` https://api.platformdtc.com/oauth/token`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -H`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` \"Content-Type: application/x-www-form-urlencoded\"`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -d`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` grant_type=refresh_token`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -d`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` refresh_token=`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:`refresh_toke`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:`n`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`>`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -d`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` client_id=`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:`client_i`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:`d`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`>`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Refresh tokens `,_jsx(_components.strong,{children:`rotate`}),`: every refresh returns a new refresh token, and the old one stops working.\nA refresh token is valid for 60 days from its last use.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Reusing an old refresh token revokes the whole token family`}),`, and the user has to authorize again.\nStore the new refresh token before using the new access token, and never run two refreshes for the\nsame credentials at the same time — serialize them in your client.`]})}),`\n`,_jsx(_components.p,{children:`Refresh tokens are stored only as a hash on our side; if you lose one, authorize again.`}),`\n`,_jsx(Heading,{level:`2`,id:`7-revoke`,children:`7. Revoke`}),`\n`,_jsx(_components.p,{children:`When the user disconnects your client, revoke its token:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-dark github-dark`,style:{backgroundColor:`#24292e`,\"--shiki-dark-bg\":`#24292e`,color:`#e1e4e8`,\"--shiki-dark\":`#e1e4e8`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#B392F0`,\"--shiki-dark\":`#B392F0`},children:`curl`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -X`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` POST`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` https://api.platformdtc.com/oauth/revoke`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -H`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` \"Content-Type: application/x-www-form-urlencoded\"`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -d`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` token=`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:`refresh_token_or_access_toke`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:`n`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`>`}),_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#79B8FF`,\"--shiki-dark\":`#79B8FF`},children:` -d`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` client_id=`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:`client_i`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:`d`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`>`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`static-keys-for-headless-use`,children:`Static keys for headless use`}),`\n`,_jsxs(_components.p,{children:[`A CI job or a server with no browser can skip OAuth and send a static `,_jsx(_components.code,{children:`sq_agt_*`}),` key, created under\n`,_jsx(_components.strong,{children:`Agents → Access → API keys`}),` with the theme scopes it needs:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`1`,language:`http`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-dark github-dark`,style:{backgroundColor:`#24292e`,\"--shiki-dark-bg\":`#24292e`,color:`#e1e4e8`,\"--shiki-dark\":`#e1e4e8`},language:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#85E89D`,\"--shiki-dark\":`#85E89D`},children:`Authorization`}),_jsx(_components.span,{style:{color:`#F97583`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#9ECBFF`,\"--shiki-dark\":`#9ECBFF`},children:` Bearer sq_agt_…`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`A static key does not expire on a timer. Give it the fewest scopes the job needs and revoke it when\nthe job is retired.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"github-dark","dark":"github-dark"}},"config":{},"pageMetadata":{"title":"OAuth for MCP clients","summary":"For developers of MCP clients: discovery, dynamic client registration, authorization code with PKCE and resource indicators, token refresh and revocation for the theme MCP server.","href":"/themes/oauth"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"1. Discover","slug":"1-discover","depth":2,"children":[]},{"title":"2. Register","slug":"2-register","depth":2,"children":[]},{"title":"3. Authorize","slug":"3-authorize","depth":2,"children":[]},{"title":"4. Exchange the code","slug":"4-exchange-the-code","depth":2,"children":[]},{"title":"5. Call the server","slug":"5-call-the-server","depth":2,"children":[]},{"title":"6. Refresh","slug":"6-refresh","depth":2,"children":[]},{"title":"7. Revoke","slug":"7-revoke","depth":2,"children":[]},{"title":"Static keys for headless use","slug":"static-keys-for-headless-use","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"localhost","siteName":"PlatformDTC","title":"OAuth for MCP clients - PlatformDTC","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/themes/oauth","matchLevel":0}}},"originalFileLocation":"themes/oauth.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"PlatformDTC\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/favicons/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/favicons/favicon-32x32.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/favicons/favicon-16x16.png\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicons/favicon.ico\">\u003cmeta data-mint-head property=\"og:title\" content=\"OAuth for MCP clients - PlatformDTC\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"PlatformDTC\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://local./themes/oauth\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"OAuth for MCP clients - PlatformDTC\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/favicons/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"PlatformDTC\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#111111\">\u003clink data-mint-head rel=\"canonical\" href=\"https://local./themes/oauth\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/themes/oauth.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"PlatformDTC\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"PlatformDTC","nav":{"languages":[{"language":"en","tabs":[{"tab":"Get Started","pages":[{"title":"Get Started","href":""}]},{"tab":"Agents","pages":[{"title":"Agents","href":"/agents/playbook"}]},{"tab":"Themes","groups":[{"group":"Build with your agent","pages":[{"title":"Build with your agent","href":"/themes/overview"},{"title":"Quickstart: Claude Code","href":"/themes/quickstart-claude-code"},{"title":"Quickstart: Codex","href":"/themes/quickstart-codex"},{"title":"Quickstart: Cursor","href":"/themes/quickstart-cursor"},{"title":"CLI guide","href":"/themes/cli"},{"title":"Custom React sections","href":"/themes/custom-sections"}]},{"group":"Theme reference","pages":[{"title":"Template JSON reference","href":"/themes/template-json"},{"title":"Theme check rules","href":"/themes/theme-check"},{"title":"Scopes and approvals","href":"/themes/scopes-and-approvals"},{"title":"MCP tool reference","href":"/themes/mcp-tools"},{"title":"OAuth for MCP clients","href":"/themes/oauth"},{"title":"Troubleshooting","href":"/themes/troubleshooting"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/overview"}]},{"tab":"Fulfillment","pages":[{"title":"Fulfillment","href":"/fulfillment/overview"}]},{"tab":"Commerce","pages":[{"title":"Commerce","href":"/commerce/products"}]},{"tab":"Recipes","pages":[{"title":"Recipes","href":"/recipes/build-a-store"}]},{"tab":"Partner Apps","pages":[{"title":"Partner Apps","href":"/partners/getting-started"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/v1"}]}]}]},"basePath":"","title":"OAuth for MCP clients - PlatformDTC","buildId":"b48c568d22cf","dynamics":[],"chunks":[]}