This is not the same OAuth flow used by the REST API. REST API OAuth is for partner integrations that act on behalf of merchants. MCP OAuth is initiated by the merchant themselves through their MCP client.
Discovery
When an MCP client first connects tohttps://api.loopreturns.com/mcp, it fetches the protected resource metadata to discover the authorization server:
https://api.loopreturns.com) as the OAuth authorization server, the supported scopes, and the endpoints below.
Authorization endpoints
All four endpoints live under
https://api.loopreturns.com.
Redirect URI validation
POST /oauth/register returns Loop’s pre-configured client_id. It does not register your redirect URI as a trusted value.
GET /oauth/authorize validates redirect_uri against a fixed allowlist of known client patterns. Loop accepts:
- The custom schemes
claude://,cursor://, andvscode:// - HTTPS hosts for approved clients, including
claude.ai,claude.com,chatgpt.com,chat.openai.com,vscode.dev, andglobal.consent.azure-apim.netfor Microsoft Copilot Studio and Power Platform custom connectors http://localhostwith an explicit port, for desktop and CLI clients
Flow overview
Multi-tenant shop resolution
A single email can be associated with multiple Loop shops. The MCP OAuth flow resolves the right shop in one of three ways:login_hintprovided. The client passes the email up front; Loop looks up the associated shops.- Email form. If no hint is provided, Loop shows an email input form.
- Shop selector. If the email is associated with more than one shop, Loop shows a shop selection form before sign-in continues.
Token handling
Loop returns a signed bearer token that MCP clients present on each tool call. Clients should treat this token as opaque: store it securely, send it only to Loop, and reconnect when the client reports that the session has expired.Using the token
Pass the token in theAuthorization header on every MCP request:
Permissions
Once authenticated, the user is subject to the same role-based permissions that govern their access to the Loop Admin. Each MCP tool declares the permissions it requires (OR logic — at least one is sufficient). If a user lacks every required permission, the tool returns an authorization error and is hidden from the assistant’s tool catalog where possible.Rate limits
Exceeded limits return
429 Too Many Requests with a Retry-After header.
Troubleshooting
The browser opens but I see 'Email not found'
The browser opens but I see 'Email not found'
Loop didn’t find any shops associated with the email you submitted. Confirm the email matches a user record in your Loop Admin (under Settings → Team).
The MCP client says 'Token expired'
The MCP client says 'Token expired'
Reconnect the server in your MCP client to start a fresh OAuth flow.
Next steps
Get Started
Connect Claude, Cursor, or VS Code Copilot to the Loop MCP Server.
Overview
See the full list of tools the MCP server exposes.