MCP and AI clients

Cursor

How Pathrule integrates with Cursor through native hooks and MCP, with parity to the Claude Code integration.


Cursor has a native hook system Pathrule integrates with directly. The result is the same team layer you get in Claude Code: the same path scoped context, the same rule enforcement, and the same MCP tool surface, delivered through Cursor's own hook events.

This page covers what Pathrule writes into your project for Cursor, how the hook events map across clients, and how to verify the integration.

What Pathrule writes

When you install Pathrule into Cursor, you get:

  • .cursor/hooks.json. Cursor's native hook configuration. Pathrule registers the events it cares about here.
  • .cursor/mcp.json (or equivalent MCP config). Points Cursor at the local Pathrule MCP server.
  • Materialized skills. Skills attached to your workspace appear in the project so Cursor can invoke them by name.

No third party Skills toggle is needed. Cursor sees Pathrule as a first class hook provider.

Hook event coverage

Cursor's events map to Pathrule's three injection points:

  • preToolUse. Before Cursor runs a tool. This is where a strict rule blocks a matching tool call. On Cursor this event carries the block decision; the path scoped context is delivered through sessionStart and postToolUse instead.
  • postToolUse. After a tool finishes. Pathrule uses this both to capture activity and as the compensation point for context that Cursor's beforeSubmitPrompt does not carry.
  • sessionStart. When a new session begins. Pathrule returns the workspace overview so Cursor sees the same shape Claude Code sees from CLAUDE.md.

A single shared hook script handles the event shape differences between Cursor and Claude Code. You do not need to think about it: install Cursor through Pathrule and the right shape lands.

Per client isolation

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

  • Cursor only. Pathrule writes only the Cursor configs.
  • Claude Code only. Pathrule writes only the Claude Code configs.
  • Both. Pathrule writes both. The hooks register independently, the MCP server is shared, the content tree is the same.

The choice is whatever the user picks in Pathrule Studio's AI clients tab, or whichever clients you install via pathrule install.

Install

Through Pathrule Studio:

  1. Open the AI clients tab, enable Cursor.
  2. The app writes .cursor/hooks.json, the MCP entry, and any attached skills.

Through Pathrule CLI:

pathrule install cursor
pathrule sync
pathrule doctor --client cursor

Verify

Open Cursor in a directory you attached to a workspace. Open the Hooks Settings tab to confirm Pathrule appears as a registered provider. Start a new chat. The path scoped context should show up before the first tool call.

If the integration is silent:

pathrule doctor --client cursor

The doctor reports which step is off: missing .cursor/hooks.json, MCP not reachable, or hook script not executable.

What stays the same

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

  • A memory written from Pathrule Web shows up in both.
  • A strict rule blocks matching tool calls in both.
  • A skill is invokable by name in both.
  • The MCP tools (pathrule_get_context, pathrule_write_memory, etc.) behave identically.

If you ship a feature for one assistant, you get it for the other.