SourcesMCP Servers

MCP Authentication

Authentication for MCP sources in Fabric Agents — bearer tokens, OAuth with dynamic client registration, token refresh, and credential storage.

MCP servers support three authentication styles in Fabric Agents: none, bearer token, and OAuth. Set the mode with mcp.authType in the source's config.json. A server can also be public with a sign-in for the rest: see Public, with sign-in to write.

none

Public MCP servers don't need credentials. The source connects immediately on enable.

{
  "mcp": {
    "url": "https://example.com/mcp",
    "authType": "none"
  }
}

bearer

The classic "paste an API token" flow. Fabric Agents stores the token in the OS keychain (or the encrypted credential store on Linux) and sends it as Authorization: Bearer <token> on every MCP request.

{
  "mcp": {
    "url": "https://mcp.example.com",
    "authType": "bearer"
  }
}

In the UI, the source shows a Connect button. Paste the token, save, and the source becomes usable. Editing the source later shows Reconnect — same flow, replaces the stored token.

Bearer tokens don't auto-refresh. If your provider issues short-lived tokens, consider using OAuth instead (if the server supports it) or rotating manually.

oauth

The full OAuth 2.0 dance, with automatic token refresh. This is what most hosted MCP servers use today.

{
  "mcp": {
    "url": "https://mcp.linear.app/mcp",
    "authType": "oauth"
  }
}

When you click Connect on an OAuth source, Fabric Agents:

  1. Discovers the server's authorization metadata: its protected-resource metadata (RFC 9728, /.well-known/oauth-protected-resource, named in a 401 challenge or read from the well-known location), then its authorization server (/.well-known/oauth-authorization-server). The sign-in names the server it's for (RFC 8707), so the token is accepted there.
  2. Dynamically registers as an OAuth client if the server supports RFC 7591, as a native application on the desktop and a web one through the relay. You don't need to pre-register an app — Fabric Agents does it on the fly.
  3. Opens your browser to the authorization URL. You approve the connection.
  4. Receives the authorization code at a local callback (desktop app) or at the stable relay URL https://agents.fabric.pro/auth/callback (Web UI and headless server setups).
  5. Checks the response belongs to this sign-in: its state, and its iss against the authorization server Fabric discovered (RFC 9207; a server that promises iss must send it). A response from anywhere else is never used.
  6. Exchanges the code for an access token plus refresh token.
  7. Stores everything in the credential store: access_token, refresh_token, expiresAt, the clientId it registered with, and the authorization server it belongs to. A refresh never goes to a different authorization server: if the source's server moves to another one, Fabric asks you to sign in again.

After this, you're done. The source just works.

Scopes

By default the sign-in sends no scope, and the server grants its default scopes. To ask for specific ones, list them in mcp.scopes:

{
  "mcp": {
    "url": "https://mcp.example.com/mcp",
    "authType": "oauth",
    "scopes": ["read", "write"]
  }
}

When the server's own sign-in challenge asks for a scope too, Fabric requests both: the listed scopes and the challenged one, each once.

Public, with sign-in to write

Some servers answer anyone for their read tools and ask for a sign-in only for some calls, such as writing or reading your own drafts. TechFabric's server at https://www.techfabric.com/mcp works this way. Fabric saves such a source as OAuth with publicAccess:

{
  "mcp": {
    "url": "https://www.techfabric.com/mcp",
    "authType": "oauth",
    "publicAccess": true
  }
}
  • Before you sign in, its public tools work, without a token. The source's page shows Sign in next to the server URL.
  • When a call needs a sign-in, the server refuses it with a sign-in challenge (401, or 403 with insufficient_scope when your sign-in lacks the access). The agent then offers the sign-in card in the chat, and calls the tool again once you've signed in.
  • After you sign in, every call carries your token, and it refreshes like any OAuth source.

You don't need to set this up. When a source is tested, Fabric saves it this way if the server answers without a sign-in and publishes OAuth metadata. A source saved earlier without auth is switched the first time the server asks for a sign-in.

Token refresh

Fabric Agents watches token expiry. When a token is within ~5 minutes of expiring, it refreshes automatically using the stored refresh token and clientId. You never have to re-authenticate unless the refresh token itself is revoked.

If refresh fails — usually because the user revoked the grant on the server side — the source goes back to "needs auth" and shows the Reconnect button. Google, Slack and Microsoft sources also try refreshing an expired token before asking you to sign in again.

One sign-in for parallel sessions

Only one sign-in runs per workspace and source at a time. When several sessions need the same source, they share it: clicking the sign-in card in another waiting session joins the sign-in already in progress instead of opening a new browser window, and finishing it resumes every session that was waiting. If you closed or lost that browser window, starting the sign-in again replaces it.

Redirect URIs

  • Desktop app: redirect URI is a short-lived localhost URL (http://127.0.0.1:<port>/callback). The OAuth server redirects to that URL; the desktop app picks up the code.
  • Web UI / headless server: redirect URI is the stable public relay https://agents.fabric.pro/auth/callback. The relay reads which Fabric server the sign-in came from (it travels in the sign-in's state) and shows a Continue to <your server> page; continuing hands the provider's answer, iss included, to your server's /api/oauth/callback, which checks it and finishes the sign-in. Your server only has to be reachable from your browser, not from the internet. The relay only ever continues to a Fabric callback address, and never redirects to another site on its own.
  • A desktop app connected to a remote server: the relay sends the answer straight back to the app's local callback on your computer.
  • Servers that refuse the relay: some MCP servers accept only a local redirect address. Desktop sign-ins already try the local callback first; add "oauthRelay": false to the source's mcp block to make it the only one (the sign-in then comes straight back to the app on localhost).

Where credentials are stored

PlatformStorage
macOSKeychain
WindowsCredential Manager
LinuxEncrypted ~/.fabric-agent/credentials/

The credential store holds three credential types for sources:

KindUsed for
source_bearerRaw bearer tokens (auth type bearer).
source_oauthOAuth access token, refresh token, expiry, registered clientId.
source_api_key / source_basicAPI-source equivalents — see APIs.

Config files (~/.fabric-agent/workspaces/{ws}/sources/{slug}/config.json) never contain tokens. They hold the authType and the server metadata, nothing secret. You can commit a workspace folder to a repo without leaking credentials.

Bearer fallback from OAuth

If authType: "oauth" is set but the server doesn't support OAuth discovery at its URL, Fabric Agents will try to fall back to bearer auth using any stored token. In practice this means a manually-pasted token still works on an "oauth" source while you debug the OAuth flow — useful during server development.

Revoking a source

  • Disable (toggle in the sidebar) — keeps the config and credentials; the source just isn't available to sessions.
  • Delete source — removes the config folder. Tokens stay in the credential store unless you also revoke them server-side; deleting the folder breaks the binding so no future session can use them.
  • Revoke on the server — the provider (Linear, GitHub, etc.) has its own "Connected apps" list. Remove Fabric Agents there to invalidate the refresh token.

On this page