Skip to content
Pathrule

docs

Cursor

How Pathrule CLI connects Cursor through the local MCP server, and how Cursor's agent reaches the same Pathrule knowledge through Pathrule's MCP tools.

On this page

Cursor connects to your Pathrule workspace through Pathrule's local MCP server. Pathrule CLI writes the MCP entry, and the VS Code extension can write it from inside Cursor. Pathrule writes no hooks and no rule files for Cursor, so context arrives when Cursor's agent calls Pathrule's MCP tools, not before each prompt. Cursor uses the local MCP server; Remote MCP setup is not documented for Cursor.

This page covers what Pathrule writes for Cursor, how knowledge reaches it, and how to verify the integration.

What Pathrule writes

When you install Pathrule into Cursor, you get:

  • An MCP server entry in ~/.cursor/mcp.json. Your user-level Cursor MCP config, pointed at the local Pathrule MCP server. Your other servers stay as they are. The entry is the same for every folder: the server answers each call from the Pathrule Cloud or Pathrule Local workspace of the folder it is about.

That is all Pathrule writes for Cursor: no .cursor/hooks.json and no files under .cursor/rules/. When the same repository is also used with Claude Code or Codex, those clients get their own hooks and files as usual.

How knowledge reaches Cursor

Cursor's agent reaches the same MCP tools as every other client:

  • pathrule_get_context returns the memories, rules and skill names that fit the folder it is working in.
  • pathrule_read_memory, pathrule_read_rule and pathrule_read_skill read a full body by id.
  • The write tools, such as pathrule_write_memory, save memories, rules and skills when you ask.

Context arrives when the agent calls these tools. There is no Pathrule hook in Cursor to hand it over before the first tool call, so ask the agent to check Pathrule when a task starts, or say so in your own Cursor rules.

A rule reaches Cursor as context the agent reads. It cannot block an edit there: blocking a matching edit runs in Pathrule's pre-tool hook, which Claude Code and Codex have.

Per client isolation

Pathrule supports any combination of AI clients on a single machine.

  • Each client's MCP configuration is its own. Installing or removing Cursor's entry does not touch the others.
  • The MCP server and the content tree are shared. Cursor, Claude Code and Codex read the same workspace.

pathrule setup writes the entry for every client it supports. pathrule setup --target cursor or pathrule install cursor writes it for Cursor alone, and pathrule uninstall cursor removes it again. In the VS Code extension, Connect AI Clients lets you pick the clients.

Install

Through Pathrule CLI:

pathrule setup

Run it in the project folder. On a new install it sets the folder up on Pathrule Cloud: it signs you in when needed, attaches the folder to a workspace, and writes the MCP entry into ~/.cursor/mcp.json and every other AI client's configuration. Run pathrule setup --local instead to use Pathrule with no account.

To add the entry by hand:

pathrule install cursor
pathrule doctor

pathrule install cursor adds the Pathrule server to ~/.cursor/mcp.json and leaves your other servers alone.

Through the VS Code extension, which also runs inside Cursor, choose Cursor in Connect AI Clients. The extension writes the same MCP entry through its bundled CLI.

Verify

Open Cursor in a directory you set up. In Cursor's MCP settings, confirm that the pathrule server is listed and enabled. Start a new chat and ask the agent to call pathrule_get_context for the current directory: it should return the workspace's knowledge for that path.

If the integration is silent:

pathrule doctor

The doctor is read-only. It reports which edition serves this folder, your sign-in and whether this folder is attached in a Cloud folder, whether the Pathrule MCP entry is installed for Cursor and each other client, and which Pathrule-managed files are in the folder and who wrote them. Add --json for the full report, which also flags an MCP entry that points at a runtime that no longer exists. pathrule install cursor rewrites a stale entry.

What stays the same

Everything you write in Pathrule reaches Cursor with the same content it reaches Claude Code.

  • A memory written by any agent through MCP, in the Local Console or in VS Code is returned to Cursor by the same tools.
  • A rule is the same rule. Cursor reads it as context; Claude Code and Codex can also block a matching edit with it.
  • A skill is read by name with pathrule_read_skill.
  • The MCP tools (pathrule_get_context, pathrule_write_memory, etc.) behave identically.