MCP Project Standards Server
A Model Context Protocol (MCP) based project standards management tool designed for AI-assisted development, helping teams maintain unified development standards and specifications across multiple machines.
๐ก Best Practices
Configure tool prompts to require the model to check project standards before each modification:
- Register an account:
- ๐จ๐ณ China: https://openai.hlwidc.com:28080/user
- ๐ Global: https://www.zhineng.dev/user/
- Add your own provider and model configuration
- Generate an API key
- Add to the key's tool prompts:
Tool: development_standards
Prompt: Please use the development_standards tool to check the guidelines before editing
Effect: The model will check standards before each modification round, ensuring code complies with team standards, while consuming a small amount of additional tokens.
๐ Core Advantages
๐ฐ Token Cost Optimization
- Efficient Context Caching: Using MCP tools to get short, structured standard data instead of reading lengthy documents more effectively triggers Context Caching (like Gemini 3 Flash), reducing input costs to extremely low levels (~$0.05/1M).
- Incremental Output: Enforces minimal code Diff and lean tool responses to minimize expensive output Token consumption.
๐ฏ Solving Multi-Machine Development Chaos
- Unified Standards: AI assistants on multiple machines use the same project standards, avoiding inconsistent development styles
- Team Collaboration: Eliminates code style differences caused by different developers using different AI configurations
๐ก๏ธ Enterprise-Grade Development Standards Management
- Project Information Management: Unified management of project basic info, tech stack, versions, etc.
- API Standards: Define unified interface design standards ensuring API consistency
- Development Standards: Code style, naming conventions, architecture standards management
- Database Standards: Table structure, naming conventions, indexing strategies standardization
โจ Key Features
- โ Project Information Management - Unified management of project basic info and configuration
- โ Project Structure Analysis - Intelligent analysis of project directory structure and dependencies
- โ API Interface Standards - Unified API design specs and best practices
- โ Development Standards - Code style, naming conventions, architecture standards management
- โ Database Standards - Table design, naming conventions, indexing strategies standardization
- โ API Debug Tool - Complete API testing and debugging functionality
- โ Configuration Management - JSON-based config file storage and management
- โ Auto Restart - Intelligent process management and fault recovery
- โ Health Check - Real-time service status and performance monitoring
- โ File Download - Download files from URLs directly to project directory
- โ Directory Listing - List project directory structure
- โ Rules Generation - Auto-generate .cursorrules and development standards files
๐ฏ Use Cases
Team Collaborative Development
- Multi-Developer Environment: Ensures every developer's AI assistant follows the same project standards
- Code Review: Unified code style and standards reduce review time
- New Member Onboarding: Quickly help new team members understand project standards and best practices
Enterprise Projects
- Large Projects: Manage complex project structures and multi-module development
- Microservices Architecture: Unify API design and database standards across services
- Multi-Environment Deployment: Development, testing, production environment standard consistency
AI-Assisted Development
- Smart Code Generation: AI generates code that complies with project standards
- Auto Refactoring: Auto-optimize and refactor code based on standards
- Standards Checking: Real-time checking if code meets project standards
๐ฆ Installation
Global Install (Recommended)
npm install -g @liangshanli/mcp-server-project-standards
Local Install
npm install @liangshanli/mcp-server-project-standards
Source Install
git clone https://github.com/liliangshan/mcp-server-project-standards.git
cd mcp-server-project-standards
npm install
โ๏ธ Configuration
The server uses ./.setting/ directory for config files by default. You can specify different directories via environment variables.
Environment Variables
| Variable | Default | Description |
|---|---|---|
PROJECT_PATH | . | Project root path. Supports absolute and relative paths for resolving all relative paths. |
CONFIG_DIR | ./.setting | Config directory, resolved relative to PROJECT_PATH. |
TOOL_PREFIX | - | Tool name prefix, also used for multi-project config isolation |
PROJECT_NAME | - | Project name prefix for tool descriptions |
API_DEBUG_ALLOWED_METHODS | GET | Allowed request methods (supports: GET, POST, PUT, DELETE, PATCH, etc.) |
API_DEBUG_LOGIN_URL | /api/login | Login endpoint URL |
API_DEBUG_LOGIN_METHOD | POST | Login request method |
API_DEBUG_LOGIN_BODY | {"username":"","password":""} | Login request body |
API_DEBUG_LOGIN_DESCRIPTION | Save the returned token to the public header in the debug tool | Login endpoint description |
Config Files
The server uses two config files:
config.json- Project standards configapi.json- API debug config
config.json Defaults:
{
"project_info": {},
"project_structure": [],
"api_standards": {},
"development_standards": [],
"database_standards": []
}
api.json Defaults:
{
"baseUrl": "",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json"
},
"list": []
}
๐ Quick Start
1. Direct Run (Global Install)
mcp-server-project-standards
2. Using npx (Recommended)
npx @liangshanli/mcp-server-project-standards
3. Source Start
npm start
4. Managed Start (Production Recommended)
npm run start-managed
Managed start provides: auto-restart (max 10 times), error recovery, process management, logging
5. Dev Mode
npm run dev
๐ง Editor Config Examples
Cursor Editor Config - Single Project
{
"mcpServers": {
"project-standards": {
"command": "npx",
"args": ["@liangshanli/mcp-server-project-standards"],
"env": {
"PROJECT_PATH": ".",
"CONFIG_DIR": "./.setting",
"API_DEBUG_ALLOWED_METHODS": "GET,POST,PUT,DELETE",
"API_DEBUG_LOGIN_URL": "/api/login",
"API_DEBUG_LOGIN_METHOD": "POST",
"API_DEBUG_LOGIN_BODY": "{\"username\":\"\",\"password\":\"\"}",
"API_DEBUG_LOGIN_DESCRIPTION": "Save the returned token to the public header"
}
}
}
}
Cursor Editor Config - Multi-Project
{
"mcpServers": {
"project-standards-A": {
"command": "npx",
"args": ["@liangshanli/mcp-server-project-standards"],
"env": {
"PROJECT_PATH": ".",
"TOOL_PREFIX": "projA",
"PROJECT_NAME": "Project A",
"API_DEBUG_ALLOWED_METHODS": "GET,POST,PUT,DELETE"
}
},
"project-standards-B": {
"command": "npx",
"args": ["@liangshanli/mcp-server-project-standards"],
"env": {
"PROJECT_PATH": ".",
"TOOL_PREFIX": "projB",
"PROJECT_NAME": "Project B",
"API_DEBUG_ALLOWED_METHODS": "GET,POST,PUT,DELETE"
}
}
}
}
VS Code Config - .vscode/mcp.json Format
Single Instance
{
"servers": {
"project-standards": {
"command": "npx",
"args": ["@liangshanli/mcp-server-project-standards"],
"env": {
"PROJECT_PATH": ".",
"CONFIG_DIR": "./.setting",
"API_DEBUG_ALLOWED_METHODS": "GET,POST,PUT,DELETE",
"API_DEBUG_LOGIN_URL": "/api/login"
}
}
}
}
Multi Instance
{
"servers": {
"project-standards-A": {
"command": "npx",
"args": ["@liangshanli/mcp-server-project-standards"],
"env": {
"PROJECT_PATH": ".",
"TOOL_PREFIX": "projA",
"PROJECT_NAME": "Project A",
"CONFIG_DIR": "./.setting-a",
"API_DEBUG_ALLOWED_METHODS": "GET,POST,PUT,DELETE"
}
},
"project-standards-B": {
"command": "npx",
"args": ["@liangshanli/mcp-server-project-standards"],
"env": {
"PROJECT_PATH": ".",
"TOOL_PREFIX": "projB",
"PROJECT_NAME": "Project B",
"CONFIG_DIR": "./.setting-b",
"API_DEBUG_ALLOWED_METHODS": "GET,POST,PUT,DELETE"
}
}
}
}
๐ ๏ธ Available Tools
1. Project Info (project_info)
Get and manage project basic info including name, development language, description, etc.
{
"name": "project_info",
"arguments": {
"action": "set",
"key": "projectName",
"value": "My Project"
}
}
2. Project Structure (project_structure)
Get and manage project directory structure with depth control and hidden file inclusion.
{
"name": "project_structure",
"arguments": {
"action": "set",
"structure": [{"path": "/src", "description": "Source code directory"}]
}
}
3. API Standards (api_standards)
Get and manage API interface standards and best practices.
{
"name": "api_standards",
"arguments": {
"action": "set",
"key": "requirements",
"value": ["Unified response format", "Error code standards"],
"forceOverwrite": true
}
}
4. Development Standards (development_standards)
Get and manage development standards including code style, Git workflow, testing and documentation specs.
{
"name": "development_standards",
"arguments": {
"action": "set",
"standards": ["Use 2 spaces for indentation", "Use single quotes"],
"forceOverwrite": false
}
}
5. Database Standards (database_standards)
Get and manage database standards including table design, naming conventions, indexing strategies, etc.
{
"name": "database_standards",
"arguments": {
"action": "set",
"standards": ["Use snake_case for table and field names"],
"forceOverwrite": true
}
}
6. API Debug Tool (api_debug)
Complete API testing and debugging functionality supporting multiple HTTP methods, authentication, parameter passing, etc.
Features:
- Smart Content-Type Detection: Auto-detect request body type (JSON, XML, HTML, URL-encoded, etc.)
- Authentication Management: Support Bearer Token and other auth methods
- URL Deduplication: Same URL only saves one copy of data to avoid duplication
- Execution Records: Record execution history regardless of success or failure
- Search Function: Search APIs by URL or description
- Request Method Restrictions: Only GET allowed by default to prevent accidental operations
- Login Endpoint Smart Detection: Auto-detect login endpoints and use env var configs
7. Directory List Tool (list_directory)
Recursively explore directory structure relative to project root.
{
"name": "list_directory",
"arguments": {
"depth": 3
}
}
8. Rules Generation Tool (generate_cursorrules / generate_rules)
Generate AI project guidance files based on your standards (Cursor uses .cursorrules, other clients use PROJECT_RULES.md).
{
"name": "generate_cursorrules",
"arguments": {
"save": true
}
}
9. File Download Tool (download_file)
Download files from specified URLs and save to designated locations in the project path.
{
"name": "download_file",
"arguments": {
"url": "https://example.com/logo.png",
"savePath": "assets/logo.png"
}
}
๐ Related Tools Integration
๐๏ธ Database Management Tools
- MySQL Database Support - DDL operations, permission control, operation logs, connection pool management
- SQL Server Database Support - SQL Server operations, DDL support
- MCP Gitee Pull Request - Gitee PR creation and automated workflows
๐จ Icon Management Tools
- Icon Resource Management - Icon resource management, icon search, icon library integration
๐ง Version Control Tools
- Git Operations Management - Git push operations, pending changes review, push history tracking
๐ Browser Tools
- Headless Browser Document Scraping - Playwright-based headless browser for rendering and scraping modern web documents
๐๏ธ Cache Database Tools
- Redis Operations - Redis data operations, key management, permission control and operation logs
๐ Version History
v5.1.0 (2025-12-22)
- โ
Added
download_filetool supporting file download from URLs to project directory - โ Server and package version updated to 5.1.0
v5.0.0 (2025-12-19) - Major Update
- โ
Added
PROJECT_PATHenv var supporting relative path resolution from project root - โ Cursor auto-detection๏ผๅผๅฏ็ฏๅข็นๆ็ๅขๅผบๆจกๅผ
- โ
Added
list_directory,generate_cursorrulesandgenerate_rulestools - โ AI Behavior Guidelines: Integrated comprehensive AI behavior guidelines and enforcement logic in rules generation template
- โ Security Enhancement: Added path traversal validation for directory scanning tool
v3.0.0 (2025-10-31) - Major Update
- โ
Config directory resolution now includes
TOOL_PREFIXfor multi-project isolation - โ Tool names auto-add prefix, calls auto-remove prefix and route precisely
- โ Simpler multi-project isolation: Just change env vars to switch project context
v1.1.0 (2024-12-19)
- โ API debug tool env var support
- โ Login endpoint smart detection
- โ Request method restrictions, only GET allowed by default
๐ Project Structure
mcp-server-project-standards/
โโโ src/
โ โโโ server-final.js # Main server file
โ โโโ utils/ # Utility functions
โ โโโ get_project_info.js # Project info management
โ โโโ get_project_structure.js # Project structure management
โ โโโ get_api_standards.js # API standards management
โ โโโ get_development_standards.js # Development standards management
โ โโโ database_standards.js # Database standards management
โ โโโ api_debug.js # API debug tool
โโโ bin/
โ โโโ cli.js # CLI startup script
โโโ start-server.js # Managed startup script
โโโ package.json
โโโ README.md