📇 🏠 - Keeps agents grounded in project rules: query coding standards, validate snippets and get task-specific…
RulesetMCP
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
> **Weight-On-Wheels for AI**: Keep every agent grounded in your project's rules.
RulesetMCP is a Model Context Protocol (MCP) server that gives AI agents a project-aware rulebook. Instead of explaining your coding standards, SQL conventions, or process guidelines every time you open a new AI session, you define them once in version-controlled files. RulesetMCP reads those files and exposes tools for listing, summarizing, and applying rules to specific tasks and snippets.
The Problem
Right now you probably:
- ✋ Repeat the same context to AI every session ("Use UPPER-CASE for SQL keywords")
- 📝 Maintain scattered documentation that AI can't easily query
- 🔄 Re-explain architecture decisions across different AI tools
- ⚠️ Hope the AI remembers your project's conventions
The Solution
**RulesetMCP acts like a "Weight-On-Wheels" switch for AI assistants**: once your rules are loaded, every action is grounded in them. This keeps your rewrites, refactors, and new features aligned with the architecture and process decisions you've already made.
Features
- 🔍 **Project discovery** via list_projects
- 📋 **Structured rules** from Markdown and YAML
- 🎯 **Contextual queries** with get_rules (filter by area, tags, severity)
- 📊 **Task-oriented summaries** with summarize_rules_for_task
- ✅ **Snippet validation** with validate_snippet
- 🔄 **Hot-reload** rules with reload_rules
- 🌐 **Universal compatibility** via MCP protocol (works with Claude Code, Claude Desktop, and any MCP-compatible client)
Quick Start
1. Install
Or clone and build locally:
2. Create Config
Create rulesetmcp.config.json in your workspace:
3. Add Rules
Create rules/RULES.md in your project:
GET /api/v1/users
POST /api/v1/orders
GET /api/getUser
POST /api/create-order
4. Configure Your MCP Client
**Claude Desktop (claude_desktop_config.json):**
**Claude Code (.claude/settings.json):**
5. Use It!
Now when you work with AI:
Rule Formats
RulesetMCP supports multiple formats:
Markdown (RULES.md)
sql
SELECT * FROM users;
sql
select * from Users;
YAML (rules/*.yaml)
MCP Tools
list_projects
Discover available projects and their rule sets.
get_rules
Query rules by project, area, tags, or severity.
validate_snippet
Validate code/SQL/config against project rules and get fix suggestions.
summarize_rules_for_task
Get a task-oriented summary of relevant rules before starting work.
reload_rules
Hot-reload rules after editing files on disk.
Philosophy
RulesetMCP embodies the **"Weight-On-Wheels"** principle: just like an aircraft can't ignore physics once grounded, AI agents shouldn't ignore your project's rules once RulesetMCP is enabled.
**This is not just documentation** - it's:
- ✅ Machine-readable and queryable
- ✅ Version-controlled with your code
- ✅ Enforceable via validation tools
- ✅ Universal across all MCP-compatible AI tools
Examples
See the examples/ directory for complete sample projects: