Connect Insomnia to MCP with OAuth
Audience: Developer.
Use this procedure to test backend OAuth before you configure another client.
Prerequisites
- Run a backend with the MCP OAuth endpoints available.
- Use Insomnia and a normal backend user account.
- Use the actual backend base URL when it differs from
http://localhost:3333.
1. Register an OAuth client
In Insomnia, open the request’s OAuth 2 settings. Copy the exact value from Redirect URL.
Register this redirect URI in the backend:
curl -X POST http://localhost:3333/v1/oauth/register \
-H 'Content-Type: application/json' \
-d '{
"client_name": "Insomnia Local Test",
"redirect_uris": ["PASTE_THE_INSOMNIA_REDIRECT_URI_HERE"],
"grant_types": ["authorization_code", "refresh_token"],
"response_types": ["code"],
"scope": "mcp",
"token_endpoint_auth_method": "none"
}'Save the returned client_id.
2. Fill in the Insomnia OAuth fields
Use these values:
| Field | Value |
|---|---|
| Grant Type | Authorization Code |
| Authorization URL | http://localhost:3333/v1/oauth/authorize |
| Access Token URL | http://localhost:3333/v1/oauth/token |
| Client ID | returned client_id |
| Client Secret | leave empty |
| Use PKCE | enabled |
| Code Challenge Method | SHA-256 |
| Redirect URL | exactly the same URI you registered |
| Scope | mcp |
| State | any random value |
| Credentials | In Request Body is preferred |
| Header Prefix | Bearer |
| Audience | leave empty |
| Resource | http://localhost:3333/v1/ai/mcp |
| Origin | leave empty |
3. Complete the flow
When Insomnia fetches a token:
- It opens
/v1/oauth/authorizein the browser. - You sign in with a normal backend user account.
- You approve consent.
- Insomnia exchanges the code at
/v1/oauth/token. - Insomnia stores the returned bearer token and can call
/v1/ai/mcp.
4. Common errors
- Redirect URI mismatch: the Insomnia redirect URI must exactly match the value registered with
/v1/oauth/register. - Missing resource: the
resourcefield must match the MCP endpoint exactly. - PKCE disabled: Configure Insomnia to send PKCE with
S256. - Wrong scope: use
mcp.
Verify the connection
- Complete sign-in and consent in the browser.
- Make sure Insomnia receives the bearer token.
- Use the issued token to call
/v1/ai/mcp. - Resolve the common errors above before you configure ChatGPT.
The OAuth reference defines discovery, scope, resource, and PKCE requirements.
Last updated on