Skip to main content
Melso uses OAuth authorization code flow with PKCE S256. The public scope is mcp:tools. It grants access to the tools that the selected company and person permit; it does not bypass membership, plan or human-approval checks. Fetch metadata instead of hardcoding the authorization endpoint in a client:
Use the same protected-resource URL throughout discovery, authorization, token exchange and MCP calls. These examples use https://melso.ai/api/mcp; do not switch to an alias partway through the flow.

Token exchange

A compatible MCP client normally handles registration, the browser redirect, PKCE, state validation, and token storage. Melso supports public PKCE clients with token_endpoint_auth_method: none: send client_id and omit client_secret on both exchange and refresh. A custom client sends form-encoded token requests. The Bash example below requires Python 3 and an interactive terminal. Enter values from the authorization flow your client just completed; the redirect URI and verifier must match that flow. Prompts hide the values, form data reaches curl through standard input, and the token response is saved to a private temporary file. No secret is passed as a command argument or exported variable.
Read access_token from that file for the first MCP read. Import the access and refresh tokens into your client’s secure storage, then remove the temporary file. Do not paste the response into a conversation or log it. The example prints only the file path.

Refresh a connection

Use the same registered client_id and the latest refresh_token. Keep resource=https://melso.ai/api/mcp in refresh requests too. The server accepts an omitted resource; if supplied, it must be a supported Melso MCP resource URL. Omission does not select a different company or audience.
Refresh rotates both tokens. Store each newly returned token pair atomically, retire the old pair, and remove the temporary response file after import. Revocation accepts an access or refresh token; company membership is rechecked on calls. Never log access tokens, refresh tokens, authorization codes or the verifier. Personal memory belongs to the person behind the OAuth grant. Run tokens and integration identities cannot read or write personal memory; see Memories. See the protocol reference for transport and company binding; the OAuth endpoint reference owns request and response contracts.