mattcknight/cursor-rules-mcp
If you are the rightful owner of cursor-rules-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Cursor Rules MCP Server is a tool designed to fetch and manage Cursor rules from a Git repository, allowing for easy sharing and application of rules across multiple projects.
Cursor Rules MCP Server
An MCP (Model Context Protocol) server that fetches Cursor rules from a Git repository, enabling you to share rules across multiple projects.
Quick Start
-
Install dependencies: npm install
-
Make server executable: chmod +x server.js
-
Create
config.json: { "gitRepo": "https://github.com/your-username/your-rules-repo.git", "gitBranch": "main", "cacheTTL": 3600000 } -
Test the server: node server.js
-
Connect to Cursor:
- Open Cursor Settings → Features → MCP
- Click "+ Add New MCP Server"
- Name:
cursor-rules-server - Type:
stdio - Command:
node /absolute/path/to/cursor-rules-mcp/server.js
Configuration
Edit config.json:
gitRepo(required): Git repository URL containing your rulesgitBranch(optional): Branch name (default: "main")cacheTTL(optional): Cache duration in milliseconds (default: 3600000 = 1 hour)
Git Repository Structure
The server looks for rules in these locations (in order):
.cursor/rules/directoryrules/directory- Root directory
Rule files should have .mdc or .md extensions.
Available Tools
get_rule- Get a specific rule by namelist_rules- List all available rulesget_all_rules- Get all rules combinedget_rule_readme- Get the README filerefresh_rules- Force refresh from Git
Available Prompts
apply_documentation_consistency- Apply consistency rulesvalidate_completeness- Validate documentation completenesscheck_objective_alignment- Check objective alignmentplan_phase- Get phase planning guidancereview_jira_initiative- Review JIRA Initiativereview_jira_epic- Review JIRA Epic
Troubleshooting
Server won't start:
- Check Node.js version:
node --version(needs 18+) - Verify
config.jsonexists and is valid JSON - Check Git is installed:
git --version - If you see
EACCES(permission denied) error, make the server executable:chmod +x server.js
Can't fetch rules:
- Verify
gitRepoURL is correct - Test access:
git clone <your-repo-url> - Check branch name matches
gitBranchin config
Rules not found:
- Use
list_rulestool to see available rules - Check repository structure matches expected format
- Verify file extensions are
.mdcor.md
Cache issues:
- Delete
cache/directory to clear cache - Use
refresh_rulestool to force refresh