MCP Server - Code Review

by arahisman

311 downloads
Not rated
GitHub

Description

# MCP Server - Code Review A server implementation for the Model Context Protocol (MCP) that connects Cursor to OpenRouter API via stdio, enabling code review and AI chat functionalities. ## Features - Connects to OpenRouter API to access various large language models - Provides…

About

# MCP Server - Code Review A server implementation for the Model Context Protocol (MCP) that connects Cursor to OpenRouter API via stdio, enabling code review and AI chat functionalities. ## Features - Connects to OpenRouter API to access various large language models - Provides two main functionalities: - Simple text…

Details

Author
arahisman
Downloads
311
Categories
Developer Tools

- Connects to OpenRouter API for various large language models
- Provides ask tool for simple text prompt responses
- Provides code_review tool with project context analysis
- Integrates with repomix for codebase packaging and analysis
- Supports multi‑language project detection automatically
- Runs as a stdio server compatible with MCP protocol

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP Server - Code Review
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install globally or locally via npm (npm install -g mcp-server-code-review). Run from the command line: mcp-server-code-review --api-key YOUR_OPENROUTER_API_KEY [--default-model MODEL_ID]. The server implements two MCP tools: ask for text prompts and code_review for project‑aware code review. Configure the server in Cursor by adding a "mcp-openrouter-stdio" entry using npx with your API key and optional model.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp server - code review": {
            "mcp-server-code-review": {
                "command": "node",
                "args": [
                    "test-mcp-server.js"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-server-code-review": {
        "command": "node",
        "args": [
            "test-mcp-server.js"
        ]
    }
}
# MCP Server - Code Review A server implementation for the Model Context Protocol (MCP) that connects Cursor to OpenRouter API via stdio, enabling code review and AI chat functionalities. ## Features - Connects to OpenRouter API to access various large language models - Provides two main functionalities: - Simple text prompt responses (`ask` tool) - Automated code review with project context analysis (`code_review` tool) - Integrates with repomix for codebase packaging and analysis - Supports multi-language project detection - Runs as a stdio server compatible with the MCP protocol ## Installation ```bash # Install globally npm install -g mcp-server-code-review # Or install locally in your project npm install mcp-server-code-review ``` ## Requirements - Node.js v16 or higher - OpenRouter API key - obtain one at [OpenRouter](https://openrouter.ai) ## Usage ### Command Line ```bash mcp-server-code-review --api-key YOUR_OPENROUTER_API_KEY [--default-model MODEL_ID] ``` ### Options - `--api-key`, `-k` (required): Your OpenRouter API key - `--default-model`, `-m` (optional): Default model to use (defaults to `google/gemini-2.0-flash-thinking-exp:free`) ### Example ```bash mcp-server-code-review --api-key sk-or-v1-xxxxxxxxxxxx --default-model anthropic/claude-3-haiku:free ``` ## MCP Tools This server implements two main MCP tools: ### 1. Ask Tool Sends a simple text prompt to OpenRouter API and returns the response. ```javascript "mcp-openrouter-stdio": { "name": "mcp-openrouter-stdio", "command": "npx", "args": [ "mcp-openrouter-stdio", "--api-key", "sk-or-v1-your_key", "--default-model", "google/gemini-2.0-flash-thinking-exp:free" ], "transport": "stdio" }, ``` ### 2. Code Review Tool Performs a code review using OpenRouter API with project context analysis. ```javascript { name: "code_review", arguments: { completed_tasks: ["Task 1", "Task 2"], work_report: "Details of the work performed", project_path: "/absolute/path/to/project", planned_tasks: ["Future task 1", "Future task 2"], language: "js", // Primary language of the project model: "optional-model-id" // Uses default if not specified } } ``` ## Supported Languages The server can automatically detect and analyze projects in various programming languages: - JavaScript/TypeScript (js) - Python (python) - C# (csharp) - PHP (php) - Java (java) - Ruby (ruby) - Go (go) - Rust (rust) - C++ (cpp) - Swift (swift) ## Development ```bash # Clone the repository git clone https://github.com/arahisman/mcp-server-code-review.git cd mcp-server-code-review # Install dependencies npm install # Build the project npm run build # Watch mode for development npm run watch ``` ## Testing The repository includes several test scripts: ```bash # Basic server test node test-mcp-server.js # Test the ask tool node test-ask.js # Simple functionality test node simple-test.js ``` ## License MIT ## Author Adam Rahisman
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.