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

# Connect an MCP client

> Connect an AI assistant to a Koonj project using a personal access token.

Koonj's Model Context Protocol (MCP) server lets a compatible client browse storage, inspect file history, and request operations allowed by your project permissions. It uses the MCP `2024-11-05` HTTP transport with Server-Sent Events (SSE).

## Generate a project token

1. Select the project you want the client to access.
2. Open **Integration → MCP & AI Assistant → Generate New Token**.
3. Name the token, set an expiration, and copy it when it appears. Koonj shows the secret once.
4. Use **Test connection** to verify the token and inspect the available tools.

![MCP settings showing tool permissions and the Generate New Token button](https://mintcdn.com/apps-that-matter/kEcGDD-078doIerC/images/koonj-screenshots/9-mcp-and-api-integration.png?fit=max\&auto=format\&n=kEcGDD-078doIerC\&q=85\&s=1a3ea8d90c5b564ba5e513a80366b5b4)

The MCP tab shows endpoint status, tool permissions, and client configuration.

## Configure the client

Use the example under **Client configuration** for Claude Desktop, Cursor, Windsurf, or a custom MCP client. Use the HTTPS origin of your Koonj deployment. The SSE endpoint is `/api/v1/mcp/sse`. The stream announces the session-specific message endpoint. Send `Authorization: Bearer <PAT>` with the stream request and message requests.

The project is part of the token. If your client sends `X-Koonj-Project`, use the same project ID. Keep the token in a private configuration or secret store and revoke it in **Personal Access Tokens** when you no longer need it. After an identity-provider role change, revoke existing tokens and issue replacements.

## Configure a reverse proxy

The packaged Docker proxy includes MCP routes. With a custom proxy, disable buffering, caching, and compression for the SSE route. Route `/api/v1/mcp/sse` and `/api/v1/mcp/message` to the same API instance so they share session state. Keep tokens out of proxy and application logs. For clients that pass a token in the SSE URL, redact the query string.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.