The portable alternative to Cursor Rules and IDE-specific rules.
Transform your project documentation into intelligent AI context using standard Markdown files that work across any MCP-compatible AI tool. Escape vendor lock-in and scattered documentation forever.
🚀 Universal Compatibility — Write once, use everywhere. Your documentation works with Cursor, Claude Desktop, and any future MCP-enabled AI tool. No vendor lock-in.
🔗 Smart Dependency Resolution — Automatically traverse and include linked files & docs, ensuring AI agents receive complete context for complex projects without manual file hunting or relying on the AI agent to follow links.
🎯 Precision Context Control — Inject exact inline code snippets with line-range embeds (?md-embed=50-100) instead of dumping entire files. Get relevant context, not noise.
🏗️ Perfect for Complex Codebases — Ideal for large projects with custom tooling, internal libraries, or proprietary frameworks that AI models have limited training data for. Provide the context they need to understand your unique architecture.
To install the Markdown Rules MCP server for your IDE automatically via Smithery:
See Smithery for installation options for other IDEs.
To change the default usage instructions, create a markdown-rules.md file in your project root. The file should contain the usage instructions for the get_relevant_docs tool.
The default usage instructions are:
Note: You can change the default usage instructions file path by adding the USAGE_INSTRUCTIONS_PATH environment variable to the MCP server configuration.
- get_relevant_docs - Get relevant docs based on the user's query. Is called based on the usage instructions.
- list_indexed_docs - Count and preview indexed docs & usage instructions. Useful for debugging.
- reindex_docs - Reindex the docs. Useful if docs in the index have changed or new docs have been added.
Create .md files in your project with YAML frontmatter to define how they should be included in AI context.
Global | alwaysApply: true | Always included in every AI conversation | Automatically, every time |
Auto-Attached | globs: ["**/*.ts", "src/**"] | Included when attached files match the glob patterns | When you attach matching files |
Agent-Requested | description: "Brief summary" | Available for AI to select based on relevance | When AI determines it's relevant to your query |
No Frontmatter | None | Must be included in the prompt manually with @ symbol | When AI determines it's relevant to your query |
Global (always included):
Auto-attached (included when TypeScript files are attached):
Agent-requested (available for AI to select based on relevance):
No frontmatter (must be included in the prompt manually with @ symbol):
Link other files: Add ?md-link=true to include linked files in context
Embed specific lines: Add ?md-embed=START-END to include only specific lines inline
- PROJECT_ROOT - Default: process.cwd() - The absolute path to the project root.
- MARKDOWN_INCLUDE - Default: **/*.md - Pattern to find markdown doc files
- HOIST_CONTEXT - Default: true - Whether to show linked files before the docs that reference them
- MARKDOWN_EXCLUDE - Default: **/node_modules/**,**/build/**,**/dist/**,**/.git/**,**/coverage/**,**/.next/**,**/.nuxt/**,**/out/**,**/.cache/**,**/tmp/**,**/temp/** - Patterns to ignore when finding markdown files
Imagine you have the following files in your project:
project-overview.md:
src/utils.ts:
config.json:
When the get_relevant_docs tool runs, because project-overview.md has alwaysApply: true, the server would generate context like this:
Markdown Rules will diligently parse through all markdown links (?md-link=true) and embeds (e.g., ?md-embed=1-10) to include referenced content. This comprehensiveness can lead to using a significant portion of the AI's context window, especially with deeply linked documentation.
However, I find this to be a necessary trade-off for providing complete context in the large, bespoke codebases this tool is designed for.
Occasionally, depending on the specific LLM you're using, the model might not call the tool to fetch relevant docs as consistently as one might hope without explicit prompting. This behavior can often be improved by tweaking the usage instructions in your markdown-rules.md file or by directly asking the AI to consult the docs.
I've personally found Anthropic models tend to call the tool very consistently without needing explicit prompts.
-
Tool / Docs Not Being Used
- Ensure the tool is enabled in the MCP server configuration
- Make sure you're providing an absolute path to the PROJECT_ROOT in the MCP server configuration
- Make sure your MARKDOWN_INCLUDE is correct & points to markdown files
- Setup markdown-rules.md file in your project root with usage instructions for your needs
- Make sure to wrap your description field in YAML frontmatter in quotes (e.g. description: "Project Overview")
- Make sure to use proper array syntax in the globs field (e.g. globs: ["**/*.ts", "src/**"])
- To debug why your doc isn't being used, you can use the list_indexed_docs tool to see what docs are available and what's in the index. Just ask "what docs are available in the index?"
-
New/Updated Docs Not Being Reflected
- Make sure to restart the server after making changes to docs or the markdown-rules.md file (there's no watch mode yet)
-
Server Not Found
- Verify the npm link is correctly set up
- Check Cursor configuration syntax
- Ensure Node.js is properly installed (v18 or higher)
-
Configuration Issues
- Make sure your MARKDOWN_INCLUDE is correct
-
Connection Issues
- Restart Cursor completely
- Check Cursor logs:
# macOS tail -n 20 -f ~/Library/Logs/Claude/mcp*.log # Windows type "%APPDATA%\Claude\logs\mcp*.log"
Built with ❤️ by Valstro
- Support Cursor Rules YAML frontmatter format
- Add watch mode to re-index docs when markdown files matching the MARKDOWN_INCLUDE have changed
- Config to limit the number of docs & context that can be attached including a max depth.
- Config to restrict certain file types from being attached.