Codebase MCP Server

Multi-layer codebase analysis MCP server with Gemini AI and progressive disclosure.

Local serverstdio

What is the Codebase MCP server?

Multi-layer codebase analysis MCP server with Gemini AI and progressive disclosure. Exposed over MCP by the codebase mcp server, that capability becomes something an assistant can invoke while it works, not something you go and do afterwards.

What it actually does

MCP server for codebase analysis with Gemini AI. Progressive disclosure keeps costs low — start with free structural analysis, drill into semantic details only when needed.

Adding it to your client

codebase-analyzer-mcp on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Its toolset

Everything the assistant can do here goes through one of these:

  • analyze_repo — Full analysis with progressive disclosure
  • query_repo — Ask questions about a codebase
  • expand_section — Drill into specific analysis sections
  • read_files — Read source files from a cached analysis
  • find_patterns — Detect design/architecture patterns
  • trace_dataflow — Trace data flow through the system
  • get_analysis_capabilities — List supported languages and options

Configuration

You will need one environment variable: GEMINI_API_KEY. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the codebase mcp server does with a few real requests.

When to reach for it

Plenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Codebase's toolset — analyze_repo, query_repo, expand_section and 4 more — is a fair guide to whether it matches your workflow. It is maintained by GitHub Actions; 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.

Available tools

ToolWhat it does
analyze_repoFull analysis with progressive disclosure
query_repoAsk questions about a codebase
expand_sectionDrill into specific analysis sections
read_filesRead source files from a cached analysis
find_patternsDetect design/architecture patterns
trace_dataflowTrace data flow through the system
get_analysis_capabilitiesList supported languages and options

How to install the Codebase MCP server

{
  "mcpServers": {
    "codebase-analyzer": {
      "command": "npx",
      "args": ["-y", "codebase-analyzer-mcp"],
      "env": {
        "GEMINI_API_KEY": "your_key_here"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
GEMINI_API_KEYCredential the server authenticates with.Yes

Example prompts to try

  • Use Codebase to analyze repo.
  • Use Codebase to query repo.
  • Use Codebase to expand section.

Frequently asked questions

It connects Codebase to MCP-compatible AI assistants such as Claude and Cursor, exposing 7 tools (analyze_repo, query_repo, expand_section, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Codebase directly.