This feature is available for Cortex cloud.
Prerequisites
Before you get started:- Make sure you have an MCP client that supports remote MCP servers with OAuth, such as Claude Code.
- 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 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.
The Workspace name field under Settings > General is the display name shown next to your logo. It isn’t your tenant code.
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:
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.Connecting with Claude Code
1
Add the Cortex MCP server
Run the following command. If your workspace is in the EU region, use the EU URL instead.
2
Authenticate
Open Claude Code and run
/mcp. Select cortex, then select Authenticate.3
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.
/mcp again and check that cortex shows as connected.
Connecting with Glean
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.
1
Add a new MCP server
In Glean, start the + MCP flow to add a remote MCP server, then open the Configuration tab.
2
Name the server
Enter an MCP server name and Description, for example
Cortex MCP.3
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.
4
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.
5
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.
6
Enable the tools
Under Enable tools, click Edit settings and choose which teammates can use the Cortex tools. Then click Save.
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.
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.
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.