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. Right
Add this skill
npx mdskills install n8daniels/rulesetmcpWell-documented MCP server enabling project-specific rules for AI agents with strong examples and clear setup
1# RulesetMCP23> **Weight-On-Wheels for AI**: Keep every agent grounded in your project's rules.45RulesetMCP 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.67## The Problem89Right now you probably:10- โ Repeat the same context to AI every session ("Use UPPER-CASE for SQL keywords")11- ๐ Maintain scattered documentation that AI can't easily query12- ๐ Re-explain architecture decisions across different AI tools13- โ ๏ธ Hope the AI remembers your project's conventions1415## The Solution1617**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.1819## Features2021- ๐ **Project discovery** via `list_projects`22- ๐ **Structured rules** from Markdown and YAML23- ๐ฏ **Contextual queries** with `get_rules` (filter by area, tags, severity)24- ๐ **Task-oriented summaries** with `summarize_rules_for_task`25- โ **Snippet validation** with `validate_snippet`26- ๐ **Hot-reload** rules with `reload_rules`27- ๐ **Universal compatibility** via MCP protocol (works with Claude Code, Claude Desktop, and any MCP-compatible client)2829## Quick Start3031### 1. Install3233```bash34npm install -g rulesetmcp35```3637Or clone and build locally:3839```bash40git clone https://github.com/n8daniels/RulesetMCP.git41cd RulesetMCP42npm install43npm run build44```4546### 2. Create Config4748Create `rulesetmcp.config.json` in your workspace:4950```json51{52 "projects": [53 {54 "id": "my-api",55 "name": "My API Project",56 "paths": ["/path/to/my-api"],57 "rulesPaths": ["rules/", "docs/rules/"]58 }59 ],60 "defaultProjectId": "my-api"61}62```6364### 3. Add Rules6566Create `rules/RULES.md` in your project:6768```markdown69# My API - Coding Standards7071## [api-naming-001] RESTful endpoint naming7273**Area:** api74**Severity:** warn75**Tags:** api, rest, naming7677**Description:**78All REST endpoints must use plural nouns and follow `/api/v1/{resource}` pattern.7980**Good Example:**81```82GET /api/v1/users83POST /api/v1/orders84```8586**Bad Example:**87```88GET /api/getUser89POST /api/create-order90```91```9293### 4. Configure Your MCP Client9495**Claude Desktop (`claude_desktop_config.json`):**9697```json98{99 "mcpServers": {100 "rulesetmcp": {101 "command": "rulesetmcp",102 "args": ["--config", "/path/to/rulesetmcp.config.json"]103 }104 }105}106```107108**Claude Code (`.claude/settings.json`):**109110```json111{112 "mcp": {113 "rulesetmcp": {114 "command": "rulesetmcp",115 "args": ["--config", "/path/to/rulesetmcp.config.json"]116 }117 }118}119```120121### 5. Use It!122123Now when you work with AI:124125```126You: "Refactor this SQL stored procedure to pull more data from the users table"127128AI: [Calls get_rules for project="my-api", area="sql"]129AI: "Based on your project's SQL rules, I'll ensure:130 - All keywords are UPPER-CASE131 - Identifiers use lower_case132 - Proper indexing hints are included133134 Here's the refactored procedure..."135```136137## Rule Formats138139RulesetMCP supports multiple formats:140141### Markdown (RULES.md)142143```markdown144## [rule-id] Rule Title145146**Area:** sql147**Severity:** error148**Tags:** formatting, style149150**Description:** What the rule requires151152**Rationale:** Why this matters153154**Good Example:**155```sql156SELECT * FROM users;157```158159**Bad Example:**160```sql161select * from Users;162```163```164165### YAML (rules/*.yaml)166167```yaml168- id: sql-format-001169 project: my-api170 area: sql171 title: SQL casing convention172 description: All SQL must use UPPER-CASE keywords and lower_case identifiers173 severity: warn174 tags: [sql, style, formatting]175 examples:176 good: |177 SELECT u.user_id FROM users u;178 bad: |179 select UserID from Users;180 appliesTo:181 - "*.sql"182 - "procedures/*"183```184185## MCP Tools186187### `list_projects`188Discover available projects and their rule sets.189190### `get_rules`191Query rules by project, area, tags, or severity.192193### `validate_snippet`194Validate code/SQL/config against project rules and get fix suggestions.195196### `summarize_rules_for_task`197Get a task-oriented summary of relevant rules before starting work.198199### `reload_rules`200Hot-reload rules after editing files on disk.201202## Philosophy203204RulesetMCP 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.205206**This is not just documentation** - it's:207- โ Machine-readable and queryable208- โ Version-controlled with your code209- โ Enforceable via validation tools210- โ Universal across all MCP-compatible AI tools211212## Examples213214See the `examples/` directory for complete sample projects:215216- `nodejs-api/` - REST API with TypeScript standards217- `python-django/` - Django project with security rules218- `dotnet-webapi/` - .NET API with architecture patterns219220## Use Cases221222### SQL Standardization223```yaml224- id: sql-format-001225 area: sql226 title: SQL keyword casing227 description: All SQL keywords UPPER-CASE, identifiers lower_case228 severity: warn229```230231### Security Guardrails232```yaml233- id: security-001234 area: security235 title: No hardcoded secrets236 description: Use environment variables or secure vaults237 severity: blocker238```239240### Architecture Patterns241```yaml242- id: arch-http-001243 area: architecture244 title: Use HttpClientFactory245 description: Never instantiate HttpClient directly246 severity: error247```248249### Migration Rules250```yaml251- id: migration-001252 area: migration253 title: Preserve backward compatibility254 description: When refactoring API endpoints, maintain old routes with redirects255 severity: blocker256```257258## Roadmap259260- [x] Phase 1: Core MCP server with basic tools261- [x] Phase 2: Multi-format rule loading (Markdown, YAML)262- [ ] Phase 3: Advanced validation with pattern matching263- [ ] Phase 4: LLM-assisted rule violation detection264- [ ] Phase 5: VSCode extension for inline hints265- [ ] Phase 6: Pre-commit hooks and CI/CD integration266- [ ] Community rule packs (OWASP, Google Style Guide, etc.)267268## Contributing269270Contributions welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.271272### Building From Source273274```bash275npm install276npm run build277npm start278```279280## License281282MIT License - see [LICENSE](LICENSE)283284## Support285286- **Issues**: https://github.com/n8daniels/RulesetMCP/issues287- **Discussions**: https://github.com/n8daniels/RulesetMCP/discussions288- **MCP Community**: https://discord.gg/anthropic289290---291292**Built with โค๏ธ for developers tired of repeating themselves to AI**293294*"Stop explaining. Start enforcing."*295
Full transparency โ inspect the skill content before installing.