Skip to main content
Glama

🧠 Project Brain MCP

An MCP server that reads any codebase and explains it using AI. Point it at any github repo url / local project folder and ask questions in plain language.

πŸ”§ Tools

Tool

What it does

scan_repo_structure

Scans the folder tree + explains the project architecture

identify_key_files

Finds the most important files for a new developer to read

explain_auth_flow

Reads auth-related files and explains login, tokens, and permissions

ask_codebase

Answer any question grounded in the actual code

Related MCP server: reference-mcp

πŸ› οΈ Setup

1. Install dependencies

npm install

2. Set your API key

cp .env.example .env
# Edit .env and add your ANTHROPIC_API_KEY

3. Build

npm run build

4. Add to Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "project-brain": {
      "command": "node",
      "args": ["/absolute/path/to/project-brain-mcp/build/index.js"],
      "env": {
        "GEMINI_API_KEY": "sk-ant-your-key-here"
      }
    }
  }
}

Restart Claude Desktop. The 4 tools will appear automatically.

πŸ“ Example prompts

Scan the structure of https://github.com/username/repo-name

What are the key files I should read in this repo?

Explain the auth flow in /Users/me/projects/my-api

How does payment processing work in /Users/me/projects/my-shop?

πŸ–₯️ Development

npm run dev   # watch mode (recompiles on save)
npm run build # production build

Available Tools

4 tools
ask_codebaseAsk About CodebaseA

Ask any question about a codebase and get an answer grounded in the actual code. Accepts a local folder path OR a GitHub URL (e.g. https://github.com/user/repo) β€” no cloning needed.

Inputs: question (required), repo_path (required), max_files.

explain_auth_flowExplain Authentication FlowA

Finds all auth-related files and explains login flow, tokens, sessions, and permissions. Accepts a local folder path OR a GitHub URL (e.g. https://github.com/user/repo) β€” no cloning needed.

Inputs: repo_path (required).

identify_key_filesIdentify Key FilesA

Identifies the most important files a developer must read first. Accepts a local folder path OR a GitHub URL (e.g. https://github.com/user/repo) β€” no cloning needed.

Inputs: repo_path (required), focus.

scan_repo_structureScan Repository StructureB

Scans a project and explains the tech stack and architecture. Accepts a local folder path OR a GitHub URL (e.g. https://github.com/user/repo) β€” no cloning needed.

Inputs: repo_path (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 4 tools

    Disambiguation4/5

    Each tool targets a distinct aspect of codebase understanding: structure/stack, key files, auth flow, and free-form Q&A. The main overlap is that explain_auth_flow is effectively a specialized subset of ask_codebase, and ask_codebase could be used for architecture questions that scan_repo_structure handles, but the descriptions give enough guidance to choose correctly.

    Naming Consistency5/5

    All four tools follow a consistent verb_noun snake_case pattern (scan_repo_structure, identify_key_files, explain_auth_flow, ask_codebase). No mixed conventions or vague standalone verbs.

    Tool Count4/5

    Four tools is slightly on the lean side but each has a clear role in a focused codebase-comprehension server. No redundant or filler tools, though the surface is small enough that some users may want additional operations.

    Completeness4/5

    The set covers the core workflow of orienting in an unfamiliar codebase: overall structure, entry-point files, a common deep-dive (auth), and arbitrary Q&A that fills most remaining gaps. Minor gaps like dependency graphs, file search, or change-impact analysis exist but ask_codebase can largely work around them.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers