---
title: "MCP authentication and organizations"
description: "How an AI client authenticates to Flowie's MCP servers: sign-in with OAuth 2.1 and PKCE (discovery, dynamic client registration, tokens), API keys, OAuth client credentials for platforms such as Agentforce, confidential clients, organizations and permissions."
canonical: "https://docs.get-flowie.com/mcp/auth"
source: "https://docs.get-flowie.com/mcp/auth.html"
---

# MCP authentication and organizations

MCP

# Authentication

Pick the method by _who is acting_ , not by which client you use. Every method gives a Bearer token that the server passes to the API unchanged, so an agent can never do more than the person or organization behind the token.

For
    Admins and developers setting up MCP access

Applies to
    App server and Exchange API server

Updated
    1 Dec 2026

## Pick a method

Method| Use it when| Servers| What you configure  
---|---|---|---  
**Sign-in** (OAuth 2.1 + PKCE)| A person is behind the agent: Claude, ChatGPT, Cursor, VS Code, Claude Code, Amazon Quick| Both| Nothing but the URL. The client opens the Flowie sign-in page the first time.  
**API key** (`flw_live_…` / `flw_test_…`)| No person is present: an ERP, CI, a cron job, a back end| Exchange API| An `Authorization: Bearer` header  
**Machine client** (OAuth client credentials)| A platform that connects as a machine: Salesforce Agentforce, Oracle AI Agent Studio| Exchange API| Client ID, secret and token URL  
  
## Sign-in (OAuth)

Sign-in follows the standard MCP authorization flow, so a compliant client needs only the server URL:

  1. A call without a token answers `401` with `WWW-Authenticate: Bearer resource_metadata="https://back.p2p-flowie.com/exchange/.well-known/oauth-protected-resource/mcp"`.
  2. That document names the authorization server, `https://back.p2p-flowie.com/exchange`, and the scopes.
  3. Its metadata, at `https://back.p2p-flowie.com/exchange/.well-known/oauth-authorization-server`, gives the authorize endpoint `…/exchange/oauth/authorize`, the token endpoint `…/exchange/v1/oauth/token` and the registration endpoint `…/exchange/v1/oauth/register`.
  4. The client registers itself ([dynamic client registration](<https://www.rfc-editor.org/rfc/rfc7591>), public client, PKCE `S256`). A redirect to your own machine is accepted on any port.
  5. You sign in on the normal Flowie login page (SSO and Google work) and approve the access.



The access token lasts 24 hours. The client renews it with a refresh token, with no new consent. The same flow serves the App server: its token is issued by the same authorization server.

## API key

For the Exchange API server only. Send the key as a Bearer token on the MCP connection:
[code] 
    claude mcp add --transport http flowie-api https://back.p2p-flowie.com/exchange/mcp \
      --header "Authorization: Bearer $FLOWIE_API_KEY"
[/code]

  * `flw_live_…` keys work on `back.p2p-flowie.com`; `flw_test_…` keys on `back.flowie.ink`. A key on the other host is rejected.
  * Create, scope and revoke keys on [API Keys](<../sandbox/keys.html>). Give an agent a key with only the scopes it needs.
  * The App server never accepts an API key: it acts as a person, so it needs a sign-in.



## Machine clients

Platforms that connect an MCP server as a machine use OAuth 2.0 client credentials. An admin of your Flowie organization creates the client with `POST /v1/oauth/clients` and names the role it gets; the response carries the `clientId` and the `clientSecret`, shown once. The platform then exchanges them at `https://back.p2p-flowie.com/exchange/v1/oauth/token` for a token. The token endpoint adds the Flowie API audience, so no `audience` field is needed. Repeated failed authentications are answered with `429` and `Retry-After`. Full details: [auth.md](<../auth.md>), section Machine-to-machine. Platform setup: [Agentforce and Oracle](<connect.html#agentforce-oracle>).

## Confidential clients

Hosted platforms that cannot do PKCE, for example Azure Bot Service, whose token service runs the authorization-code flow on its own servers, can use a **confidential client**. Flowie creates it on request with your exact redirect URIs and gives you a `client_id` and `client_secret`. `/oauth/authorize` then accepts it without `code_challenge`, and the token endpoint requires the secret, as HTTP Basic (`client_secret_basic`) or in the form body (`client_secret_post`). Wrong or missing credentials are a `401` `invalid_client`. Ask [developers@flowie.fr](<mailto:developers@flowie.fr>).

## Organizations

  * **App server.** `list_my_organizations` lists the organizations you can reach, and every tool takes an optional `organization_id` to say which one to act in.
  * **Exchange API server.** The token decides. A signed-in user, an API key or a machine client acts on its own organization. The MCP server forwards only the `Authorization` header to the API, so the REST headers `X-Flowie-Organization-Id` and `Idempotency-Key` cannot be set over MCP. To act for several organizations, register one connection per organization, each with its own key or client. Platform and white-label keys that act for managed companies by header should call the [REST API](<../reference/index.html>) for those calls.



## Permissions and safety

  * **Same rights as the token.** A signed-in token reaches the organizations you can reach, with the permissions you hold in each. A key is limited to its scopes.
  * **Reads and writes are labelled.** Every Exchange API tool carries hints: `GET` tools are read-only, `DELETE` tools destructive. Let your client run reads freely and ask before anything else.
  * **No money moves.** Payment tools record payment facts on an invoice (date, amount, reference). They never move funds.
  * **Test before production.** Rehearse prompts on staging with an `flw_test_…` key; see [Sandbox](<errors.html#sandbox>).
  * **Revoke** a key on [API Keys](<../sandbox/keys.html>), or remove the connector in your client, and the agent loses access at once.
