Markdown Rules
@valstro
Markdown Rules について
The portable alternative to Cursor Rules and IDE-specific rules.
基本情報
設定
以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。
{
"mcpServers": {
"markdown-rules-mcp": {
"command": "npx",
"args": [
"-y",
"@valstro/markdown-rules-mcp"
],
"env": {
"PROJECT_ROOT": "/absolute/path/to/project/root",
"MARKDOWN_INCLUDE": "./docs/**/*.md",
"HOIST_CONTEXT": true
}
}
}
}ツール
3Get relevant markdown docs inside this project before answering the user's query to help you reply based on more context. # Usage Instructions ## When to use "get_relevant_docs" tool * You **must** call the "get_relevant_docs" MCP tool before providing your first response in any new chat session. * After the initial call in a chat, you should **only** call "get_relevant_docs" again if one of these specific situations occurs: * The user explicitly requests it. * The user attaches new files. * The user's query introduces a completely new topic unrelated to the previous discussion. ## How to use "get_relevant_docs" tool * "attachedFiles": ALWAYS include file paths the user has attached in their query. * "projectDocs" * ONLY include project docs that are VERY RELEVANT to user's query. * You must have a high confidence when picking docs that may be relevant. * If the user's query is a generic question unrelated to this specific project, leave this empty. * Always heavily bias towards leaving this empty.
Reindex the docs. Useful for when you want to force a re-index of the docs because there were changes to the docs or the index
Print a full count & summary of the docs in the index. Also shows the usage instructions for the `get_relevant_docs` tool. Useful for debugging. Will only show the first 20 docs in each category & a small preview of the content.
概要
What is Markdown Rules?
Markdown Rules is an MCP server that organizes project documentation into structured context for AI coding tools like Cursor. It uses YAML frontmatter in Markdown files to define how each document is included in AI conversations.
How to use Markdown Rules?
Install globally with npm install -g @valstro/markdown-rules-mcp, then configure the MCP server with PROJECT_ROOT, MARKDOWN_INCLUDE, and optional HOIST_CONTEXT environment variables. Create .md files with YAML frontmatter and invoke get_relevant_docs to fetch relevant documentation.
Key features of Markdown Rules
- Define document inclusion types via YAML frontmatter (global, auto-attached, agent-requested, manual)
- Link to external files and embed specific line ranges from code/config files
- Hoist linked file context for improved AI awareness
- Reindex documentation when files change
- Customizable usage instructions for the AI assistant
Use cases of Markdown Rules
- Provide project-wide guidelines that the AI always sees (e.g., coding standards)
- Auto-attach documentation when certain file types are attached (e.g., TypeScript rules when
.tsfiles are added) - Let the AI dynamically select relevant docs based on the user's query
- Manually include specific documentation with the
@symbol for ad‑hoc needs
FAQ from Markdown Rules
What environments does Markdown Rules require?
Node.js v18 or higher and an MCP‑supported AI coding tool like Cursor.
How are documents classified for inclusion?
Via YAML frontmatter: alwaysApply: true for global, globs list for auto‑attached, a description for agent‑requested, or no frontmatter for manual inclusion.
Can I override the default usage instructions for the AI?
Yes. Create a markdown-rules.md file in your project root. The path can also be customized via the USAGE_INSTRUCTIONS_PATH environment variable.
Does Markdown Rules support linking to code or configuration files?
Yes. Append ?md-link=true to include the full file, or ?md-embed=START-END to embed specific line ranges inline.
What is the default exclude pattern for documentation files?
By default, Markdown Rules excludes **/node_modules/**,**/build/**,**/dist/**,**/.git/**,**/coverage/**,**/.next/**,**/.nuxt/**,**/out/**,**/.cache/**,**/tmp/**,**/temp/**.
「開発者ツール」の他のコンテンツ
JetBrains MCP Proxy Server
JetBrainsA model context protocol server to work with JetBrains IDEs: IntelliJ, PyCharm, WebStorm, etc. Also, works with Android Studio
MCP Inspector
modelcontextprotocolVisual testing tool for MCP servers
test
cloudwegoThe ultimate LLM/AI application development framework in Go.
MCP Framework
QuantGeekDevThe Typescript MCP Framework
DevDocs by CyberAGI 🚀
cyberagiincCompletely free, private, UI based Tech Documentation MCP server. Designed for coders and software developers in mind. Easily integrate into Cursor, Windsurf, Cline, Roo Code, Claude Desktop App
コメント