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

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

## First-connection flow (all 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://k-ai.gitbook.io/knowledge-ai/k-ai-mcp/connect-a-client.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
