Code Lens is a Model Context Protocol server that uses Google Gemini to analyze diffs, review pull requests, detect code smells, generate documentation, and verify logic.
From the registry: Gemini-powered MCP server for code analysis.
Please install the `code-assistant` MCP server into my current AI client (that's you).
Required prerequisites (do these first if not already done):
- **Node.js >= 24** — Required to run via npx.
- **Gemini API key** — Get a Gemini API key from Google AI Studio. (https://aistudio.google.com/apikey)
Canonical MCP server config (stdio transport):
- command: `npx`
- args: ["-y","@j0hanz/code-lens-mcp@latest"]
- required environment variables:
- `GEMINI_API_KEY`: Gemini API key (or fallback GOOGLE_API_KEY). (example: `<your-gemini-api-key>`)
- optional environment variables:
- `GOOGLE_API_KEY`: Fallback for GEMINI_API_KEY. (example: `<your-google-api-key>`)
- `GEMINI_MODEL`: Override the default Gemini model. (example: `gemini-2.5-flash`)
- `MAX_DIFF_CHARS`: Maximum diff size in characters (default 120000). (example: `120000`)
- `MAX_CONCURRENT_CALLS`: Maximum concurrent Gemini API calls (default 10). (example: `10`)
- `MAX_CONCURRENT_BATCH_CALLS`: Maximum concurrent batch Gemini calls (default 2). (example: `2`)
- `MAX_CONCURRENT_CALLS_WAIT_MS`: Wait timeout for concurrency semaphore (default 2000). (example: `2000`)
- `TASK_TTL_MS`: Default task result retention in ms (default 300000). (example: `300000`)
- `MAX_TASK_TTL_MS`: Upper bound for request-provided task TTL (default 3600000). (example: `3600000`)
- `GEMINI_BATCH_MODE`: Enable Gemini batch mode (default off). (example: `off`)
- `GEMINI_HARM_BLOCK_THRESHOLD`: Safety filter threshold. (example: `BLOCK_NONE`)
- `GEMINI_DIFF_CACHE_ENABLED`: Enable Gemini context caching for large diffs. (example: `false`)
- `GEMINI_DIFF_CACHE_TTL_S`: Cache TTL in seconds when caching is enabled. (example: `3600`)
Note: Despite slug 'code-assistant', the package is published as @j0hanz/code-lens-mcp. The repo also corresponds to the 'code-lens' slug.
Add this MCP server to my current client's config in the correct format for you. If you need secrets or credentials I haven't provided, ASK me — do not invent values or leave raw placeholders. After adding it, tell me how to verify the server is connected.GEMINI_API_KEYrequiredAPI key for accessing Google Gemini services.AI orchestration with hive-mind swarms, neural networks, and 87 MCP tools for enterprise dev.
Persistent codebase knowledge graph. Survives session restarts and context compaction.
A powerful toolkit for coding, providing semantic retrieval and editing capabilities.