T

mcp-server-workshop

...
Created 2/20/2025byVisko93

Language:

TypeScript

Stars:

3

Forks:

0

Local AI Code Reviewer šŸ”

A lightweight, local-first code review tool that uses AI to provide quick feedback on your code changes. Built with TypeScript and powered by Ollama, it analyzes git diffs and offers actionable suggestions to improve your code.

Features āœØ

  • šŸš€ Local-First: Runs entirely on your machine - no API keys or internet required
  • šŸ“ Git Integration: Automatically analyzes your uncommitted changes
  • šŸ¤– AI-Powered: Uses the deepseek-coder model for intelligent code review
  • šŸŽØ Rich Output: Clear, colorized terminal output with actionable suggestions
  • āš” Fast: Quick setup and instant feedback
  • šŸ”’ Private: Your code never leaves your machine

Prerequisites šŸ“‹

Before you begin, ensure you have:

  • Windows 11
  • Node.js v22.0.0 or higher
  • npm v11.0.0 or higher
  • Ollama installed

Installation šŸ› ļø

  1. Clone the repository:

    git clone 
    cd code-reviewer
    
  2. Install dependencies:

    npm install
    
  3. Pull the required model:

    ollama pull deepseek-coder:latest
    
  4. Verify the installation:

    ollama list   # Should show deepseek-coder
    

Usage šŸ’»

  1. Make some changes in your project

  2. Run the review tool:

    npx tsx src/index.ts /path/to/your/project
    
  3. Review the suggestions in your terminal

Example output:

šŸ” Code Review Assistant
ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€
Reviewing project: /path/to/your/project

šŸ“‹ Summary
Found 3 issues in your changes...

šŸŽÆ Detailed Analysis
[app.ts]
āŒ ERROR (line 15)
   Unused variable 'config'
   ā†’ Impact: Increases code size and reduces maintainability
   ā†’ Fix: Remove unused variable or implement intended usage

...

Project Structure šŸ—ļø

src/
  ā”œā”€ā”€ index.ts      # CLI entry point
  ā”œā”€ā”€ reviewer.ts   # Core review logic
  ā”œā”€ā”€ git.ts        # Git operations
  ā”œā”€ā”€ ollama.ts     # Model interface

            
        
            
                  ā””ā”€ā”€ types.ts      # TypeScript types

Configuration šŸ”§

You can customize the review process by adding a .reviewconfig folder in your project:

your-project/
  ā”œā”€ā”€ .reviewconfig/
  ā”‚   ā”œā”€ā”€ standards.md    # Project coding standards
  ā”‚   ā””ā”€ā”€ patterns.md     # Preferred patterns
  ā””ā”€ā”€ ...

Troubleshooting šŸ”

Common issues and solutions:

  1. Ollama not responding

    • Check if Ollama is running in your system tray
    • Verify with ollama list
    • Restart Ollama if needed
  2. Model issues

    • Ensure deepseek-coder is installed: ollama pull deepseek-coder:latest
    • Check available memory (8GB minimum recommended)
    • Close unnecessary applications
  3. Node version errors

    • Update Node.js to v22+: node -v
    • Update npm to v11+: npm -v

Limitations šŸš§

While powerful for quick code reviews, be aware that:

  • Local models have limited capabilities compared to cloud alternatives
  • Resource usage depends on your hardware
  • Complex analyses might require cloud-based solutions
  • Model responses can vary in quality

Best Practices šŸŒŸ

  1. Use for:

    • Quick feedback on code changes
    • Personal projects
    • Learning and experimentation
  2. Consider cloud alternatives for:

    • Team-wide code review
    • Production deployment
    • Complex analysis needs

License šŸ“„

MIT License

Last updated: 2/21/2025

Publisher info

Visko93's avatar

Vinicius Skonicezny

Rust and Web enthusiast, front-end developer, and entrepreneur on the weekends.

8
followers
7
following
39
repos

More MCP servers built with TypeScript

docbase-mcp-server

MCP Server Implementation for DocBase

By f4401
aapi-mcp-server

Advanced API MCP Server

By Asphere-xyz1
DBX-MCP-Server

MCP Server for Dropbox

By amgadabdelhafez1