Skip to content
API & MCP

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).

  1. The client calls https://meemoo.tech/mcp without a credential and gets 401 with WWW-Authenticate: Bearer resource_metadata="https://meemoo.tech/.well-known/oauth-protected-resource/mcp".
  2. It reads the resource metadata and, from there, the authorization server metadata.
  3. It registers itself with POST /api/oauth/register (once).
  4. It sends the person to https://meemoo.tech/oauth/authorize with PKCE. The person signs in to meemoo, sees what the client asks for and approves.
  5. meemoo returns to the redirect_uri with a code. The client exchanges it for tokens at POST /api/oauth/token.
  6. It calls the MCP server (or API v1) with Authorization: Bearer mmoa_… and refreshes with the mmor_… when it expires.
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/"
}

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
Ventana de terminal
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"}'

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.

  • It must match one of the registered ones exactly.
  • https://… always.
  • http://… only to the local machine: localhost, 127.0.0.1 or [::1].
  • An app’s own scheme, like cursor://….
  • Never javascript:, data:, file:, vbscript:, blob:, about:, ftp:, ws: or wss:.
  • No fragment (#…).

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_uri with code, state and iss=https://meemoo.tech.
  • Cancels: returns with error=access_denied.
  • A parameter is wrong (but the client and redirect_uri are valid): returns with error, error_description, state and iss. If the client_id or redirect_uri aren’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).

Ventana de terminal
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/callback

Response:

{
"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

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.
  • 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.