> For the complete documentation index, see [llms.txt](https://k-ai.gitbook.io/knowledge-ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://k-ai.gitbook.io/knowledge-ai/k-ai-mcp/connect-a-client.md).

# Connect a client

This page walks through installing the K-AI MCP servers (Retrieval and Audit) into the major MCP-compatible clients. Both servers use Streamable HTTP transport and the same OAuth 2.1 Authorization Server (`auth-api.kai-studio.ai`) — a token obtained from one is accepted on the other.

| Client                     | Install method                                     | Notes                                                                                    |
| -------------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| Cursor                     | One-click deep-link (plus manual fallback)         | Per-server deep-link.                                                                    |
| Claude Desktop             | UI only (Custom Connectors)                        | Pro / Max / Team / Enterprise plan required.                                             |
| Mistral Le Chat            | UI only (Custom MCP Connector)                     | May require Admin privileges.                                                            |
| Other MCP clients          | Manual OAuth + Streamable HTTP                     | See [OAuth flow](/knowledge-ai/k-ai-mcp/oauth-flow.md).                                  |
| Autonomous agent platforms | Organization API key in the `Authorization` header | No consent screen. See [Autonomous agents](/knowledge-ai/k-ai-mcp/autonomous-agents.md). |

## Cursor

Cursor supports one-click installation via deep-links. Click each button to install (each opens Cursor and pre-fills the MCP config):

[**Install K-AI Retrieval (stable)**](cursor://anysphere.cursor-deeplink/mcp/install?name=KAI%20Retrieval\&config=eyJ1cmwiOiJodHRwczovL2FwaS1yZXRyaWV2YWwua2FpLXN0dWRpby5haS9tY3AifQ==)

[**Install K-AI Audit**](cursor://anysphere.cursor-deeplink/mcp/install?name=KAI%20Audit\&config=eyJ1cmwiOiJodHRwczovL2FwaS1hdWRpdC5rYWktc3R1ZGlvLmFpL21jcCJ9)

Manual fallback — add to your Cursor MCP config at `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (per-project):

```json
{
  "mcpServers": {
    "kai-retrieval": {
      "url": "https://api-retrieval.kai-studio.ai/mcp"
    },
    "kai-audit": {
      "url": "https://api-audit.kai-studio.ai/mcp"
    }
  }
}
```

{% hint style="info" %}
On some Linux distributions (notably Debian), `cursor://` deep-links may fail to open the app. Use the manual config above if the buttons don't work.
{% endhint %}

On first use Cursor will open a browser tab for OAuth authentication. Sign in (local credentials or Microsoft SSO) and grant access; tokens are stored and refreshed automatically.

## Claude Desktop

Claude Desktop does not expose a public deep-link scheme for MCP installation. Remote MCP servers must be added through the web Custom Connectors panel, not via `claude_desktop_config.json` (which is reserved for local stdio servers).

{% tabs %}
{% tab title="K-AI Retrieval" %}

1. Open [claude.ai](https://claude.ai) and sign in (requires Pro, Max, Team, or Enterprise plan).
2. Click your profile icon, then **Settings** → **Connectors**.
3. Click **+** then **Add custom connector**.
4. Enter the URL: `https://api-retrieval.kai-studio.ai/mcp`.
5. Complete the OAuth flow in the browser popup.
   {% endtab %}

{% tab title="K-AI Audit" %}

1. Open [claude.ai](https://claude.ai) and sign in (requires Pro, Max, Team, or Enterprise plan).
2. Click your profile icon, then **Settings** → **Connectors**.
3. Click **+** then **Add custom connector**.
4. Enter the URL: `https://api-audit.kai-studio.ai/mcp`.
5. Complete the OAuth flow in the browser popup.
   {% endtab %}
   {% endtabs %}

## Mistral Le Chat

Le Chat does not expose a public deep-link scheme. Add each connector through the web UI.

{% tabs %}
{% tab title="K-AI Retrieval" %}

1. Open [chat.mistral.ai](https://chat.mistral.ai) and sign in.
2. Click the **toggle panel** button (sidebar).
3. Expand **Intelligence** → click **Connectors**.
4. Click **+ Add Connector** → select the **Custom MCP Connector** tab.
5. Fill in the form:
   * **Connector name:** `kai-retrieval`
   * **Connection server:** `https://api-retrieval.kai-studio.ai/mcp`
   * **Description:** K-AI document retrieval
   * **Authentication:** OAuth 2.1 (auto-detected)
6. Click **Connect** and complete the OAuth flow.
7. In any chat, click the **Tools** button (four-squares icon) and enable the `kai-retrieval` connector.
   {% endtab %}

{% tab title="K-AI Audit" %}

1. Open [chat.mistral.ai](https://chat.mistral.ai) and sign in.
2. Click the **toggle panel** button (sidebar).
3. Expand **Intelligence** → click **Connectors**.
4. Click **+ Add Connector** → select the **Custom MCP Connector** tab.
5. Fill in the form:
   * **Connector name:** `kai-audit`
   * **Connection server:** `https://api-audit.kai-studio.ai/mcp`
   * **Description:** K-AI document audit
   * **Authentication:** OAuth 2.1 (auto-detected)
6. Click **Connect** and complete the OAuth flow.
7. In any chat, click the **Tools** button (four-squares icon) and enable the `kai-audit` connector.
   {% endtab %}
   {% endtabs %}

{% hint style="info" %}
Adding Custom Connectors may require Admin privileges on the Le Chat workspace.
{% endhint %}

## Custom MCP client

For clients without UI integration, configure manually:

* **K-AI MCP server URLs:**
  * Retrieval: `https://api-retrieval.kai-studio.ai/mcp`
  * Audit: `https://api-audit.kai-studio.ai/mcp`
* **Transport:** Streamable HTTP, stateless.
* **OAuth discovery:** GET `https://api-retrieval.kai-studio.ai/.well-known/oauth-authorization-server` or `https://api-audit.kai-studio.ai/.well-known/oauth-authorization-server`. Both return identical metadata pointing to `auth-api.kai-studio.ai`.
* **Required flow:** Dynamic Client Registration (RFC 7591) + Authorization Code with PKCE (S256). Refresh tokens are rotated on every use.

See [OAuth flow (detailed)](/knowledge-ai/k-ai-mcp/oauth-flow.md) for the full sequence, endpoint reference, and troubleshooting. The full OAuth 2.1 narrative is in [Authentication → OAuth 2.1](/knowledge-ai/authentication/oauth.md).

## Autonomous agents (no human)

The flows above all open a browser for user consent. An agent platform running unattended has nobody to grant it, so it authenticates with an [Organization API key](/knowledge-ai/authentication/organization-api-keys.md) sent directly in the `Authorization` header instead:

```
Authorization: Bearer ks_org_REDACTED
```

No OAuth, no browser, no token-exchange step. See [Autonomous agents (API key)](/knowledge-ai/k-ai-mcp/autonomous-agents.md) for the setup, the access prerequisites, and the `401`/`503` retry contract.

## First-connection flow (OAuth clients)

1. The MCP client fetches the discovery document at `/.well-known/oauth-authorization-server`.
2. It registers itself dynamically (DCR — RFC 7591).
3. A browser window opens for user authentication (Microsoft SSO or local login).
4. Tokens are exchanged and stored by the client.
5. Subsequent tool calls are authenticated transparently; refresh tokens are rotated automatically every \~15 minutes.

This sequence applies to OAuth clients only — a key-authenticated agent skips all five steps.
