ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

Codebase Brain

โดย Nomannazirรุ่น 0.1.0i★ –iรันบนเครื่อง
ชื่อใน registryio.github.Nomannazir/codebase-brain-mcp

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

Cited, searchable memory of a codebase: hybrid search, git history, impact analysis, doc drift.

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: รันบนเครื่อง
  • ช่องทาง (transport): stdio
  • หมวด: เครื่องมือนักพัฒนา
  • ต้องใส่ค่าเหล่านี้: GITHUB_TOKEN

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

ค่าที่ติดป้ายความลับคือกุญแจของบัญชีคุณ อย่าส่งให้ใคร และอย่าวางในแชต

ต้องเตรียมก่อน

  • PyPIติดตั้ง uv ของ Python (มีคำสั่ง uvx) ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "codebase-brain": {
      "command": "uvx",
      "args": [
        "codebase-brain-mcp"
      ],
      "env": {
        "GITHUB_TOKEN": "ใส่ค่าของคุณ",
        "CODEBASE_BRAIN_HOME": "ใส่ค่าของคุณ"
      }
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add codebase-brain --env GITHUB_TOKEN='ใส่ค่าของคุณ' --env CODEBASE_BRAIN_HOME='ใส่ค่าของคุณ' -- uvx codebase-brain-mcp

เติมค่าที่เว้นว่างไว้ก่อนรัน

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "codebase-brain": {
      "command": "uvx",
      "args": [
        "codebase-brain-mcp"
      ],
      "env": {
        "GITHUB_TOKEN": "ใส่ค่าของคุณ",
        "CODEBASE_BRAIN_HOME": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "codebase-brain": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "codebase-brain-mcp"
      ],
      "env": {
        "GITHUB_TOKEN": "ใส่ค่าของคุณ",
        "CODEBASE_BRAIN_HOME": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าที่ต้องใส่เอง

  • GITHUB_TOKEN ความลับ env
    Optional. Raises GitHub's rate limit when reading pull request titles and descriptions.
  • CODEBASE_BRAIN_HOME env
    Where indexes and clones are stored (default ~/.codebase-brain).

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 7 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub Nomannazir ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • – ไม่เกี่ยว

    endpoint ตอบ

    ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน

  • … ยังไม่ตรวจ

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต

เทียบกับตัวอื่นในหมวด เครื่องมือนักพัฒนาi

  • ดาวมากกว่า 0% ของอีก 1391 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 100% ของอีก 1391 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 1391 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

Codebase Brain ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

ต้องใส่ค่าเหล่านี้: GITHUB_TOKEN

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.1.0) เข้า registry วันนี้

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Python (uv) ในเครื่องด้วย

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี GitHub, Desktop Commander, Cloudflare MCP

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

GitHub

โดย github

server ทางการของ GitHub ให้ AI อ่านและจัดการโค้ด issue และ pull request ในบัญชีของคุณได้ ใช้ผ่านคลาวด์ของ GitHub หรือรันในเครื่องด้วย Docker ก็ได้

บนเครื่องหรือคลาวด์★ 34,245MITอัปเดต 3 วันที่ผ่านมา
ติดตั้ง

Desktop Commander

โดย wonderwhy-er

MCP server for terminal commands, file operations, and process management

รันบนเครื่อง★ 10,225MITอัปเดต 15 วันที่ผ่านมา
ติดตั้ง

Cloudflare MCP

โดย cloudflare

Cloudflare MCP servers

รันบนคลาวด์★ 4,446Apache-2.0อัปเดต 14 เดือนที่ผ่านมา
ติดตั้ง

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ

Codebase Brain MCP

An MCP server that gives AI assistants a cited, searchable memory of a codebase, including its history. Point it at a local folder or a public git URL. Claude, Cursor or any MCP client can then answer questions about the code with exact path:start-end citations.

*Claude Code asks why TimestampSigner.unsign looks the way it does, what breaks if it changes, and whether its docs are current. Codebase Brain answers with commits, callers, tests and doc findings, all cited. (Waiting time sped up.)*

The problem

AI coding assistants are good at writing new code but struggle to understand code that already exists:

  • They can't see the whole project. A real codebase has thousands of files. The assistant reads a few and guesses the rest, so it misses the function that matters or invents one that doesn't exist.
  • You can't check their answers. "Expiry is handled in the auth module" is no use if you can't see where. Without file and line references, you have to trust the answer or re-read the code yourself.
  • They don't know why code is the way it is. The code shows *what* it does. The reasons ("we added this check because it crashed on Windows") live in git history and pull requests, which assistants never read. So they "clean up" code that exists for a reason and bring old bugs back.
  • They don't know what a change will break, or whether the documentation still matches the code.
  • Many tools send your code to someone else's server to make it searchable.

What Codebase Brain gives you

A plug-in for any AI assistant that turns a codebase into something it can actually look things up in:

  • Answers with proof. Every result points to the exact file and lines, and the assistant can open them.
  • Search that understands code. It finds code whether you type the exact name (calculate_invoice_total) or describe it in plain words ("how are invoices totalled?").
  • The story behind the code. For any function, it shows every change made to it, who made it, why (from the commit message and pull request), and what the change was.
  • What breaks if you change something. Everything that uses a function, directly or indirectly, and the tests that cover it.
  • Out-of-date docs, found automatically. Documentation that mentions functions, files or settings that no longer exist, or shows examples that would no longer work.
  • Private by design. Everything runs on your machine. No API keys, and your code never leaves your computer.

Why it's different (technical)

  • Code-aware chunking. Python is split by function, class and method using the real syntax tree, Markdown by heading. Each chunk knows its symbol (TimestampSigner.unsign) and exact lines, so citations point at real code.
  • Hybrid retrieval. SQLite FTS5 BM25 (with camelCase / snake_case identifier splitting) plus local embeddings, merged with reciprocal-rank fusion. Exact names and fuzzy questions both work.
  • Local and free. Embeddings run on your machine (fastembed, ONNX). No API keys, and no code leaves your computer.
  • Incremental. Re-indexing only re-embeds files whose content changed. On a 42-file repo, a re-index with no changes takes about 2 seconds.
  • History-aware. explain_history follows a function's lines back through git (git log -L), shows who wrote the current lines, and links the pull requests behind each change. So agents can answer *"why is it built this way?"*, not just *"what does it do?"*.
  • Impact analysis. impact_of_change lists everything that uses a function, directly and transitively, plus the tests that exercise it, before an agent changes anything.
  • Doc-drift detection. find_doc_drift checks Markdown and reStructuredText docs against the code. It finds files, functions, settings and flags that don't exist; examples passing parameters a function doesn't take; imports that would fail; and sections last edited long before the code they describe changed. Each finding cites the doc section and suggests a fix ("Was it renamed to checkout_total?").
  • Agent-friendly output. Structured tool results, read-only tool annotations, progress notifications while indexing, and clear error messages the model can act on.

Tools

ToolWhat it does
index_repo(source, name?)Index a local path or an https:// git URL (shallow clone). Reports progress.
ask_codebase(question, repo?, k?)The most relevant code and docs as cited sources, plus related commits, with instructions to answer only from them.
search(query, repo?, k?, path_prefix?, kinds?)Raw hybrid search, filterable by path and chunk kind.
`explain_history(symbol? \path, start_line?, end_line?, repo?)`Every commit that changed a function or line range, newest first, with the relevant diff, current authorship, and PR titles and descriptions (GitHub).
search_history(query, repo?, k?)Find commits by what their messages say.
impact_of_change(symbol, path?, depth?, repo?)Direct and indirect users of a function or class, and the tests involved.
find_doc_drift(path_prefix?, check_history?, repo?)Documentation that no longer matches the code, by severity (high, medium, low).
read_lines(path, start, end, repo?)Open the exact lines behind a citation. Refuses paths outside the repo.
list_repos()What's indexed, at which commit, and in which languages.

Also included: the resource brain://repos, and the prompt answer_with_citations.

Install

Codebase Brain runs on your own machine, so there's no server or account, and it's free. With uv:

# Claude Code

claude mcp add codebase-brain -- uvx codebase-brain-mcp

Any MCP client (Claude Desktop, Cursor, ...): add this server to its config

{ "command": "uvx", "args": ["codebase-brain-mcp"] }

Quick start

uv sync

uv run codebase-brain index https://github.com/pallets/itsdangerous uv run codebase-brain search "how is the signature timestamp checked for expiry"

0.0313 src/itsdangerous/timed.py:72-158 method TimestampSigner.unsign 0.0311 docs/timed.rst:1-28 code 0.0301 src/itsdangerous/timed.py:170-228 class TimedSerializer

Ask why it looks like that. explain_history(symbol="TimestampSigner.unsign") returns its line-by-line history:

src/itsdangerous/timed.py:72-158

3edfbbbc 2022-03-24 handle OverflowError in timed unsign on 32-bit systems 177196d3 2022-03-09 catch OSError on Windows 37f09970 2022-03-08 catching year overflow ValueError c30678d1 2019-05-31 don't allow timestamps from the future 910a7a94 2020-04-17 datetimes are timezone-aware utc ...

Use it from Claude Code
claude mcp add codebase-brain -- uv run --directory /path/to/codebase-brain-mcp codebase-brain
Run it as a remote server (Streamable HTTP)
export CODEBASE_BRAIN_TOKEN="$(python -c 'import secrets; print(secrets.token_urlsafe(32))')"

uv run codebase-brain serve --transport streamable-http --host 0.0.0.0 --port 8765

Clients connect to http:// :8765/mcp with Authorization: Bearer . GET /healthz is open for load balancers. Remote mode is locked down by default:

  • No token, no public port. The server refuses to listen beyond localhost without a token of at least 24 characters. Tokens are compared in constant time.
  • Remote clients can't read the server's disk. Only public https:// git URLs can be indexed, not local paths, unless you set CODEBASE_BRAIN_ALLOW_LOCAL_PATHS=1.
  • Big repos are refused above CODEBASE_BRAIN_MAX_FILES (default 20,000), and every git command has a timeout.
  • DNS-rebinding protection is on for localhost, and for any hosts listed in CODEBASE_BRAIN_ALLOWED_HOSTS.
Docker
docker build -t codebase-brain-mcp .

docker run -p 8765:8765 -e CODEBASE_BRAIN_TOKEN="$CODEBASE_BRAIN_TOKEN" -v brain-data:/data codebase-brain-mcp

The image runs as a non-root user and includes the embedding model, so it starts fast and needs no download at runtime. It has a health check, and keeps indexes in the /data volume. Indexing uses about 1.2 GB of memory, so give the container 2 GB.

Configuration
VariableDefault
CODEBASE_BRAIN_HOME~/.codebase-brainIndexes and clones
CODEBASE_BRAIN_EMBEDDERfastembedhash gives an offline, deterministic embedder (used in tests)
CODEBASE_BRAIN_EMBED_MODELBAAI/bge-small-en-v1.5Any fastembed text model
CODEBASE_BRAIN_MAX_FILE_BYTES512000Larger files are skipped
GITHUB_TOKENunsetOptional. Raises GitHub's API rate limit for PR lookups
CODEBASE_BRAIN_FETCH_PRS1Set to 0 to never call the GitHub API
CODEBASE_BRAIN_TOKENunsetBearer token for HTTP mode (required unless bound to localhost)
CODEBASE_BRAIN_ALLOWED_HOSTSunsetComma-separated Host values to accept (DNS-rebinding protection)
CODEBASE_BRAIN_ALLOW_LOCAL_PATHS1 (stdio) / 0 (HTTP)Whether index_repo may read local directories
CODEBASE_BRAIN_MAX_FILES20000Refuse repos with more indexable files
PORT8765HTTP port (platforms such as Cloud Run set this)
Doc drift, tested honestly

On a well-maintained project (itsdangerous), find_doc_drift reports no false alarms. It only reports three "worth a look" sections whose docs date from 2020 while the code they describe changed in 2024–2025. On docs with planted mistakes, it catches every one: a moved file, a renamed function (with the right suggestion), an unknown setting and flag, a keyword argument the function doesn't take, and an import that would fail. Changelogs are skipped, because they're supposed to mention removed things.

Evaluation

Does search actually put the right code in front of the model? codebase-brain eval answers that with a benchmark. The benchmark has 32 questions about pallets/itsdangerous, pinned to commit 672971d, each with the code or docs a good answer must come from. The questions are in evals/datasets/itsdangerous.toml. They were written by reading the code before any results were measured, and haven't been changed since.

ModeHit@1Hit@3Hit@5Hit@10MRR@10 (95% CI)nDCG@10p50 latency
hybrid (default)56%88%88%91%0.697 (0.56–0.82)0.7355 ms
keyword only (BM25)56%75%78%84%0.667 (0.52–0.80)0.699<1 ms
vector only (bge-small)56%72%75%94%0.658 (0.51–0.80)0.7014 ms
Hit@5 by question typedescribes behaviour (14)about the docs (7)names the code (11)
hybrid71%100%100%
keyword only64%71%100%
vector only57%71%100%

What this shows:

  • Hybrid finds a right answer in the top 3 for 88% of questions, against 75% and 72% for either method alone. The gain comes from questions written in plain words and questions about the docs. When the question names the code, every mode finds it.
  • **It's h

ตัดมาแค่ช่วงต้น อ่านต่อใน repo

ถาม PopNx