Pathrule — Claude Code MCP server: what it does, how to install
Binds memories, rules, and skills to code paths so coding agents receive only relevant instructions before writing code.
claude mcp add --transport http pathrule https://cloud.pathrule.io/mcpWhat Pathrule does
Pathrule acts as an open-source knowledge layer for development agents. It files architectural decisions, constraints, and operational skills next to specific directories. When an agent prepares to edit a file, Pathrule matches the target path, trims information to fit the prompt budget, and delivers the notes. Enforced rules are never trimmed away for space.
When a prompt references functions or types, the system resolves their exact file and line number across JavaScript, TypeScript, Python, or Go. All stored entries can be viewed and managed via pathrule ui running locally on 127.0.0.1.
Running the local toolchain demands a Node environment at release 22.14.0 or higher. Connecting directly to the hosted HTTP endpoint bypasses package setup entirely, but drops local hooks.
What it helps with
- Attach project conventions and guidelines to specific directory paths
- Stop repeating architectural instructions across separate agent sessions
- Point agents to exact definition lines for functions and types
- Inspect project knowledge through a local browser dashboard
Example prompts for the agent
- Add a rule for
features/ordersto handle all API traffic exclusively through our custom client. - Check the saved notes and constraints recorded for
apps/web/dashboard. - List the enforced rules and checklist skills applicable to the auth directory.
How to install Pathrule
1Platform CLI: remote server
claude mcp add --transport http pathrule https://cloud.pathrule.io/mcp2Platform CLI
claude mcp add pathrule -- npx -y @pathrule/mcp1Platform CLI: remote server
codex mcp add pathrule --url https://cloud.pathrule.io/mcp2Platform CLI
codex mcp add pathrule -- npx -y @pathrule/mcpConfig file
{
"mcpServers": {
"pathrule": {
"url": "https://cloud.pathrule.io/mcp"
}
}
}{
"mcpServers": {
"pathrule": {
"command": "npx",
"args": [
"-y",
"@pathrule/mcp"
]
}
}
}Config file
{
"servers": {
"pathrule": {
"type": "http",
"url": "https://cloud.pathrule.io/mcp"
}
}
}{
"servers": {
"pathrule": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@pathrule/mcp"
]
}
}
}1Platform CLI: remote server
gemini mcp add -t http pathrule https://cloud.pathrule.io/mcp2Platform CLI
gemini mcp add pathrule npx -y @pathrule/mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Pathrule
How to install Pathrule in Claude Code?
For cloud access, run claude mcp add --transport http pathrule https://cloud.pathrule.io/mcp. To execute the local server, run claude mcp add pathrule -- npx -y @pathrule/mcp.
What does Pathrule do?
It matches guidelines and memories against directory paths, feeding coding agents only the relevant constraints right before they touch code.
How does remote MCP differ from the local package?
The cloud HTTP endpoint requires no local CLI installation, but lacks local hooks. Full on-machine execution needs Node version 22.14.0 or newer.