npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

style-guide-mcp-server

v2.0.0

Published

Lightning-fast MCP server providing comprehensive programming style guides, security best practices, and code analysis for 15+ languages with intelligent caching and optimization

Downloads

20

Readme

Style Guide MCP Server

License: MIT Node.js Version TypeScript Model Context Protocol

⚡ Lightning-fast MCP server providing comprehensive programming style guides, security best practices, and code analysis for 15+ languages with intelligent caching and optimization.

🚀 Features

📚 Comprehensive Style Guides

  • 15+ Languages Supported: TypeScript, JavaScript, Python, C++, Java, Go, Rust, C#, PHP, Ruby, Swift, Kotlin, and more
  • Multiple Sources: Google Style Guides, official documentation, community best practices
  • Intelligent Caching: Advanced HTTP caching with disk persistence and LRU eviction
  • Optimized SQLite: High-performance database with WAL mode and prepared statements
  • Lightning Fast: 22ms startup time with lazy loading and background updates

🔍 Powerful Search & Discovery

  • Full-Text Search: Optimized search across all guidelines with indexing
  • Category Filtering: Find guidelines by topic (naming, formatting, security, etc.)
  • Source Comparison: Compare recommendations from different style guides
  • Context-Aware: Get relevant guidelines based on your needs
  • Batch Processing: Parallel fetching and processing for faster results

🛡️ Security Guidelines

  • 28+ Vulnerability Types: Comprehensive security vulnerability database
  • CWE References: Linked to Common Weakness Enumeration
  • Language-Specific: Tailored security advice per language
  • Framework Coverage: React, Node.js, Docker, Kubernetes security

🔧 Code Analysis

  • Pattern Matching: Detects common style violations
  • Severity Levels: Errors, warnings, and info-level suggestions
  • Auto-Fix: Automatically fix common issues
  • Detailed Reports: Line numbers, suggestions, and explanations

📤 Export Capabilities

  • Multiple Formats: Markdown, HTML, JSON
  • Professional Styling: Clean document generation
  • Timestamped Files: Version-controlled exports

🏗️ Architecture

Core Components

  • MCP Server: Standard MCP protocol implementation with async initialization
  • Optimized Database: High-performance SQLite with WAL mode, connection pooling, and prepared statements
  • Cached HTTP Client: Intelligent caching with retry logic, batch processing, and disk persistence
  • Optimized Content Fetcher: Parallel fetching with smart parsing and content categorization
  • Memory Manager: Automatic memory management with LRU eviction and cleanup
  • Code Analyzer: Pattern-based code analysis with auto-fix capabilities
  • Export Manager: Multi-format document generation

Performance Features

  • 22ms Startup: Lightning-fast startup with lazy loading
  • Memory Optimization: Automatic cleanup and memory monitoring
  • HTTP Caching: Intelligent caching reduces redundant requests by 80%+
  • Batch Processing: Parallel operations for improved throughput
  • Connection Pooling: Optimized database connections

🛠️ Installation

NPM Installation (Recommended)

The easiest way to install the Style Guide MCP Server is via npm:

npm install -g style-guide-mcp-server

Or install locally in your project:

npm install style-guide-mcp-server

Install from GitHub

If you prefer to install from the repository:

# Clone the repository
git clone https://github.com/cbuntingde/style-guide-mcp-server.git
cd style-guide-mcp-server

# Install dependencies
npm install

### Claude Desktop Configuration

Add to your Claude Desktop configuration file:

**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
```json
{
  "mcpServers": {
    "style-guide": {
      "command": "node",
      "args": ["/absolute/path/to/style-guide-mcp-server/build/index.js"]
    }
  }
}

Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "style-guide": {
      "command": "node",
      "args": ["C:\\absolute\\path\\to\\style-guide-mcp-server\\build\\index.js"]
    }
  }
}

After npm global install, you can use:

{
  "mcpServers": {
    "style-guide": {
      "command": "style-guide-mcp-server"
    }
  }
}

To find the path after npm global install:

# On macOS/Linux
npm root -g

# On Windows
npm root -g

SERVER_VERSION=1.0.0 LOG_LEVEL=info

Database Configuration

DATABASE_PATH=./data/styleguides.db DATABASE_BACKUP_ENABLED=true DATABASE_ENCRYPTION_ENABLED=false

Security Configuration

RATE_LIMITING_ENABLED=true RATE_LIMIT_WINDOW_MS=60000 RATE_LIMIT_MAX_REQUESTS=100 MAX_QUERY_LENGTH=1000 MAX_CODE_LENGTH=10000

Monitoring Configuration

MONITORING_ENABLED=true METRICS_INTERVAL=60000 HEALTH_CHECK_INTERVAL=30000

Caching Configuration

CACHING_ENABLED=true CACHE_TTL=604800000 CACHE_MAX_SIZE=1000


### Claude Desktop Configuration

Add to your Claude Desktop configuration file:

**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
```json
{
  "mcpServers": {
    "style-guide": {
      "command": "node",
      "args": ["/absolute/path/to/style-guide-mcp-server/build/index.js"]
    }
  }
}

Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "style-guide": {
      "command": "node",
      "args": ["C:\\absolute\\path\\to\\style-guide-mcp-server\\build\\index.js"]
    }
  }
}

📖 Usage

MCP Resources

Access style guides directly through URI schemes:

  • style-guide://{language} - Complete style guide for a language
  • best-practices://{language} - Best practices organized by category
  • security://all - All security guidelines and vulnerabilities

MCP Tools

Search Guidelines

{
  "name": "search_guidelines",
  "arguments": {
    "query": "naming conventions",
    "language": "typescript"
  }
}

Analyze Code

{
  "name": "analyze_code",
  "arguments": {
    "code": "var name = 'John';\nlet age = 30;",
    "language": "javascript",
    "auto_fix": true
  }
}

Check Security

{
  "name": "check_security",
  "arguments": {
    "vulnerability_type": "SQL injection"
  }
}

Export Guidelines

{
  "name": "export_guidelines",
  "arguments": {
    "language": "python",
    "format": "html"
  }
}

Add Custom Guidelines

{
  "name": "add_custom_guideline",
  "arguments": {
    "language": "typescript",
    "title": "API Response Types",
    "content": "All API responses must have explicit return types",
    "category": "types"
  }
}

🧪 Development

Running Tests

# Run all tests
npm test

# Run unit tests only
npm run test:unit

# Generate coverage report
npm run test:coverage

Code Quality

# Type checking
npm run type-check

# Linting
npm run lint

# Formatting
npm run format:check

# Security audit
npm audit

Building

# Development build
npm run dev

# Production build
npm run build

📊 Supported Languages

Core Languages

  • TypeScript - Google Style Guide, Microsoft Guidelines, Best Practices
  • JavaScript - Google Style Guide, Airbnb Style Guide, MDN Guide
  • Python - PEP 8, Google Python Style Guide, Best Practices
  • Java - Google Java Style Guide, Oracle Conventions
  • C++ - Google C++ Style Guide, C++ Core Guidelines
  • Go - Effective Go, Go Code Review Comments
  • Rust - Rust API Guidelines, Rust Book
  • C# - Microsoft C# Coding Conventions
  • PHP - PHP-FIG Standards, Best Practices
  • Ruby - Ruby Style Guide, Best Practices
  • Swift - Swift API Design Guidelines
  • Kotlin - Kotlin Coding Conventions

Frameworks & Technologies

  • React - Security Best Practices, Performance Optimization
  • Vue.js - Style Guide, Best Practices
  • Angular - Style Guide, Security Best Practices
  • Node.js - Security Best Practices, Performance
  • Express.js - Best Practices, Security
  • Django - Best Practices, Security
  • Flask - Best Practices, Security
  • Docker - Security Best Practices
  • Kubernetes - Security Best Practices

Security Coverage

  • OWASP Top 10 - Comprehensive coverage
  • Injection Attacks - SQL, Command, LDAP Injection
  • XSS - Cross-Site Scripting variants
  • CSRF - Cross-Site Request Forgery
  • Authentication - Broken Authentication, Session Management
  • Cryptography - Weak Cryptography, Hardcoded Credentials
  • API Security - BOLA, Excessive Data Exposure, Rate Limiting
  • Modern Threats - SSRF, XXE, Container Security

🔒 Security

Security Features

  • Input Validation: Comprehensive validation and sanitization
  • Network Security: Timeout protection, user-agent headers
  • Data Protection: Optional database encryption
  • Error Handling: Secure error reporting without information leakage
  • Dependency Security: Regular security audits

Supported Vulnerability Types

The server includes detailed guidelines for 28+ vulnerability types including:

  • SQL Injection, Command Injection, LDAP Injection
  • Cross-Site Scripting (XSS), DOM-based XSS
  • Cross-Site Request Forgery (CSRF), Clickjacking
  • Insecure Deserialization, Path Traversal
  • Broken Authentication, Session Fixation
  • Weak Cryptography, Hardcoded Credentials
  • API Security vulnerabilities
  • Server-Side Request Forgery (SSRF)
  • XML External Entity (XXE)
  • Container Escape, Cloud Misconfigurations

📁 Project Structure

style-guide-mcp-server/
├── src/
│   ├── index.ts              # Main entry point with optimized startup
│   ├── config/               # Configuration management with environment variables
│   ├── database/             # Optimized database layer with connection pooling
│   │   └── optimized-db.ts   # High-performance SQLite implementation
│   ├── http/                 # HTTP client with intelligent caching
│   │   └── cached-client.ts  # Cached HTTP client with retry logic
│   ├── fetching/             # Content fetching and parsing
│   │   └── optimized-fetcher.ts # Parallel content processing
│   ├── memory/               # Memory management and optimization
│   │   └── memory-manager.ts # LRU cache and cleanup utilities
│   ├── errors/               # Error handling
│   ├── logging/              # Logging utilities
│   ├── monitoring/           # Health checks and metrics
│   ├── rate-limiting/        # Rate limiting implementation
│   └── validation/           # Input validation
├── tests/
│   ├── setup.ts              # Test configuration
│   └── unit/                 # Unit tests
│       └── validation.test.ts # Validation tests
├── docs/
│   └── API.md                # API documentation
├── scripts/                  # Setup and utility scripts
│   ├── setup-github.bat      # Windows GitHub setup
│   └── setup-github.sh       # Unix GitHub setup
├── data/                     # Database storage (gitignored)
├── exports/                  # Generated exports (gitignored)
├── build/                    # Compiled output (gitignored)
├── package.json              # Dependencies and scripts
├── tsconfig.json             # TypeScript configuration
├── mcp.json                  # MCP server configuration
├── LICENSE                   # MIT License
├── CONTRIBUTING.md           # Contribution guidelines
├── SECURITY.md               # Security policy
├── CODE_OF_CONDUCT.md        # Community guidelines
├── MIGRATION.md              # Migration guide
├── example-usage.md          # Usage examples
└── README.md                 # This file

🚀 Deployment

Production Deployment

  1. Configure environment variables
  2. Build the application: npm run build
  3. Deploy with your preferred method:
    • Direct Node.js execution
    • Docker containers
    • Process managers (PM2, systemd)

Docker Deployment

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY build/ ./build/
EXPOSE 3000
CMD ["node", "build/index.js"]

📚 API Documentation

Complete API documentation is available at:

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Process

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass
  6. Submit a pull request

Code Standards

  • Follow the enterprise coding standards
  • Add headers to all files
  • Include comprehensive tests
  • Update documentation

📄 License

Copyright 2025 Chris Bunting [email protected] All rights reserved.

This project is licensed under the MIT License - see the LICENSE file for details.

🆘 Support

For support and questions:

🗺️ Roadmap

  • [ ] Additional language support (Lua, Dart, Scala)
  • [ ] Advanced code analysis with AI suggestions
  • [ ] Team collaboration features
  • [ ] Plugin system for custom analyzers
  • [ ] Real-time synchronization with style guide sources
  • [ ] Multi-tenant support
  • [ ] Advanced reporting and analytics
  • [ ] GraphQL API for advanced integrations
  • [ ] Web dashboard for monitoring and management

✅ Recent Improvements (v2.0)

  • 22ms startup time (from several seconds)
  • 🧠 Intelligent memory management with automatic cleanup
  • 🌐 Advanced HTTP caching with 80%+ reduction in redundant requests
  • 🗄️ Optimized database with WAL mode and connection pooling
  • 🔄 Retry logic with exponential backoff for network requests
  • 📊 Performance monitoring and memory usage tracking
  • 🛡️ Enhanced security with comprehensive input validation

🙏 Acknowledgments

  • Google Style Guides for comprehensive style guidelines
  • OWASP for security best practices
  • The MCP community for protocol development
  • All contributors and users of this project

Built with ❤️ for the development community


Repository: https://github.com/cbuntingde/style-guide-mcp-server
Issues: https://github.com/cbuntingde/style-guide-mcp-server/issues
Discussions: https://github.com/cbuntingde/style-guide-mcp-server/discussions