---
title: "Cursor MCP server and hooks: connect Cursor to Cork · Cork"
description: "Connect Cursor to Cork with one machine install, Cursor's MCP install link, or the remote MCP server at mcp.corkcli.com: what Cursor agents get, how to check it works, and how to remove it."
canonical: "https://corkcli.com/docs/cursor"
last_updated: "2026-10-17"
---

# Cork for Cursor

Cork keeps Cursor agents, and the Claude Code and Codex agents beside them, from overwriting each other on one repository, and hands each agent what the others already learned. Cursor gets it through hooks and through Cork's MCP server.

## Install for every repo on the machine

```
curl -fsSL https://corkcli.com/install.sh | sh
```

Or, with Node, in any terminal including Windows PowerShell: `npx corkcli`. Either is safe to run again.

The install sets Cursor up when `~/.cursor` exists or `cursor` or `cursor-agent` is on your PATH:

- the hooks go into `~/.cursor/hooks.json`;
- Cork's MCP tools go into `~/.cursor/mcp.json` as the `cork` entry under `mcpServers`, running `cork mcp`. Everything else in the file is kept.

Nothing is written into your repositories, and with Cork free and local, nothing of yours leaves the machine. Link the machine to an account with `cork login`. See [the cork command](https://corkcli.com/docs/cli.md).

## Or connect the MCP server only

Open Cursor's install link for Cork, and Cursor opens with Cork filled in for you to confirm:

```
cursor://anysphere.cursor-deeplink/mcp/install?name=cork&config=eyJ1cmwiOiJodHRwczovL21jcC5jb3JrY2xpLmNvbSJ9
```

Or add a remote MCP server with this URL:

```
https://mcp.corkcli.com
```

Approval opens in the browser: sign in, pick a workspace. No keys, headers or client IDs. The first Cork call also installs the machine hooks; if your agent skips that, tell it `set up cork`.

## What the agent gets

- **A briefing** at session start and with each prompt: exact signatures, callers and recent changes of the code the prompt is about.
- **A write gate** that answers Cursor with a JSON decision: allow, deny or ask.
- **Teammates' changes** on its next step, as lines starting with `Δ`.
- **Messages** from the other agents in the repo, and `cork message` to send one.
- **MCP tools**: see the [MCP tools reference](https://corkcli.com/docs/mcp-tools.md).

### The hook events

Cursor gets the gate and notes back mid-turn; it has no batch event. Every hook fails open: any error, timeout or missing config allows the operation.

## Check that it works

- Start a new agent session in Cursor: a session loads the hooks when it starts.
- A **Cork briefing** arrives in the session's context at start.
- Run `cork status` to see whether Cork is running and what it did.

## Remove it

```
cork uninstall
```

This takes Cork's hooks out of `~/.cursor/hooks.json` and its entry out of `~/.cursor/mcp.json`. Your local data stays in `~/.cork`. Restart open sessions: they keep the hooks they started with.

## More

- [Claude Code](https://corkcli.com/docs/claude-code.md) · [Codex](https://corkcli.com/docs/codex.md) · [Gemini CLI](https://corkcli.com/docs/gemini-cli.md)
- [The cork command](https://corkcli.com/docs/cli.md) · [MCP tools reference](https://corkcli.com/docs/mcp-tools.md)
- [Documentation](https://corkcli.com/docs) · [Support](https://corkcli.com/support)
