OAuth 2.1 for developers
This page is for people building an MCP client or an app that asks for access with “Sign in with meemoo”. If you only want to connect claude.ai or ChatGPT, see Connect your assistant.
meemoo implements what’s needed from the standard: metadata (RFC 9728 and RFC 8414), dynamic registration (RFC 7591), authorization code with mandatory PKCE S256, rotating refresh tokens and revocation (RFC 7009).
The full flow
Section titled “The full flow”- The client calls
https://meemoo.tech/mcpwithout a credential and gets 401 withWWW-Authenticate: Bearer resource_metadata="https://meemoo.tech/.well-known/oauth-protected-resource/mcp". - It reads the resource metadata and, from there, the authorization server metadata.
- It registers itself with
POST /api/oauth/register(once). - It sends the person to
https://meemoo.tech/oauth/authorizewith PKCE. The person signs in to meemoo, sees what the client asks for and approves. - meemoo returns to the
redirect_uriwith acode. The client exchanges it for tokens atPOST /api/oauth/token. - It calls the MCP server (or API v1) with
Authorization: Bearer mmoa_…and refreshes with themmor_…when it expires.
Metadata
Section titled “Metadata”| URL | What it is |
|---|---|
GET /.well-known/oauth-protected-resource |
Resource metadata (RFC 9728) |
GET /.well-known/oauth-protected-resource/mcp |
The same, at the path the 401 announces |
GET /.well-known/oauth-authorization-server |
Authorization server metadata (RFC 8414) |
GET /.well-known/oauth-authorization-server/mcp |
The same, for clients that look it up with the resource path |
Resource:
{ "resource": "https://meemoo.tech/mcp", "authorization_servers": ["https://meemoo.tech"], "scopes_supported": ["cerebro:read", "cerebro:write"], "bearer_methods_supported": ["header"], "resource_name": "meemoo", "resource_documentation": "https://meemoo.tech/docs/"}Authorization server:
{ "issuer": "https://meemoo.tech", "authorization_endpoint": "https://meemoo.tech/oauth/authorize", "token_endpoint": "https://meemoo.tech/api/oauth/token", "registration_endpoint": "https://meemoo.tech/api/oauth/register", "revocation_endpoint": "https://meemoo.tech/api/oauth/revoke", "response_types_supported": ["code"], "grant_types_supported": ["authorization_code", "refresh_token"], "code_challenge_methods_supported": ["S256"], "token_endpoint_auth_methods_supported": ["none", "client_secret_post", "client_secret_basic"], "revocation_endpoint_auth_methods_supported": ["none", "client_secret_post", "client_secret_basic"], "scopes_supported": ["cerebro:read", "cerebro:write"], "service_documentation": "https://meemoo.tech/docs/"}Dynamic registration
Section titled “Dynamic registration”POST https://meemoo.tech/api/oauth/register with a JSON body. Limit: 60 registrations per minute per IP. A registered
client that was never used (nobody approved it) is deleted after 30 days.
| Field | Required | Values | Default |
|---|---|---|---|
redirect_uris |
yes | 1 to 10, each up to 500 characters (rules below) | |
token_endpoint_auth_method |
no | none, client_secret_post, client_secret_basic |
client_secret_basic |
grant_types |
no | only authorization_code and refresh_token |
both |
response_types |
no | only code |
code |
client_name |
no | up to 100 characters; it’s what the person sees when approving | Agente |
curl -X POST https://meemoo.tech/api/oauth/register \ -H "Content-Type: application/json" \ -d '{"client_name":"My agent","redirect_uris":["https://myagent.example/callback"],"token_endpoint_auth_method":"none"}'const res = await fetch("https://meemoo.tech/api/oauth/register", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ client_name: "My agent", redirect_uris: ["https://myagent.example/callback"], token_endpoint_auth_method: "none", }),});const client = await res.json(); // client.client_idimport requests
res = requests.post( "https://meemoo.tech/api/oauth/register", json={ "client_name": "My agent", "redirect_uris": ["https://myagent.example/callback"], "token_endpoint_auth_method": "none", },)client = res.json() # client["client_id"]Returns 201:
{ "client_id": "mmc_…", "client_id_issued_at": 1794668400, "client_name": "My agent", "redirect_uris": ["https://myagent.example/callback"], "token_endpoint_auth_method": "none", "grant_types": ["authorization_code", "refresh_token"], "response_types": ["code"], "scope": "cerebro:read cerebro:write"}A confidential client (client_secret_post or client_secret_basic) also gets client_secret (mmcs_…) and
client_secret_expires_at: 0 (never expires). Store it: it’s not shown again.
redirect_uri rules
Section titled “redirect_uri rules”- It must match one of the registered ones exactly.
https://…always.http://…only to the local machine:localhost,127.0.0.1or[::1].- An app’s own scheme, like
cursor://…. - Never
javascript:,data:,file:,vbscript:,blob:,about:,ftp:,ws:orwss:. - No fragment (
#…).
Authorize
Section titled “Authorize”Send the person to GET https://meemoo.tech/oauth/authorize with these parameters:
| Parameter | Required | Value |
|---|---|---|
response_type |
yes | code |
client_id |
yes | the mmc_… from registration |
redirect_uri |
if you registered more than one | one of the registered ones |
code_challenge |
yes | PKCE: base64url of the SHA-256 of the code_verifier, 43 to 128 characters |
code_challenge_method |
yes | S256 (the only one) |
scope |
no | cerebro:read, cerebro:write or both separated by a space. Default: both. Unknown ones are ignored; if none is left, invalid_scope |
state |
recommended | returned as is |
resource |
no | if present: https://meemoo.tech/mcp, https://meemoo.tech/api/v1 or https://meemoo.tech; anything else gives invalid_target |
meemoo’s page asks for the person’s session and shows them the client’s name, what it asks for and which domain they’ll return to.
- Approves: returns to the
redirect_uriwithcode,stateandiss=https://meemoo.tech. - Cancels: returns with
error=access_denied. - A parameter is wrong (but the client and
redirect_uriare valid): returns witherror,error_description,stateandiss. If theclient_idorredirect_uriaren’t valid, the error is shown to the person and there is no redirect.
Approving the same client again reuses its access. A new grant counts toward the plan’s connected-agent limit (Core 5, Pro 25); if it’s reached, the person sees a notice and has to disconnect one first.
POST https://meemoo.tech/api/oauth/token with a form body (application/x-www-form-urlencoded). The client identifies
itself with client_id in the body (public), client_id and client_secret in the body (client_secret_post) or HTTP
Basic (client_secret_basic).
Exchange the code: grant_type=authorization_code, code, code_verifier, client_id and, if you send it,
redirect_uri (must be the same as in the authorization).
Refresh: grant_type=refresh_token, refresh_token, client_id and, for less access, scope (never more than what
was approved).
curl -X POST https://meemoo.tech/api/oauth/token \ -d grant_type=authorization_code \ -d code="$CODE" \ -d code_verifier="$CODE_VERIFIER" \ -d client_id="$CLIENT_ID" \ -d redirect_uri=https://myagent.example/callbackimport { createHash, randomBytes } from "node:crypto";
// PKCE: keep the verifier; send the challenge to /oauth/authorizeconst codeVerifier = randomBytes(40).toString("base64url");const codeChallenge = createHash("sha256").update(codeVerifier).digest("base64url");
// Later, with the code that came back to your redirect_uri:const res = await fetch("https://meemoo.tech/api/oauth/token", { method: "POST", body: new URLSearchParams({ grant_type: "authorization_code", code, code_verifier: codeVerifier, client_id: clientId, redirect_uri: "https://myagent.example/callback", }),});const tokens = await res.json(); // access_token, refresh_token, expires_inimport base64, hashlib, secretsimport requests
# PKCE: keep the verifier; send the challenge to /oauth/authorizecode_verifier = secrets.token_urlsafe(40)code_challenge = base64.urlsafe_b64encode( hashlib.sha256(code_verifier.encode()).digest()).rstrip(b"=").decode()
# Later, with the code that came back to your redirect_uri:res = requests.post( "https://meemoo.tech/api/oauth/token", data={ "grant_type": "authorization_code", "code": code, "code_verifier": code_verifier, "client_id": client_id, "redirect_uri": "https://myagent.example/callback", },)tokens = res.json() # access_token, refresh_token, expires_inResponse:
{ "access_token": "mmoa_…", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "mmor_…", "scope": "cerebro:read cerebro:write"}- The access token (
mmoa_…) is valid for 1 hour. It works for MCP and for API v1. - The refresh token (
mmor_…) is valid for 90 days and rotates on every use: each refresh returns a new one and the old one stops working. Reusing an already rotated one (more than 30 seconds later) cuts off that client’s whole grant. - The code is valid for 10 minutes and once. Using it twice revokes the tokens it already issued.
Errors (standard OAuth shape, { "error": "…", "error_description": "…" }):
| HTTP | error |
When |
|---|---|---|
| 401 | invalid_client |
Unknown client or wrong secret |
| 400 | invalid_request |
Missing code, code_verifier or refresh_token |
| 400 | invalid_grant |
Invalid, expired or already used code; code_verifier or redirect_uri that don’t match; invalid, expired or already used refresh token; revoked grant |
| 400 | invalid_scope |
The refresh asks for more than what was approved |
| 400 | unsupported_grant_type |
A grant_type other than authorization_code or refresh_token |
Revoke
Section titled “Revoke”POST https://meemoo.tech/api/oauth/revoke (RFC 7009), as a form, with token and the client’s identification. It
always returns 200.
- Revoking a refresh token ends that client’s whole grant (the grant and all its tokens).
- Revoking an access token ends only that token.
On the person’s side
Section titled “On the person’s side”- Each approval is a grant the person sees in Connections → MCP and can disconnect at any time. Once disconnected, its tokens stop working immediately.
- Changing the meemoo password revokes every OAuth grant and every personal token.