MCP Best Practices Server
by KeyserDSoze
README.md
# MCP Best Practices Server
[](https://github.com/yourusername/mcp-best-practices-server/actions/workflows/deploy.yml)
[](https://badge.fury.io/js/mcp-best-practices-server)
An MCP (Model Context Protocol) server that provides coding best practices, guidelines, and code review capabilities for multiple programming languages and frameworks. Compatible with VS Code, GitHub Copilot, and other MCP clients.
## ๐ Quick Start
### One-Click Installation for VS Code
Click this link to automatically install and configure the server in VS Code:
**[๐ฆ Install in VS Code](vscode:mcp/install?%7B%22name%22%3A%22mcp-best-practices-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22mcp-best-practices-server%22%5D%7D)**
### Manual Installation
#### Option 1: Global Installation
```bash
npm install -g mcp-best-practices-server
```
Then add to your `.vscode/mcp.json`:
```json
{
"mcpServers": {
"best-practices": {
"command": "mcp-best-practices-server",
"args": []
}
}
}
```
#### Option 2: Using npx (Recommended)
Add to your `.vscode/mcp.json`:
```json
{
"mcpServers": {
"best-practices": {
"command": "npx",
"args": ["mcp-best-practices-server"]
}
}
}
```
## โจ Features
### ๐ง Tools
| Tool | Description | Parameters |
|------|-------------|------------|
| **get_best_practices** | Retrieve best practices for specific languages/frameworks | `language` (required), `framework` (optional), `category` (optional) |
| **search_best_practices** | Search through all available guidelines | `query` (required), `limit` (optional, default: 10) |
| **validate_code_pattern** | Analyze code snippets for best practice compliance | `code` (required), `language` (required), `context` (optional) |
### ๐ Resources
Browse and access best practice documents directly:
- **TypeScript** - Type safety, modern syntax, performance guidelines
- **JavaScript** - ES6+, async/await, error handling, security
- **React** - Component design, hooks, performance optimization
- **General Programming** - SOLID principles, testing, documentation
### ๐ฌ Prompts
| Prompt | Description | Parameters |
|--------|-------------|------------|
| **code_review** | Comprehensive code review based on best practices | `code`, `language`, `focus_areas` (optional) |
| **architecture_guidance** | Architectural recommendations for projects | `project_type`, `technologies`, `scale` (optional) |
## ๐ฏ Usage Examples
### In VS Code with GitHub Copilot
#### Get Language-Specific Best Practices
```
User: "Show me TypeScript best practices for error handling"
AI: *calls get_best_practices tool with language="typescript", category="error-handling"*
```
#### Search for Specific Guidelines
```
User: "How should I structure React components?"
AI: *calls search_best_practices tool with query="React component structure"*
```
#### Code Review and Validation
```
User: "Review this function for best practices"
function getUserData(id) {
const data = fetch('/api/users/' + id).then(r => r.json());
return data;
}
AI: *calls validate_code_pattern tool to analyze the code*
```
#### Use Built-in Prompts
```
User: "/mcp.best-practices.code_review"
AI: *Prompts for code, language, and focus areas, then provides comprehensive review*
```
### Available Best Practice Categories
- **Performance** - Optimization techniques, caching strategies, lazy loading
- **Security** - Input validation, authentication, authorization, XSS prevention
- **Testing** - Unit testing, integration testing, TDD, mocking
- **Architecture** - Design patterns, SOLID principles, code organization
- **Maintainability** - Code readability, documentation, refactoring
## ๐ Supported Languages and Frameworks
### Programming Languages
- **TypeScript** - Complete guidelines for modern TypeScript development
- **JavaScript** - ES6+ best practices, async patterns, performance
- **Python** - PEP 8, testing, packaging (coming soon)
- **Java** - Spring Boot, testing, performance (coming soon)
### Frameworks and Libraries
- **React** - Hooks, component patterns, performance optimization
- **Vue.js** - Composition API, reactive patterns (coming soon)
- **Express.js** - API design, middleware, security (coming soon)
- **Next.js** - SSR/SSG patterns, performance (coming soon)
## ๐ ๏ธ Development
### Local Development
1. **Clone the repository**
```bash
git clone https://github.com/yourusername/mcp-best-practices-server.git
cd mcp-best-practices-server
```
2. **Install dependencies**
```bash
npm install
```
3. **Build the project**
```bash
npm run build
```
4. **Test locally**
```bash
npm start
```
### Development Mode
For development with automatic restart:
```json
{
"mcpServers": {
"best-practices-dev": {
"command": "node",
"args": ["./dist/index.js"],
"env": {
"NODE_ENV": "development"
},
"dev": {
"watch": ["src/**/*.ts", "best-practices/**/*.md"],
"debug": {
"type": "node",
"request": "launch",
"program": "./dist/index.js"
}
}
}
}
}
```
### Adding New Best Practices
1. Create markdown files in the `best-practices/` directory
2. Follow the naming convention: `{language}/{framework}/{category}.md`
3. Use clear headings and code examples
4. Include both good and bad examples with โ
/โ indicators
Example structure:
```
best-practices/
โโโ typescript/
โ โโโ general.md
โ โโโ react/
โ โ โโโ hooks.md
โ โ โโโ performance.md
โ โโโ testing.md
โโโ javascript/
โ โโโ general.md
โ โโโ async.md
โ โโโ security.md
โโโ general/
โโโ programming.md
โโโ testing.md
โโโ architecture.md
```
## ๐งช Testing
```bash
# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Run linting
npm run lint
# Fix linting issues
npm run lint:fix
```
## ๐ API Reference
### Tool Schemas
#### get_best_practices
```typescript
interface GetBestPracticesArgs {
language: string; // Required: programming language
framework?: string; // Optional: specific framework
category?: string; // Optional: category like 'performance', 'security'
}
```
#### search_best_practices
```typescript
interface SearchBestPracticesArgs {
query: string; // Required: search query
limit?: number; // Optional: max results (default: 10)
}
```
#### validate_code_pattern
```typescript
interface ValidateCodePatternArgs {
code: string; // Required: code to analyze
language: string; // Required: programming language
context?: string; // Optional: additional context
}
```
## ๐ค Contributing
We welcome contributions! Here's how you can help:
1. **Add new best practices** - Submit markdown files for new languages/frameworks
2. **Improve existing content** - Enhance current best practice documents
3. **Fix bugs** - Report and fix issues in the server code
4. **Add features** - Implement new tools or capabilities
### Contribution Guidelines
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Write tests for new functionality
4. Ensure all tests pass (`npm test`)
5. Update documentation as needed
6. Commit changes (`git commit -m 'Add amazing feature'`)
7. Push to branch (`git push origin feature/amazing-feature`)
8. Open a Pull Request
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ๐ Related Projects
- [Model Context Protocol](https://spec.modelcontextprotocol.io/) - Official MCP specification
- [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk) - Official TypeScript SDK
- [VS Code MCP Extension](https://code.visualstudio.com/docs/copilot/copilot-extensibility-overview) - VS Code MCP support
## ๐ Support
- **Issues**: [GitHub Issues](https://github.com/yourusername/mcp-best-practices-server/issues)
- **Discussions**: [GitHub Discussions](https://github.com/yourusername/mcp-best-practices-server/discussions)
- **Documentation**: [GitHub Pages](https://yourusername.github.io/mcp-best-practices-server/)
## ๐ Acknowledgments
- The MCP community for creating an amazing protocol
- Contributors who have shared their knowledge and best practices
- The VS Code team for excellent MCP integration
---
**Made with โค๏ธ for the developer community**
*Compatible with VS Code, GitHub Copilot, Claude Desktop, and other MCP clients*This server cannot be deployed
Maintenance
ActivityInactive
ResponsivenessOutdated data