> ## Documentation Index
> Fetch the complete documentation index at: https://docs.consensus.app/llms.txt
> Use this file to discover all available pages before exploring further.

# TrueFoundry AI Gateway

> Register the Consensus MCP server in TrueFoundry's MCP Gateway with a shared API key or per-user OAuth.

TrueFoundry's MCP Gateway registers remote MCP servers in a central registry and fronts each with a single tenant-scoped endpoint. It preserves the upstream server's transport and forwards sessions unmodified, so Consensus's stateless Streamable HTTP server needs no special handling.

## Register the server

<Steps>
  <Step title="Add a remote server">
    In the left sidebar open **MCP Gateway**, select **Add Server**, then **Connect any Remote MCP Server**.
  </Step>

  <Step title="Fill in the server">
    | Field            | Value                                                 |
    | ---------------- | ----------------------------------------------------- |
    | **Name**         | `consensus` (lowercase letters, numbers, and hyphens) |
    | **Display Name** | Consensus                                             |
    | **Description**  | Search 220M+ peer-reviewed papers                     |
    | **URL**          | `https://mcp.consensus.app/mcp`                       |
    | **Transport**    | `streamable-http`                                     |
  </Step>

  <Step title="Choose authentication">
    See the two options below, then save. The gateway exposes the server at `/api/llm/[tenant]/mcp/consensus/server`.
  </Step>
</Steps>

## Authentication

<Tabs>
  <Tab title="API key (shared)">
    | Field              | Value                |
    | ------------------ | -------------------- |
    | **Authentication** | API Key              |
    | **Credentials**    | Shared               |
    | **Header name**    | `Authorization`      |
    | **Header value**   | `Bearer ak_live_...` |

    Choose **Individual** instead of Shared if each user should supply their own Consensus key under the **Auth Overrides** tab.
  </Tab>

  <Tab title="OAuth2 Authorization Code (per user)">
    Set **Authentication Type** to **OAuth2 Authorization Code**. TrueFoundry discovers the authorization and token URLs from `https://consensus.app/.well-known/oauth-authorization-server` automatically, but it requires an **OAuth2 Client ID** and **OAuth2 Client Secret**; it doesn't perform Dynamic Client Registration. [Contact sales](https://consensus.app/home/contact/sales/) for a confidential client, and register TrueFoundry's redirect URI with us:

    ```text theme={null}
    https://<tfy-control-plane-base-url>/api/svc/v1/llm-gateway/mcp-servers/oauth2/callback
    ```

    Set **OAuth2 Scopes** to `search`.
  </Tab>
</Tabs>

## Notes

* Headers sent in `x-tfy-mcp-headers` always override the configured auth.
* Virtual Accounts can't use per-user OAuth; give them the API-key configuration.
* Use the tenant-scoped URL form; the legacy `/api/llm/mcp/[server]/server` format was retired in April 2026.

TrueFoundry docs: [Getting started with MCP servers](https://www.truefoundry.com/docs/ai-gateway/mcp/mcp-server-getting-started) · [Auth and security](https://www.truefoundry.com/docs/ai-gateway/mcp/mcp-gateway-auth-security)
