Gemini-powered MCP server for code analysis.
If you already use Code Lens, the code lens mcp server is the piece that lets your assistant work with it directly. Gemini-powered MCP server for code analysis.
Gemini-powered MCP server for automated code review, analysis, and documentation.
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. It exposes 13 tools, 7 resources, and 5 prompts over stdio transport.
The toolset is worth reading before you wire it up, because it tells you what the integration is really for:
generate_diff — Capture git diff (unstaged/staged) and cache server-sideanalyze_pr_impact — Assess severity, categories, breaking changes, rollback complexitygenerate_review_summary — PR summary, risk rating, merge recommendationgenerate_test_plan — Prioritized test cases and coverage guidanceanalyze_time_space_complexity — Big-O complexity analysis and degradation detectiondetect_api_breaking_changes — Detect breaking API/interface changesload_file — Cache a source file for analysis toolsrefactor_code — Complexity, duplication, naming, grouping suggestionsdetect_code_smells — Structural code smells (Fowler taxonomy)generate_documentation — JSDoc/TSDoc/docstring stubs for public exportsask_about_code — Natural-language Q&A about a cached fileverify_logic — Verify algorithms via Gemini code execution sandboxConfiguration is passed through the environment: GEMINI_API_KEY, GOOGLE_API_KEY. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.
GEMINI_API_KEY or GOOGLE_API_KEY)Installation goes through your MCP client rather than a global install: point it at @j0hanz/code-lens-mcp on npm and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.
Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Code Lens's toolset — generate_diff, analyze_pr_impact, generate_review_summary and 11 more — is a fair guide to whether it matches your workflow. It is maintained by j0hanz; worth a glance at recent repository activity before you build anything load-bearing on it.
SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.
| Tool | What it does |
|---|---|
| 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 |
| Research | The Research tool exposed by this server. |
{
"mcpServers": {
"code-lens": {
"command": "npx",
"args": ["-y", "@j0hanz/code-lens-mcp@latest"],
"env": {
"GEMINI_API_KEY": "your-api-key"
}
}
}
}Configuration as documented by the project. Restart the client after saving.
GEMINI_API_KEY or GOOGLE_API_KEY)| Variable | Description | Required |
|---|---|---|
| GEMINI_API_KEY | Credential the server authenticates with. | Yes |
| GOOGLE_API_KEY | Credential the server authenticates with. | Yes |
Kill hallucinated APIs — version-accurate, up-to-date library documentation injected straight into context.
Microsoft's official browser automation server — drive a real browser through the accessibility tree, no screenshots needed.
GitHub's official server — repos, issues, pull requests, Actions and code security, straight from your assistant.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Local repository surgery — status, diffs, commits, branches and history for any repo on disk.
Timezone sanity for AI — current time anywhere and correct conversions, without the model doing date math.