Pathrule
MCP and AI clients

MCP overview

How Pathrule Studio serves its native agents, how Pathrule CLI connects Cursor, Windsurf and GitHub Copilot, and how any MCP client reaches the same tools.


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. Shared tools keep the same contract, while each runtime advertises explicit additions through tools/list. 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 typed and grouped around the data model. The core tools below cover everyday context, content and activity flows; the tools reference is the canonical inventory.

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.

Studio agents and CLI integrations

Pathrule Studio is the main product. It runs Claude Code, Codex, Grok, Kimi, Antigravity and OpenCode inside one workspace. Pathrule CLI is the lighter route for external clients that connect to the same context layer over MCP.

  • In Pathrule Studio: Claude Code, Codex, Grok, Kimi, Antigravity and OpenCode run natively and can be switched mid-conversation.
  • Through Pathrule CLI: Cursor, Windsurf and GitHub Copilot receive the same memories, rules and skills as external integrations.
  • Claude Code and Codex outside Studio: the CLI can also wire their standalone clients when you prefer a terminal workflow.
  • 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.