> ## 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.

# Using the Cortex MCP in Glean

> Connect Glean to the remote Cortex MCP and add the Cortex skill so Glean Assistant can answer questions about your services

> [!NOTE]
>
> This feature is available for Cortex cloud.

Bring Cortex into Glean so your team can ask Glean Assistant who owns a service, who's on call, and whether it passes its Scorecards, without leaving Glean. Setup has two parts: a Glean admin connects the remote Cortex MCP server, then you add the Cortex skill so Glean knows how to use the Cortex tools.

For an overview of what the Cortex MCP can do, see [Cortex MCP](https://docs.cortex.io/get-started/cortex-ai-assistant/mcp).

## Prerequisites

Before you get started:

* Copy your Cortex MCP server URL. In Cortex, go to **Integrations > MCP Authorization** in the main sidebar, then copy the **Endpoint**. Your region and tenant code are already filled in. If you aren't the Glean admin who will add the server, send them this URL.

  ![The 'MCP Authorization' page.](https://mintcdn.com/cortex-290c0c42/0PSi9J9N2yj3B2Gc/images/settings-mcp.png?fit=max\&auto=format\&n=0PSi9J9N2yj3B2Gc\&q=85\&s=d51d9d117958e1c132fcf566609eee0d)
* Make sure you have the Glean roles and permissions described in each section below.

## Connecting the Cortex MCP server in Glean

> [!NOTE]
>
> 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**, paste the **Endpoint** from **Integrations > MCP Authorization** in Cortex. To build the URL yourself instead, see [Choosing your MCP server URL](https://docs.cortex.io/get-started/cortex-ai-assistant/mcp/mcp-oauth.md#choosing-your-mcp-server-url). 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**.

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).

## Adding the Cortex skill in Glean

The `cortex-glean` skill teaches Glean Assistant how to use the Cortex MCP tools to answer questions about your services, such as who owns them, who's on call, and whether they pass their Scorecards. With the skill added, Glean checks Cortex first for these questions, even when you don't mention Cortex by name, and tells you when an answer came from Cortex. Add the skill after you [connect the Cortex MCP server in Glean](#connecting-the-cortex-mcp-server-in-glean).

> [!NOTE]
>
> To upload a skill, you need access to Skills and permission to create Skills in Glean. To share the skill with your whole organization, you need Glean admin permission.

**1. Save the Cortex skill as a file**

Copy the contents of the Cortex skill below, then save them in a file named `SKILL.md`.

```markdown theme={null}
---
name: cortex-glean
description: "Dedicated skill for Cortex, the company's developer portal and service catalog, reached through the Cortex MCP server; use it instead of the general-purpose Cortex MCP skill. Use it whenever someone asks who owns or maintains a service, API or system, who to talk to about it, who is on call for it (the incident on-call rotation, not meetings), what depends on it, whether it is production ready or passing its scorecards, when it last deployed, whether it has a runbook, or what they or their team own, even when Cortex is not named, e.g. 'who owns payments-api', 'who is on call for checkout right now', 'is billing production ready'. Cortex is the system of record for these: production readiness is measured by Cortex scorecards, and deploy history and runbook links live on the Cortex entity, so check Cortex first, before searching documents, and confirm any owner a document names against Cortex. Not for budgets, customer accounts, documents, Jira, email or calendar."
---

# Cortex in Glean

Cortex is the source of truth for what a service is, who owns it and who is on call. Its tools come from the Cortex MCP server, which an admin may have given any name in Glean. The tool names below are what matter; in Glean they appear as `<connector>__searchcatalog`, `<connector>__getcurrentoncallforentity` and so on.

## Steps

1. Find the entity: call `searchCatalog` with the name the user used as `query` and `pageSize: 5`. Use the returned `tag` in every later call. Results already include `owningTeamTags` and `ownerEmails`, so for "who owns X" stop here and answer.
2. Call one more tool only if the question needs it:

| The user asks | Tool after `searchCatalog` |
|---|---|
| Who to talk to, team members, team Slack | `getTeamDetails` (`tagOrId`: the owning team tag) |
| Who is on call | `getCurrentOncallForEntity` (`tagOrId`) |
| What depends on the entity, what it depends on | `listDependenciesForEntity` (`callerTag`, `includeIncoming: true`, `includeOutgoing: true`, `page: 0`, `pageSize: 25`) |
| Whether the entity meets standards defined in a scorecard | `listScorecardScoresForEntity` (`tagOrId`) |
| What rules the entity must fix to improve to the next level | `getScorecardNextStepsForEntity` (`tag`: the scorecard tag, `entityTag`) |
| When the entity last deployed | `searchDeploys` (`entityTagOrIds: [tag]`, `page: 0`, `pageSize: 5`) |
| Links, runbook, repo, Slack channel | `getEntityDetails` (`tagOrId`, `hierarchyDepth: "0"`) |
| How the entity is defined | `getEntityDescriptor` (`tagOrId`) |
| How Cortex itself works | `query_docs` |

3. If Cortex has no record (no match, an empty list or a 404), say so plainly. Don't fill the gap from documents or guess.

Questions about "me" or "my team", such as "what do I own", skip step 1: call `getMyWorkspace` with `{"myEntitiesRequest": {"ownershipSource": "TEAM_HIERARCHY", "includeArchived": false, "page": 0, "pageSize": 50}}`. Never use `getMyWorkspace` for a question that names an entity.

## Rules

- Read only: never call a Cortex tool that creates, updates, archives, runs, uploads, approves or denies anything.
- Never call `get_more_tools`, and never use `listAllEntities` to find something by name.
- Keep `pageSize` at 25 or less (50 for `getMyWorkspace`) and `includeArchived: false`.
- A document search is fine afterwards for a runbook or design doc, but Cortex wins any disagreement about owner or on-call.

## Answer

Lead with the answer in a sentence or two: the owning team, its Slack channel or people if asked, or the on-call person. Name the service and its tag, and say the answer came from Cortex.
```

**2. Upload the skill to Glean**

In Glean, go to **Settings > Skills**, click **Add**, then select **Upload a Skill**. Select your `SKILL.md` file. The skill appears under the **Personal** tab.

**3. Share the skill with your team (optional)**

Find the skill, click its three-dot menu, and select **Share**. Under **People with access**, add the teammates, departments, or groups who use the Cortex MCP in Glean. To share it with everyone, change **General access** so anyone at your company with the link can view it.

Uploaded skills don't update automatically. When Cortex updates the skill, repeat these steps with the new contents. If you upload a skill with the same name as an existing one, Glean asks whether to replace it.

For more information, see the Glean documentation on [skills](https://docs.glean.com/user-guide/assistant/skills).

### Using the Cortex skill in Glean

When you ask Glean Assistant a question the skill covers, Glean uses it automatically. To use it directly, type `/cortex-glean` in the Glean chat composer, or mention the Cortex skill in your prompt.

The skill helps Glean answer questions such as:

* ***Who owns a service or API, and who to talk to about it.***
* ***Who's on call for a service right now.***
* ***What a service depends on, and what depends on it.***
* ***Whether a service passes its Scorecards, and what it needs to fix to reach the next level.***
* ***When a service last deployed.***
* ***Where to find a service's runbook, repository, or Slack channel.***
* ***What you or your team own.***

For example, ask "Who is on call for checkout right now?" or "Is the billing service production ready?"

The Cortex skill is read-only. It doesn't create, update, or run anything in Cortex, even if your Cortex account has permission to. If Cortex doesn't have a record for what you asked about, Glean tells you instead of filling the gap from other sources.

> [!NOTE]
>
> Glean doesn't load skills in Fast mode. If Glean doesn't seem to use the Cortex skill, switch to a different mode and try again. If a teammate shared the skill with you, open the **Shared** tab under **Settings > Skills**, add the skill, and keep it enabled so Glean can use it.


## Related topics

- [Signing in to the remote Cortex MCP with OAuth](https://docs.cortex.io/get-started/cortex-ai-assistant/mcp/mcp-oauth.md)
- [Using the Cortex MCP](https://docs.cortex.io/get-started/cortex-ai-assistant/mcp/using-cortex-mcp.md)
- [Initiatives and Action items](https://docs.cortex.io/improve/initiatives.md)
