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

# Signing in to the remote Cortex MCP with OAuth

> Connect your MCP client to the remote Cortex MCP by logging in with your Cortex account instead of a personal access token

export const StatusBadge = ({status}) => {
  const map = {
    "research-preview": {
      label: "RESEARCH PREVIEW",
      color: "#7B2D6B"
    },
    "public-beta": {
      label: "PUBLIC BETA",
      color: "#1D4ED8"
    },
    "private-beta": {
      label: "PRIVATE BETA",
      color: "#8C1D3A"
    }
  };
  const badge = map[status];
  if (!badge) return null;
  return <div className="not-prose flex mb-6">
      <span className="rounded-lg px-2 py-1 text-xs font-semibold tracking-wide" style={{
    backgroundColor: badge.color,
    color: "#FFFFFF"
  }}>
        {badge.label}
      </span>
    </div>;
};

<StatusBadge status="private-beta" />

We're excited to offer early access to a limited group of customers so we can incorporate feedback and ensure the experience scales well before making it generally available. If you would like to request access, please reach out to your account team.

<Info>
  This feature is available for Cortex cloud.
</Info>

The remote Cortex MCP supports OAuth, so you can connect your MCP client by logging in to Cortex in your browser. You don't need to create a personal access token or add it to your client's configuration. Your MCP client handles the sign-in flow and keeps your session authorized.

This page covers how to connect with OAuth. For an overview of what the Cortex MCP can do, see [Cortex MCP](/get-started/cortex-ai-assistant/mcp). To connect with a personal access token instead, see [Configuring the Cortex MCP](/get-started/cortex-ai-assistant/mcp/configuring-cortex-mcp).

## Prerequisites

Before you get started:

* Make sure you have an MCP client that supports remote MCP servers with OAuth, such as [Claude Code](https://docs.claude.com/en/docs/claude-code/mcp).
* Have your Cortex tenant code ready. Your tenant code identifies your Cortex workspace and is part of the MCP server URL. See [Finding your tenant code](#finding-your-tenant-code) below.

### Finding your tenant code

Your tenant code is the workspace name you enter in the **Enter your workspace name** field when you sign in to Cortex, e.g. `cortex-labs`.

If you sign in from a bookmarked link, check the URL. Your tenant code is the value after `tenantCode=`. For example, in `https://app.getcortexapp.com/login?tenantCode=cortex-labs`, the tenant code is `cortex-labs`.

<Note>
  The **Workspace name** field under **Settings > General** is the display name shown next to your logo. **It isn't your tenant code**.
</Note>

If you don't know your tenant code, contact your account team or Cortex support.

## Choosing your MCP server URL

The OAuth-enabled MCP server URL includes your tenant code. Use the URL for the region your Cortex workspace is hosted in, and replace `<TENANT_CODE>` with your tenant code:

| Region | MCP server URL |
| - | - |
| US | `https://mcp.cortex.io/t/<TENANT_CODE>/mcp` |
| EU | `https://mcp.eu.cortex.io/t/<TENANT_CODE>/mcp` |

<Note>
  These URLs are different from the token-based remote MCP URLs. Make sure to include `/t/<TENANT_CODE>` in the path, or the OAuth sign-in flow won't start.
</Note>

## Connecting with Claude Code

<Steps>
  <Step title="Add the Cortex MCP server">
    Run the following command. If your workspace is in the EU region, use the EU URL instead.

    ```bash theme={null}
    claude mcp add --transport http --scope user cortex https://mcp.cortex.io/t/<TENANT_CODE>/mcp
    ```
  </Step>

  <Step title="Authenticate">
    Open Claude Code and run `/mcp`. Select `cortex`, then select **Authenticate**.
  </Step>

  <Step title="Log in to Cortex">
    A browser window opens to the Cortex login page. Log in to your Cortex account to authorize the connection, then return to Claude Code.
  </Step>
</Steps>

To confirm the connection, run `/mcp` again and check that `cortex` shows as connected.

## Connecting with Glean

<Info>
  To add the Cortex MCP server in Glean, you need the Glean Admin or MCP Server Moderator role, and you must also be a Cortex user. Glean signs in to Cortex as you to discover the available tools. To make the tools available to other users after setup, you need the Glean Admin role.
</Info>

<Steps>
  <Step title="Add a new MCP server">
    In Glean, start the **+ MCP** flow to add a remote MCP server, then open the **Configuration** tab.
  </Step>

  <Step title="Name the server">
    Enter an **MCP server name** and **Description**, for example `Cortex MCP`.
  </Step>

  <Step title="Enter the server URL">
    In **MCP server URL**, enter the MCP server URL for your region, including your tenant code. Leave **Use Glean proxy** cleared unless you have trouble connecting.
  </Step>

  <Step title="Choose the transport and authentication">
    Under **Transport type**, select **Streaming HTTP**. Under **Authentication method**, select **Dynamic client registration**. Glean fills in the **Client ID** automatically.
  </Step>

  <Step title="Connect to Cortex">
    Under **Connect to server**, sign in to Cortex when prompted. When the status shows **Connected**, click **Refresh tools** to load the Cortex MCP tools.
  </Step>

  <Step title="Enable the tools">
    Under **Enable tools**, click **Edit settings** and choose which teammates can use the Cortex tools. Then click **Save**.
  </Step>
</Steps>

After you enable the tools, each Glean user signs in to Cortex with their own account the first time they use a Cortex tool. Glean uses each user's own Cortex identity, not the admin's connection, so users can only see and do what their Cortex account allows.

For more information, see the Glean documentation on [connecting remote MCP servers to Glean](https://docs.glean.com/administration/tools/connect-remote-mcp-servers-to-glean).

## Connecting with other MCP clients

If your MCP client asks for connection details when you add a remote server, use the following settings:

* **Server URL** - The MCP server URL for your region, including your tenant code.
* **Transport type** - HTTP (streamable HTTP).
* **Authentication** - OAuth with Dynamic Client Registration (DCR). You don't need a client ID or client secret. Your MCP client registers itself with Cortex automatically.

After you add the server, start the sign-in flow from your client. A browser window opens where you log in to Cortex.

<Note>
  During Private Beta, OAuth sign-in works with a set of supported MCP clients. If you have trouble connecting your client, contact your account team.
</Note>

## Staying signed in

After you sign in, your authentication lasts for multiple days. Your MCP client refreshes your access tokens automatically multiple times per day, so you don't need to do anything to keep your session active.

When your authentication expires, sign in to Cortex again from your MCP client. In Claude Code, run `/mcp`, select `cortex`, then select **Authenticate**.

## Share your feedback

Have feedback or run into issues? Reach out to your account team.


## Related topics

- [Cortex beta program and release phases](/resources/beta.md)
- [Configuring the Cortex MCP](/get-started/cortex-ai-assistant/mcp/configuring-cortex-mcp.md)
- [Using the Cortex MCP](/get-started/cortex-ai-assistant/mcp/using-cortex-mcp.md)
