# Cursor (https://openknowledge.ai/docs/integrations/cursor)

Use OpenKnowledge with Cursor.

OpenKnowledge works with Cursor through MCP plus an installed skill.

## Install

There are two ways to connect Cursor, depending on how you run OpenKnowledge:

- **Desktop app** (macOS, Windows, Linux). The first time you open a project, a consent dialog detects Cursor and configures it for you. To re-trigger the dialog, choose **File → Set up OpenKnowledge integrations…**.
- **Web app / terminal** (any platform, including Intel Macs — see the [web app guide](https://openknowledge.ai/docs/get-started/quickstart#ok-install-web-app)). Run `ok init` in your project: it registers the OpenKnowledge MCP server with Cursor and the other editors it detects. Every `ok start` repairs the entry if it has drifted (it never adds one you removed).

## Approve the server

Cursor prompts you to approve a new MCP server when you next open the project. Approve `open-knowledge`. Until you do, the agent can't see the tools.

## Open with AI

From the editor, **Open with AI ▸ Cursor Desktop** dispatches the current file, folder, or project to Cursor. Entry points: the sidebar's right-click menu (file / folder / empty space), the command palette, and the **File → Open with AI** menu. You can also hand the current doc to Cursor from the bottom **Ask AI** composer.

Cursor uses a two-step handoff: OpenKnowledge spawns `cursor <projectDir>` to open the workspace first, then fires the `cursor://` URL with a short prompt asking Cursor to open the target in OpenKnowledge's web preview. The agent then grounds the rest of the conversation through MCP. See [Editor → Open with AI](https://openknowledge.ai/docs/features/editor#open-with-ai) for the full UX.

Both steps run through the local server's `POST /api/handoff`, the same path in the web app and the desktop app — so the **Open with AI ▸ Cursor Desktop** row works in both.

## Verify

Ask the agent:

> List the first 5 documents you come across in this project.

The agent should call the OpenKnowledge `exec` tool and respond with some of your documents.

If it still doesn't see the tool after approval, restart Cursor so it picks up the new MCP entry. If it's still missing and `ok init` reported your config was `left unchanged`, OpenKnowledge couldn't safely edit `~/.cursor/mcp.json` for the reason shown in parentheses (unreadable, too large, or a duplicate server block) — fix the config and re-run `ok init`.