mcp-project-rules
v0.1.0
Published
MCP server for generating project rules and best practices
Downloads
15
Readme
Project Rules MCP Server
An MCP server implementation that generates comprehensive project rules and best practices prompts for AI coding assistants like Cursor.
Features
- Generate high-quality analysis prompts for project code review
- Identify project purpose, scope, and boundaries
- Analyze technology stack and frameworks
- Document code style and formatting conventions
- Map architecture and structural patterns
- Identify components and API design patterns
- Document build and deployment processes
- Support both single-file and multi-file output formats
- Customizable analysis sections
Tool
generate_project_rules
Creates comprehensive prompts that guide AI tools to analyze your project and generate specific rules based on your codebase patterns.
Inputs:
outputPath(string, optional): Output directory path (default:.pingancoder/rules)format(string, optional): Output format -"single"or"multiple"(default:"single")includeProjectPurpose(boolean, optional): Include project purpose analysis (default:true)includeTechStack(boolean, optional): Include technology stack analysis (default:true)includeCodeStyle(boolean, optional): Include code style analysis (default:true)includeArchitecture(boolean, optional): Include architecture analysis (default:true)includeComponents(boolean, optional): Include components analysis (default:true)includeBuildSteps(boolean, optional): Include build/deployment analysis (default:true)
Output:
- Creates detailed analysis prompts in markdown format
- Prompts include instructions for AI assistants to save results in
.pingancoder/rules/directory - No files are created by the MCP tool itself - it only generates the analysis prompts
Usage
The Project Rules tool generates comprehensive analysis prompts that guide AI assistants to:
- Generate project-specific analysis prompts
- Help AI assistants understand your codebase patterns
- Create consistent coding guidelines across your project
- Maintain architectural consistency
- Provide detailed instructions for code analysis
Workflow
- Generate Analysis Prompts: Use the MCP tool to create comprehensive analysis prompts
- Copy Prompts to Cursor: Copy the generated prompts and paste them into Cursor
- Run Analysis: Cursor will scan your codebase and create specific rules based on the prompts
- Save Rules: Cursor will automatically save the generated rules in the
.pingancoder/rules/directory
How to Use
- Generate prompts using the MCP tool
- Copy the generated prompts from the tool output
- Paste the prompts into Cursor and run the analysis
- Cursor will automatically save the analysis results in your project's
.pingancoder/rules/directory
The prompts include specific instructions for where to save the generated rules, so you don't need to manually specify the output location.
Configuration
Usage with Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"project-rules": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-project-rules"
]
}
}
}Usage with VS Code
For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code:
{
"mcp": {
"servers": {
"project-rules": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-project-rules"
]
}
}
}
}Local Development
For development, you can run the server locally:
npm run build
node dist/index.jsOutput Structure
The tool generates analysis prompts in markdown format that instruct AI assistants to save their analysis results in the .pingancoder/rules/ directory:
Single Format (format: "single")
- Generates one comprehensive prompt covering all analysis areas
- AI will save results as
.pingancoder/rules/project-rules.md
Multiple Format (format: "multiple")
- Generates separate specialized prompts for each analysis area
- AI will save results as separate files:
.pingancoder/rules/project-rules.md- Overall project analysis.pingancoder/rules/tech-stack.md- Technology stack analysis.pingancoder/rules/code-style.md- Code style and standards.pingancoder/rules/architecture.md- Architecture and structure.pingancoder/rules/components.md- Components and APIs.pingancoder/rules/build-deploy.md- Build and deployment
Example Usage
Generate Single Comprehensive Prompt
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"generate_project_rules","arguments":{"format":"single"}}}' | node dist/index.jsGenerate Multiple Specialized Prompts
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"generate_project_rules","arguments":{"format":"multiple"}}}' | node dist/index.jsGenerate with Custom Sections
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"generate_project_rules","arguments":{"includeBuildSteps":false,"includeArchitecture":false}}}' | node dist/index.jsUsage with Cursor
- Run one of the above commands to generate analysis prompts
- Copy the generated prompt text from the output
- Paste the prompt into Cursor
- Cursor will analyze your project and save the results in
.pingancoder/rules/
Development
Building
npm run buildTesting
npm testLicense
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License.
