mcp-policy
MCP server for dynamically injecting agents and prompts with policy documentation.
claude mcp add --transport stdio rcrsr-mcp-policy-server npx -y @rcrsr/mcp-policy-server \ --env MCP_POLICY_CONFIG="./policies/*.md"
How to use
This MCP server provides policy content for Claude Code subagents by serving policy sections from Markdown files. Policies are defined with the § notation (for example, §DESIGN.1) and can reference other sections. Subagents can fetch policies on demand or have them injected into prompts so that agents only receive the exact rules they need, without loading entire documents into memory. When using this server, you typically interact with the fetch_policies tool exposed by the MCP server, or you rely on the plugin/hook integrations to automatically pull in relevant policies before a task runs. The server is designed to work with multiple projects by pointing to per-project policy files, ensuring consistency while keeping content up to date.
To utilize it, start an MCP client that can call the fetch_policies tool explicitly (or use a Claude Code hook/plugin that does this under the hood). You can also validate or extract policy references with dedicated tools like fetch_policies, validate_references, and extract_references to ensure correct policy usage. Point your MCP client at the policy configuration (MCP_POLICY_CONFIG) that references your policy Markdown files, and then request the needed § sections by prefix or full reference. This setup enables per-project policy sets while centralizing policy maintenance in Markdown files.
How to install
Prerequisites:
- Node.js (version 14 or newer) and npm installed
- Access to run npx and install npm packages
- A policies directory containing Markdown files using the § notation (e.g., policies/*.md)
Option A: Install and run via npx (no global install required)
- Ensure your policies are in ./policies/ and contain Markdown policy files, for example policies/policy-example.md
- Start using the MCP server client workflow by configuring your MCP client to call the server via npx with the appropriate environment variable:
- MCP_POLICY_CONFIG should point to your policy files, e.g. ./policies/*.md
- Example command to verify installation: npx -y @rcrsr/mcp-policy-server
Option B: Attach via Claude MCP workflow (as shown in the README)
- Install the MCP server JSON configuration in your Claude environment as shown in the README (the add-json command).
- Ensure MCP_POLICY_CONFIG is set to ./policies/*.md for policy loading.
- Use the fetch_policies tool in your subagents to dynamically request policies as needed.
Additional notes
Notes and tips:
- The MCP_POLICY_CONFIG environment variable should point to your policy Markdown files. Use wildcards (e.g., ./policies/*.md) to include multiple files.
- Policy references inside code blocks are ignored by fetchers, so you can document examples without triggering policy extraction.
- Use Method 3 (MCP Server) to fetch policies explicitly when subagents require dynamic policy selection based on prompt content.
- If you maintain multiple projects, you can have separate policy sets by placing different Markdown files in project-specific policy directories and configuring MCP_POLICY_CONFIG accordingly.
- For Windows users, follow the Windows-specific instructions in the README to set up the JSON policy server integration.
Related MCP Servers
mcp -code-execution-mode
An MCP server that executes Python code in isolated rootless containers with optional MCP server proxying. Implementation of Anthropic's and Cloudflare's ideas for reducing MCP tool definitions context bloat.
augments
Comprehensive MCP server providing real-time framework documentation access for Claude Code with intelligent caching, multi-source integration, and context-aware assistance.
nutrient-document-engine
A Model Context Protocol (MCP) server implementation exposes document processing capabilities through natural language, supporting both direct human interaction and AI agent tool calling.
docmole
Dig through any documentation with AI - MCP server for Claude, Cursor, and other AI assistants
automcp
AutoMCP scaffolds your Model Context Protocol config from package.json deps
remote -registry
Explore a community-maintained list of remote Model Context Protocol (MCP) servers. Find, learn about, and check the reachability of MCP-enabled services.