Connections & Authentication

A connection stores one user's credentials for one MCP server. Server owners configure how users authenticate; each user then connects once and reuses that connection in every conversation.

Authentication methods

Pick the method in step 3 of the server form:

  • Nonethe server is open — no connection is required.
  • API Keyeach user supplies a personal key, sent as an HTTP header on every request.
  • OAuth 2.0 (Advanced)users sign in through the provider's consent screen; QAnswer stores and refreshes the tokens. Requires client ID, client secret, scopes and the authorization/token URIs.
The authentication method dropdown with None, OAuth 2.0 (Advanced) and API Key

API key configuration

Choose how the key is transmitted with the Header Name preset:

  • Bearer tokenAuthorization: Bearer your-key — the most common scheme.
  • X-API-Keysends the raw key in the X-API-Key header.
  • x-litellm-api-keyfor LiteLLM proxy deployments.
  • Customdefine your own header name and value template.

Custom header configuration

  • Header nameany HTTP header, e.g. X-Weather-Key.
  • Value templatehow the key is embedded, e.g. Bearer {api_key}. Leave empty to send the raw key.

End-user form

Customize the input users see when they connect: a display name, a placeholder and a helper description telling them where to find their key.

API Key authentication with a custom header and the end-user form settings
Value template rule
A non-empty value template must contain the literal placeholder {api_key} — it is replaced by the user's key at request time.

Custom headers

Step 4 of the server form adds extra HTTP headers on every MCP request. Two tabs cover two situations:

  • All Usersfixed name/value pairs sent for everyone. Never put secrets or personal tokens here.
  • Per Userfields each user fills in when creating their connection; the value is sent as a header (header key = field name).

Each per-user field defines:

  • Header nameused verbatim as the HTTP header key, e.g. X-Account-Id.
  • Display namethe label users see in the connection dialog.
  • TypePlain (visible) or Secret (masked and stored securely).
  • Requiredrequired fields must be filled before the connection can be created.
The Per User tab with an X-Account-Id field and its editor
Security
Use Secret for anything sensitive — values are masked in the UI and stored encrypted. All-users headers are visible to every editor of the server and travel with every request: keep credentials out of them.

What end users see

When users add a connection — from the server page or when the chat asks them to connect — a dialog collects exactly what you configured: the API key input plus your per-user fields.

The Add Connection dialog asking for the Weather API Key and Account ID

Existing connections are listed on the server page, where users can also delete them:

The Connections panel listing an active connection

OAuth 2.0 notes

  • Users are redirected to the provider's consent screen and come back to the exact page they started from.
  • If a refresh token dies, the stored connection is removed and the chat asks the user to reconnect.
  • Deleting a connection in QAnswer does not revoke the grant on the provider side — do that in the provider's security settings.