ETLMCPData Conveyance Works
Log in Start free
Docs

Connecting an MCP client with OAuth

How an MCP client finds etlmcp's OAuth server, which redirect URIs and scopes it accepts, and what you approve on the consent page.

To connect a chat app or agent to etlmcp with OAuth, give it the MCP server address, https://app.etlmcp.com/mcp, and nothing else. The client calls that address without a token, gets a 401 that points it to etlmcp's discovery documents, registers or identifies itself, and opens a browser window where you sign in and approve access for one workspace. After you approve, the client holds a token issued for the /mcp endpoint and the workspace you chose. The same address is shown on the API page in the app, under "Where to Connect".

If your client lets you set a request header, such as Claude Code or Cursor (the examples the API page gives), you can skip OAuth and send an API key: see API keys. The tools the client then sees are listed on the MCP reference.

How the client finds the authorization server

The authorization part of the Model Context Protocol specification (version 2025-06-18) requires an MCP server that returns a 401 to point, in its WWW-Authenticate header, to its protected resource metadata, which the client then uses to find the authorization server and its metadata. etlmcp follows that path:

  1. A request to /mcp with no Authorization header, or with a token etlmcp does not recognize, gets a 401 with the body invalid or missing credentials. Its WWW-Authenticate header is a Bearer challenge whose resource_metadata points to /.well-known/oauth-protected-resource/mcp on the same host, and it lists the scopes read run.
  2. That document names the resource (the /mcp address), the app host as its only authorization server, the scopes read and run, and the header as the only way to send a token.
  3. The authorization server metadata is at /.well-known/oauth-authorization-server. It lists the authorize, token, registration and revocation endpoints under /oauth/, the authorization_code and refresh_token grant types, S256 as the only PKCE method, and none as the only token endpoint authentication method. There is no client secret: every client is a public client.

Both discovery documents can be read from a browser page on any site and are cached for a few minutes. A token sent in the query string instead of the header is refused with a 400 and send credentials in the Authorization header, never in the URL. The endpoint accepts only POST requests once the token checks pass.

How the client identifies itself

etlmcp accepts two kinds of client id:

  • A Client ID Metadata Document. The client id is an https address with a path, on a named host (not a bare IP address). etlmcp fetches the JSON document at that address when a signed-in user starts the flow, checks that its client_id matches the address, that it has a client_name and redirect URIs, and that it asks for no client secret, then caches it.
  • Dynamic registration. A client that has no such document posts its redirect URIs to /oauth/register and receives a client id. Registrations are rate limited per IP address, and a client that registers this way is shown on the consent page as a "self-registered app".

Redirect URI rules

Every redirect URI must be https, or plain http on a loopback host: 127.0.0.1, [::1] or localhost, which is how desktop clients receive the code on your own computer. A URI with a fragment or a user name in it is refused too. At /oauth/register, a bad URI fails with redirect_uri must be https, or http on 127.0.0.1, [::1] or localhost; a metadata document with a bad URI makes the client invalid.

At authorization time the redirect URI must exactly match one the client registered or published. For loopback addresses only, the port may differ. A mismatch shows an error page titled "Cannot connect this app" with redirect_uri is not registered for this client. An unknown client, or a metadata document that cannot be fetched or fails the checks, shows the same page with unknown or invalid client. In both cases etlmcp never sends your browser anywhere.

What else the authorization request must carry

  • PKCE with S256. Without it the request fails with PKCE with code_challenge_method S256 is required.
  • A scope of read or read run. No scope at all means both. Anything else fails with scope must be 'read' or 'read run': run alone is not accepted.
  • If the client sends a resource parameter, it must be the /mcp address exactly, or the request fails with resource must be this server's MCP endpoint.

These failures also show on the "Cannot connect this app" page, in your browser, rather than being sent back to the client.

The consent page

You must be signed in; if you are not, etlmcp sends you to the login page and back. The consent page names the app and, for a metadata-document client, the host its client id lives on. It names your organization, and if you belong to more than one workspace it lets you choose the one the app may use: the grant acts in that workspace only. It lists what each requested scope allows, in plain words ("Read your sources, destinations, pipelines, runs and stored data" and "Start runs of your pipelines"), and says which host you are sent to after you approve. When that host is a loopback address, it warns you to approve only a connection you just started yourself. Your email must be verified before you can approve.

To connect the app to another organization, switch organization in Settings first and start again from the app.

Tokens are issued for /mcp

Every grant is made for the /mcp resource. At the token endpoint, a resource that differs from the grant's fails with resource does not match the code (or resource does not match the token on refresh). On /mcp itself, an OAuth token issued for any other resource is refused with a 401, as the MCP specification requires. Refresh tokens rotate: using one a second time fails with refresh token already used and revokes the whole grant, so the app has to be approved again.

Seeing and removing connected apps

The API page lists connected apps with the workspace, who approved them, their scopes and when each was last used. You can disconnect an app you approved; an owner can disconnect any of them. Disconnecting takes effect at once.

Once connected, the client can call the tools its scopes allow. Only run_pipeline needs run; query_data, get_run and the list tools need read.

Related

Sources

  1. Authorization — modelcontextprotocol.io, checked