MCP and AI clients

MCP overview

How Pathrule serves your team knowledge to Claude Code, Cursor, Codex, Windsurf, GitHub Copilot, and any MCP compatible client.


Pathrule speaks the Model Context Protocol. The protocol is what your AI coding assistant uses to call into external tools and read external state. Pathrule shows up to the assistant as a normal MCP server, so any client that can speak MCP can use it.

There are two ways to connect. The local server runs inside Pathrule Studio or Pathrule CLI: the assistant talks to it over stdio, and the runtime talks to the Pathrule cloud over HTTPS. For cloud-only clients that cannot run a local runtime, a hosted Remote MCP endpoint accepts a direct connection over streamable-http with scoped access to your workspace. In both cases Pathrule has no tool that reads your filesystem, so your source code stays on your machine.

What the server exposes

Pathrule's MCP surface is small and shaped around the data model.

Read tools

  • pathrule_get_context. The primary entry point. Given the current working directory and the user's intent, it returns the right slice of memories, rules, and skills for that path. The response carries the workspace overview, the rules and memories that already match, and a hint about what to read next.
  • pathrule_read_memory, pathrule_read_rule, pathrule_read_skill. Fetch the full body of a specific node by id when the assistant wants to cite or follow it.
  • pathrule_get_tree, pathrule_get_node. Inspect the workspace structure or a specific node.
  • pathrule_list_memories. Enumerate the memories under a path, useful for discovery prompts.

Write tools

  • pathrule_write_memory, pathrule_write_rule, pathrule_write_skill. Create content at a workspace path. Missing nodes along the path are created on demand.
  • pathrule_update_memory, pathrule_update_rule, pathrule_update_skill. Edit an existing record. Optimistic concurrency is enforced with a version id.
  • pathrule_delete_memory, pathrule_delete_rule, pathrule_delete_skill. Soft delete with a thirty day undo window.

Activity and housekeeping

  • pathrule_log_activity. Called after any file modifying response so the team can see what the assistant did and where.
  • pathrule_goto. Move the assistant's working node when the user asks for content from a different scope.
  • pathrule_ping. A health check used by the CLI doctor.

How hooks fit in

Hooks are how Pathrule keeps the assistant fast. Before the assistant's first tool call in a turn, the hook supervisor reads a cached slice for the current working directory and hands it to the editor as system context. This avoids a synchronous MCP round trip for the common case.

When the hook is enough, the assistant does not need to call pathrule_get_context. It already has the right slice. MCP tools are reserved for two scenarios.

  1. The assistant wants more than the hook surfaced. For example, a discovery prompt that needs the full memory body, or a refactor that touches a path the hook did not anticipate.
  2. Something is worth keeping. The assistant proposes a memory, rule, or skill and writes it once you confirm, or you ask it to write one directly. Writes go through the write tools, and nothing is saved without your okay.

See How hooks work for the underlying mechanics.

Supported AI clients

Pathrule is client agnostic. The runtime supplies the right configuration writer so each client knows how to talk to the local MCP server.

  • Claude Code: first class. Hooks are auto registered, the MCP server is auto wired, and skill packages light up.
  • Cursor: first class. Pathrule writes the MCP server config and registers the path scoped rules so they appear in the editor.
  • Codex CLI: first class. The runtime keeps the Codex MCP config in sync with the workspace tree.
  • Windsurf: supported. Pathrule writes the MCP server config so the same path-scoped context flows into Windsurf sessions.
  • Any other MCP client: connects over stdio. Add the Pathrule MCP command to your client's config and it will see the same tool surface.
  • Cloud-only clients: an AI client that cannot run a local runtime connects to the hosted Remote MCP endpoint over streamable-http instead, with scoped access to your workspace.