Skip to Content
How-to guidesMCP connectionsConnect Insomnia to MCP with OAuth

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:

FieldValue
Grant TypeAuthorization Code
Authorization URLhttp://localhost:3333/v1/oauth/authorize
Access Token URLhttp://localhost:3333/v1/oauth/token
Client IDreturned client_id
Client Secretleave empty
Use PKCEenabled
Code Challenge MethodSHA-256
Redirect URLexactly the same URI you registered
Scopemcp
Stateany random value
CredentialsIn Request Body is preferred
Header PrefixBearer
Audienceleave empty
Resourcehttp://localhost:3333/v1/ai/mcp
Originleave empty

3. Complete the flow

When Insomnia fetches a token:

  1. It opens /v1/oauth/authorize in the browser.
  2. You sign in with a normal backend user account.
  3. You approve consent.
  4. Insomnia exchanges the code at /v1/oauth/token.
  5. 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 resource field must match the MCP endpoint exactly.
  • PKCE disabled: Configure Insomnia to send PKCE with S256.
  • Wrong scope: use mcp.

Verify the connection

  1. Complete sign-in and consent in the browser.
  2. Make sure Insomnia receives the bearer token.
  3. Use the issued token to call /v1/ai/mcp.
  4. Resolve the common errors above before you configure ChatGPT.

The OAuth reference defines discovery, scope, resource, and PKCE requirements.

Last updated on