# Code Assistant [Health: Active]

**Category:** 🤖 Coding Agents  
**Repository:** https://github.com/j0hanz/code-assistant  
**GitHub Stars:** 0  
**npm Downloads (last month):** 298  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/code-assistant

## Description
Gemini-powered MCP server for code analysis.

## Tools
Capabilities this server exposes over MCP:

- **generate_diff** — Capture git diff (unstaged/staged) and cache server-side
- **analyze_pr_impact** — Assess severity, categories, breaking changes, rollback complexity
- **generate_review_summary** — PR summary, risk rating, merge recommendation
- **generate_test_plan** — Prioritized test cases and coverage guidance
- **analyze_time_space_complexity** — Big-O complexity analysis and degradation detection
- **detect_api_breaking_changes** — Detect breaking API/interface changes
- **load_file** — Cache a source file for analysis tools
- **refactor_code** — Complexity, duplication, naming, grouping suggestions
- **detect_code_smells** — Structural code smells (Fowler taxonomy)
- **generate_documentation** — JSDoc/TSDoc/docstring stubs for public exports
- **ask_about_code** — Natural-language Q&A about a cached file
- **verify_logic** — Verify algorithms via Gemini code execution sandbox
- **web_search** — Google Search with Grounding

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "code-assistant": {
    "command": "npx",
    "args": ["-y","@j0hanz/code-lens-mcp@latest"],
    "env": {
      "GEMINI_API_KEY": "",
      "GOOGLE_API_KEY": ""
    }
  }
}
```

**Requires environment variables:** `GEMINI_API_KEY`, `GOOGLE_API_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What Code Assistant MCP server does

The Code Assistant MCP server, identified as Code Lens in the repository README, provides Gemini-based analysis for Git changes and source files. It exposes tools for reviewing pull-request changes, examining implementation quality, generating documentation, and checking algorithmic logic. The server is aimed at development workflows where an agent needs more than simple file retrieval or text generation.

A review workflow can begin with `generate_diff`, which captures staged or unstaged Git changes and keeps the result in server-side cache. Other tools can assess change severity, affected categories, breaking changes, rollback complexity, test priorities, and merge recommendations. The Code Assistant MCP server also supports source-file workflows through `load_file`, followed by questions, refactoring suggestions, code-smell detection, or documentation generation.

## How it works

The server runs over stdio and uses Google Gemini for analysis. Cached diffs and files provide the input for tools that operate on repository changes or source code. `verify_logic` uses Gemini's code execution sandbox to check algorithms, while `web_search` uses Google Search with Grounding for current information retrieval.

Tool responses use validated JSON output schemas based on Zod v4, which can make results easier for MCP clients to consume programmatically. Every tool except `load_file` can run through MCP tasks with polling, cancellation, and progress updates.

## Setup and configuration

Node.js 24 or newer is required. Set either `GEMINI_API_KEY` or `GOOGLE_API_KEY` with a Gemini API key before starting the Code Assistant MCP server. A standard stdio configuration runs the published package with `npx`:

```json
{
  "mcpServers": {
    "code-lens": {
      "command": "npx",
      "args": ["-y", "@j0hanz/code-lens-mcp@latest"],
      "env": {
        "GEMINI_API_KEY": "your-api-key"
      }
    }
  }
}
```

Docker is also supported through the published GitHub Container Registry image, with the Gemini key passed as an environment variable. The README provides configuration examples for Claude Desktop, Claude Code, Cursor, Windsurf, LM Studio, VS Code, VS Code Insiders, Visual Studio, and Goose.

## Tools and capabilities

Available MCP tools include:

- Capture staged or unstaged diffs and cache them for later analysis.
- Assess pull-request impact, risk, breaking changes, rollback complexity, and merge readiness.
- Produce prioritized test cases and coverage guidance.
- Analyze Big-O time and space complexity, including degradation risks.
- Inspect cached files for refactoring opportunities, duplication, naming issues, grouping issues, and Fowler-style code smells.
- Generate JSDoc, TSDoc, or docstring stubs for public exports.
- Answer natural-language questions about a cached file.
- Verify algorithms with Gemini code execution and retrieve grounded web results.

## Limitations and notes

The server depends on access to Google Gemini and requires a compatible API key. Its analysis tools operate on captured diffs or files loaded into the server cache, so relevant content must be supplied through the corresponding tools. The repository is licensed under MIT.

_Full upstream README: https://allmcps.com/mcp/code-assistant/readme_

