40개 이상의 프로그래밍 언어에 대해 심볼 정의, 호출자, 임포트 및 의존성 분석을 포함한 구조적 코드 인텔리전스를 제공합니다.
다른 이름 munhq/codeindex, @munhq/codeindex
- 스타
- 3
- Tools
- 38
- 다운로드, 30일
- —
- 최신 버전
- 0.6.8
- 마지막 커밋
- 2026년 11월 13일
- 라이선스
- MIT
codeindex MCP란?
codeindex은(는) MCP server입니다. 40개 이상의 프로그래밍 언어에 대해 심볼 정의, 호출자, 임포트 및 의존성 분석을 포함한 구조적 코드 인텔리전스를 제공합니다. 38개 도구를 제공합니다. 예: status, search, find_symbol.
프로젝트 README에서 생성된 요약
codeindex MCP server 정보
Claude 또는 Cursor와 같은 AI 코딩 에이전트를 사용하는 개발자는 codeindex를 사용하여 코드베이스에 대한 심층적인 구조 분석을 수행할 수 있습니다. AI가 문맥을 이해하기 위해 전체 파일을 읽도록 강제하는 대신, 이 MCP server는 Rust, Python, TypeScript를 포함한 40개 이상의 프로그래밍 언어에 대해 심볼 정의, 호출자 및 의존성에 관한 정확한 답변을 제공합니다. tree-sitter를 사용하여 의존성 그래프와 trigram 전체 텍스트 인덱스를 구축하므로, 토큰 사용량을 크게 절약하면서 효율적인 쿼리가 가능합니다.
이 server는 stdio를 통해 MCP server로 작동하며, 로컬 데몬으로 실행하여 여러 에이전트 세션에서 단일 인덱스를 공유할 수 있습니다. 이러한 아키텍처를 통해 하나의 저장소에 여러 에이전트가 연결되어 있더라도 코드베이스를 한 번만 파싱하고 감시하도록 보장합니다. 사용자는 npx, 사전 빌드된 바이너리 또는 Docker 컨테이너를 사용하여 server를 설정할 수 있습니다. 워크스페이스 인덱싱을 시작하는 데 API key나 복잡한 설정이 필요하지 않습니다.
활용 사례
- 1복잡한 리팩터링 계획 수립특정 심볼의 호출자와 아키텍처에 미치는 영향을 포함하여 완전한 리팩터링 계획을 생성하도록 AI에게 요청합니다.
- 2변경 영향도 평가특정 파일이 수정될 경우 시스템의 어느 부분이 손상될 수 있는지 전이적 영향 범위를 파악합니다.
- 3보안 감사 수행프로젝트 내의 하드코딩된 비밀 정보나 안전하지 않은 코드 패턴을 감지하기 위해 자동화된 분석을 실행합니다.
- 4데드 코드 식별코드베이스를 정리하기 위해 정의 외부에서 참조되지 않는 심볼을 찾습니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
codeindex MCP 설치 방법
형식 확인: 2026년 11월 10일Claude Code에 codeindex MCP 설치
$ claude mcp add codeindex -- npx -y @munhq/codeindexCursor에 codeindex MCP 설치
~/.cursor/mcp.json
{
"mcpServers": {
"codeindex": {
"command": "npx",
"args": [
"-y",
"@munhq/codeindex"
]
}
}
}VS Code에 codeindex MCP 설치
.vscode/mcp.json
{
"servers": {
"codeindex": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@munhq/codeindex"
]
}
}
}Claude Desktop에 codeindex MCP 설치
claude_desktop_config.json
{
"mcpServers": {
"codeindex": {
"command": "npx",
"args": [
"-y",
"@munhq/codeindex"
]
}
}
}Codex에 codeindex MCP 설치
~/.codex/config.toml
[mcp_servers.codeindex] command = "npx" args = ["-y", "@munhq/codeindex"]
Gemini CLI에 codeindex MCP 설치
~/.gemini/settings.json
{
"mcpServers": {
"codeindex": {
"command": "npx",
"args": [
"-y",
"@munhq/codeindex"
]
}
}
}codeindex MCP 도구 38
README에서 감지됨statussearchfind_symbolfind_wordfind_callersget_outlineget_treeget_importsget_imported_byget_change_impactplan_changeget_hot_files
| status | — | |
| search | — | |
| find_symbol | — | |
| find_word | — | |
| find_callers | — | |
| get_outline | — | |
| get_tree | — | |
| get_imports | — | |
| get_imported_by | — | |
| get_change_impact | — | |
| plan_change | — | |
| get_hot_files | — |
도구 38개 모두 보기도구 수 줄이기
read_fileread_symbolindex_workspaceanalyzesecuritydead_codeunwrap_audittest_coveragearchitecturecrossreftype_driftdb_schemamigration_paritymanifest_complianceliteral_scancouplingcyclesduplicationclonesspawn_scandepsleak_shapeslogic_shapescall_costfield_contentionhealth
| read_file | — | |
| read_symbol | — | |
| index_workspace | — | |
| analyze | — | |
| security | — | |
| dead_code | — | |
| unwrap_audit | — | |
| test_coverage | — | |
| architecture | — | |
| crossref | — | |
| type_drift | — | |
| db_schema | — | |
| migration_parity | — | |
| manifest_compliance | — | |
| literal_scan | — | |
| coupling | — | |
| cycles | — | |
| duplication | — | |
| clones | — | |
| spawn_scan | — | |
| deps | — | |
| leak_shapes | — | |
| logic_shapes | — | |
| call_cost | — | |
| field_contention | — | |
| health | — |
구성
CODEINDEX_DAEMON_IDLE_SECSSeconds with no session attached before the shared daemon exits and returns its memory. Default 900. Set 0 to keep it resident.
CODEINDEX_NO_DAEMONSet to 1 to keep the index inside this server process. By default every session on one repository shares a single background daemon that parses and watches the tree once, and each session is a thin relay onto it. Turn that off for a sandbox with no writable runtime directory.
CODEINDEX_PROJECT_IDCODEINDEX_WORKSPACEDirectory to index. Defaults to the enclosing project root of wherever the client starts the server, which is the right answer for every editor and agent that launches it inside a repository. Set it only when the server runs somewhere other than the code.
| 이름 | 설명 | 유형 |
|---|---|---|
| CODEINDEX_DAEMON_IDLE_SECS | Seconds with no session attached before the shared daemon exits and returns its memory. Default 900. Set 0 to keep it resident. | |
| CODEINDEX_NO_DAEMON | Set to 1 to keep the index inside this server process. By default every session on one repository shares a single background daemon that parses and watches the tree once, and each session is a thin relay onto it. Turn that off for a sandbox with no writable runtime directory. | |
| CODEINDEX_PROJECT_ID | — | |
| CODEINDEX_WORKSPACE | Directory to index. Defaults to the enclosing project root of wherever the client starts the server, which is the right answer for every editor and agent that launches it inside a repository. Set it only when the server runs somewhere other than the code. |
자동 검사
2026년 11월 12일에 실행됨전체 보고서 →자동 검사를 통과했습니다. 이는 보안 감사가 아닙니다. 코드를 직접 읽고 서버에 필요한 최소한의 권한만 부여하십시오. 검사 방식
- 소스 저장소 연결 및 접근 가능통과
- 오픈 소스 라이선스 (OSI)통과
- 최근 1년 내 커밋 또는 릴리스통과
- 패키지 이름이 인기 패키지와 유사하지 않음통과
- 원격 엔드포인트가 HTTPS 사용검사되지 않음
- 파괴적인 도구에 라벨 표시됨통과
- 모델에 대한 숨겨진 지침 없음통과
- 패키지와 의존성에 심각한 보안 권고 없음통과
README
GitHub에서 보기A structural code intelligence engine that runs as an MCP server for AI coding agents.
It indexes your codebase with tree-sitter (40+ languages), builds a trigram full-text index, an inverted word index, and a dependency graph — then exposes them through 16 MCP tools.
┌─────────────┐ MCP (stdio) ┌───────────┐ ┌──────────────────┐
│ AI Agent │ ◄─────────────► │ codeindex │ socket │ codeindex daemon │
│ (Claude, │ 16 tools, │ (relay) │ ◄────────► │ one per │
│ Cursor…) │ JSON-RPC └───────────┘ │ workspace │
└─────────────┘ └────────┬─────────┘
┌─────────────┐ MCP (stdio) ┌───────────┐ │
│ AI Agent │ ◄─────────────► │ codeindex │ ◄───────────────────┘
│ (session 2)│ │ (relay) │ tree-sitter parse (40+ langs)
└─────────────┘ └───────────┘ trigram + word index
dependency graph
one file watcher
snapshot persistence
Every session on a repository speaks plain stdio MCP, as before. Behind that, they share one index: the tree is parsed once, watched once and written once, however many agents are attached. Eight sessions on one repository used to be eight copies of the same index, eight file watchers and eight writers of the same snapshot; measured on a 720-file project, each session went from 87 MB to 7 MB, against one shared 77 MB daemon.
Why
AI coding agents spend tokens reading entire files. codeindex answers structural questions — symbol outlines, definitions, callers, blast radius, dependency chains — in a few hundred tokens instead of thousands.
One plan_change call returns: where a symbol is defined, every call site, the file's architectural role (god module / stable core / island / driver), hardcoded literals to check, and the full transitive blast radius if the file changes.
Quickstart
The shortest path, if you have Node 18+. Nothing else to install, no key, no config — the package is a 4 KB wrapper that fetches the binary for your platform and verifies it against the published checksums:
claude mcp add codeindex -- npx -y @munhq/codeindex
No Node, or you want the skill and the hook as well:
# Prebuilt binary + skill + MCP registration, in one command
curl -fsSL https://raw.githubusercontent.com/munhq/codeindex/main/install.sh | sh
# Or build from source:
cd zig && ./fetch-vendor.sh && zig build -Doptimize=ReleaseFast
Docker, for hosts that install MCP servers as images. The workspace is bind-mounted read-only; codeindex never writes to it:
docker run -i --rm -v "$PWD:/workspace:ro" munhq/codeindex
Register with your AI agent:
# Claude Code — the plugin is the one-step path. It ships the skill, both
# routing hooks and the MCP server together, and its launcher finds or fetches
# the binary.
claude plugin marketplace add munhq/codeindex
claude plugin install codeindex@codeindex
# Without the plugin (or for a different MCP client), register the binary
# directly. Do not do both: two registrations mean two servers, two copies of
# every tool schema, and two writers on one snapshot. install.sh detects the
# plugin and skips this step when it is present.
claude mcp add -s user codeindex -- ~/.local/bin/codeindex --mcp
# Cursor / Claude Desktop / other MCP clients: add to your config
{
"mcpServers": {
"codeindex": {
"command": "npx",
"args": ["-y", "@munhq/codeindex"]
}
}
}
Every listing points at the same server: npm @munhq/codeindex, the official MCP
registry as io.github.munhq/codeindex, and Smithery as munhq/codeindex.
The next time your agent starts, codeindex indexes your project in the background and serves structural queries.
MCP Tools
| Tool | What it does |
|---|---|
status |
Index stats: file count, symbol count, indexing state, token savings %, the indexed workspace and whether a watcher is live |
search |
Trigram-accelerated full-text search across all indexed files |
find_symbol |
Find symbol definitions (functions, structs, classes…) by name |
find_word |
Exact word/identifier lookup in the inverted word index |
find_callers |
Call sites of a symbol, each with the function that holds it. Matched by name, so a same-named definition elsewhere is included |
get_outline |
Structural outline of a file (symbols, line counts) |
get_tree |
Directory tree with file metadata |
get_imports |
What files does a given file import/depend on |
get_imported_by |
Reverse dependencies — who imports this file |
get_change_impact |
Transitive blast radius: what breaks if a file changes |
plan_change |
Full refactor plan for a symbol or file — definitions, callers, file role, literals, blast radius |
get_hot_files |
Recently changed files sorted by recency |
read_file |
Read file contents with optional line range |
read_symbol |
Read just a symbol's source code (with optional context lines) |
index_workspace |
Index or re-index a project directory; a session that works in another checkout moves to that checkout's index |
analyze |
Run one of 22 code analyses (see below) |
Analyses (analyze tool)
| Analysis | What it finds |
|---|---|
security |
Hardcoded secrets, SQL injection patterns, unsafe blocks, eval usage |
dead_code |
Symbols nothing names outside their own definition, split from the unused public API of a library package |
unwrap_audit |
.unwrap() / expect / panic! sites (Rust), ranked by whether a request handler, a loop or main reaches them |
test_coverage |
Files without test coverage |
architecture |
Architectural smells — god modules, circular deps, islands |
crossref |
Cross-file symbol references |
type_drift |
Type signature mismatches across modules |
db_schema |
Tables the migrations create that no code names, and SQL ORM models no migration creates |
migration_parity |
Missing migrations for schema changes |
manifest_compliance |
package.json / Cargo.toml / go.mod compliance issues |
literal_scan |
Hardcoded URLs, IPs, ports, absolute paths, TODOs |
coupling |
Module coupling metrics |
cycles |
Circular dependency detection |
duplication |
Reinvented free functions — the same job written twice |
clones |
Copy-pasted function bodies, ignoring names and whitespace |
spawn_scan |
An interpreter started on a loop or a timer, across files, ranked by startup cost times spawn rate |
deps |
Dependency inventory — duplicate versions, unreferenced crates, single-use crates |
leak_shapes |
Shapes a leak has, each paired with the runtime series that decides it |
logic_shapes |
A fixed byte constant against the memory limit of the unit that deploys it, and replicas × pool size against a pooler's connection capacity |
call_cost |
Loops over rows ranked by the database and HTTP round trips each element costs, counted through the call graph |
field_contention |
One declared-state field written by two or more owners |
health |
Roll-up of the analyses above into one index-health report |
Supported Languages
40+ languages via tree-sitter: Rust, Python, TypeScript/TSX, Go, Zig, C, C++, Java, Ruby, Bash, C#, Kotlin, Lua, Scala, Elixir, R, Swift, Dart, Haskell, TOML, JSON, YAML, HTML, CSS, SCSS, SQL, HCL, Dockerfile, Markdown, Nix, Make, and more.
Configuration
codeindex --mcp # Run as MCP server (stdio)
codeindex --mcp --no-daemon # ...without sharing the workspace daemon
codeindex --daemon-idle-secs 0 # Keep the daemon resident indefinitely
codeindex --workspace ./my-project # Index a specific directory
codeindex --project-id my-project # Project identifier
codeindex -v # Print version
codeindex -h # Print help
# Environment variables
CODEINDEX_WORKSPACE=/path/to/project # Same as --workspace
CODEINDEX_PROJECT_ID=my-project # Same as --project-id
Getting it used
A server that registers without telling an agent when to reach for it stays idle, and an idle index saves nothing however cheap its calls are. The plugin ships three things for that, in the order they act:
- A SessionStart brief. About 240 tokens, once per session, in a repository that holds source files: codeindex is live, and here is the tool for each kind of code question. It lands before the agent has chosen a tool, which is the only moment that can change the first choice.
- A PreToolUse hint. Fires on the 1st, 8th and 25th code question of a
session, when a scan is about to answer something the index answers better,
and names the tool for that exact question. It matches
Bashas well asRead/Grep/Glob, because a permission mode that routes file work through the shell is where most scans actually happen. - The skill, which the model loads when it decides the task calls for it.
Advice loses to habit, so the narrow case where the index is strictly better is
refused rather than argued with: an identifier search that is the whole command
line, in a project that has been indexed before. It never refuses a file read —
the bytes are required before an Edit — never refuses a line that also builds
or tests, and stops refusing after three times in a session, so it can never be
the reason a session cannot proceed.
That is on by default, and it is one switch to turn off — no file to edit by
hand. It is a plugin option, so /plugin shows it as "Refuse a scan the index
answers better" and Claude Code passes your answer to the hook. Outside the
plugin, or for a single session, CODEINDEX_ENFORCE=0 in the environment
overrides the option and CODEINDEX_ENFORCE=1 restores it.
Measure the effect rather than assuming it: python3 plugin/measure_routing.py
counts, per session, how many code questions went to a scan and how many went to
the index, across every Claude Code home on the machine.
Which tree gets indexed
In --mcp mode the working directory belongs to the client, not to you, and it
is regularly not your project: Claude Code launches a plugin's MCP server from
the plugin's own directory and a user-scope server from its config directory. So
the workspace is resolved in this order, and the first usable answer wins:
--workspaceorCODEINDEX_WORKSPACE. An explicit answer is never overridden.CLAUDE_PROJECT_DIR, which Claude Code sets in every MCP server it spawns.- The launch directory, walking up for a
.git,package.json,Cargo.toml,go.mod,build.zigorpyproject.tomlmarker. - The client's MCP
roots. The server asks for them at the handshake whenever the root above was a guess, and adopts one when the guess was refused or lands outside every root the client reports.notifications/roots/list_changedis honoured too, so a directory added with--add-dircan still rescue a session.
status reports the effective root as workspace, and whether a file watcher is
running as watcher. Check them when a result looks empty: an index of the wrong
tree answers every question just as confidently as the right one.
It refuses to index your entire home directory, the filesystem root, or a folder
that merely holds several independent repositories. A refused workspace answers
every query with the reason and the one call that fixes it — index_workspace
with the project path — rather than with "no results".
One daemon serves one project, and every session on that project shares it, so
a daemon never moves to another tree. A session can move instead. An agent that
starts in one checkout and edits another (a second worktree, or a work folder
with a .desk-work marker and no .git) calls index_workspace with that
folder. The session then talks to the daemon of that folder, which starts if
none runs, and the first daemon keeps serving its own tree.
Architecture
- Parser: tree-sitter with 40+ grammars, compiled into a single binary
- Index: trigram index for fuzzy text search + inverted word index for exact identifier lookup
- Dependency graph: file-level import resolution with forward and reverse edges
- Version store: tracks file changes with sequence numbers for incremental updates
- Live watcher: re-indexes on file create/modify/delete (background thread in MCP mode). inotify on Linux; a polling walk on macOS and Windows, which compares mtime and size every couple of seconds.
statusreports which backend is live aswatcher_backend. - Snapshot: persists the full index to
.codeindex.json, so a restart loads the snapshot instead of re-indexing - MCP server: JSON-RPC over stdio, implements the MCP 2024-11-05 protocol
- Workspace daemon: the first session on a repository starts a background
daemon and becomes a relay onto it; later sessions just connect. A Unix-domain
socket on Linux, macOS and Windows 10 1803+, in
$XDG_RUNTIME_DIR/codeindex(or a per-user directory underTMPDIR), named by a hash of the workspace and the binary version — so a rebuilt binary never inherits the previous version's daemon. It exits after 15 minutes with no session attached. Anything that goes wrong falls back to indexing in-process, which is what happened before the daemon existed. Turn it off with--no-daemon.
Platform support
Every row is built by CI and its tests are run on that platform, except where
noted. status reports the live watcher backend so it is never a guess.
| binary | tests run in CI | watcher | install.sh | plugin | |
|---|---|---|---|---|---|
| Linux x86_64 | Yes | Yes | inotify | Yes | Yes |
| Linux aarch64 | Yes | cross-compiled | inotify | Yes | Yes |
| macOS aarch64 | Yes | Yes | polling | Yes | Yes |
| macOS x86_64 | Yes | cross-compiled | polling | Yes | Yes |
| Windows x86_64 | Yes | Yes | polling | needs a shell | see below |
| Windows aarch64 | Yes | cross-compiled | polling | needs a shell | see below |
On Windows, install.sh and the plugin's launcher are shell scripts, so they
need Git Bash, MSYS2 or Cygwin — they detect it and resolve the right .exe
asset. The plugin registers its server through that launcher, so a native
Windows Claude Code without a shell should register the binary directly:
claude mcp add -s user codeindex -- C:\path\to\codeindex.exe --mcp
Nothing here is signed or notarized. On macOS a binary fetched with curl runs
without a Gatekeeper prompt; one downloaded through a browser is quarantined,
and xattr -d com.apple.quarantine codeindex clears it.
Building from source
Requires Zig 0.16.0.
cd zig
./fetch-vendor.sh # Clone tree-sitter + 40 grammar repos
zig build -Doptimize=ReleaseFast
# Binary: zig/zig-out/bin/codeindex
Run tests:
cd zig && zig build test-bin && ./zig-out/bin/test
zig build test routes results through the build runner's IPC protocol on
stdout, which the linked tree-sitter C sources corrupt via their debug printf
paths. Building the test binary and running it directly is the same tests
without that protocol in the way.
How it compares
| codeindex | ast-grep | ctags | LSIF | Sourcegraph | |
|---|---|---|---|---|---|
| MCP-native | Yes | No | No | No | No |
| Token-efficient | Yes (outlines, not full files) | No | Partial | Yes | Yes |
| Single binary | Yes | Yes | Yes | No | No (server) |
| Live watcher | Yes (inotify / polling) | No | No | No | No |
| Dependency graph | Yes | No | No | Yes | Yes |
| Blast radius | Yes (transitive) | No | No | No | Partial |
| Refactor planner | Yes (plan_change) |
No | No | No | No |
| Languages | 40+ | 20+ | 50+ | Varies | Varies |
Pairs with chat-recall
codeindex answers questions about the code in front of you. chat-recall answers questions about the work you already did — it indexes your Claude Code, Gemini CLI, Codex, OpenCode, Antigravity and Cursor sessions into one searchable history and exposes that over MCP too.
Together they cover both halves of what an agent forgets: codeindex stops it re-reading files it could have outlined, and chat-recall stops it redoing work it already finished. chat-recall detects a codeindex binary on your PATH and registers four extra code-intelligence tools when it finds one — neither requires the other.
License
MIT. See LICENSE.
codeindex MCP 질문
codeindex MCP를 Claude Code에 추가하려면 어떻게 하나요?
터미널에서 claude mcp add codeindex -- npx -y @munhq/codeindex를 실행합니다. 모든 프로젝트에서 사용할 수 있게 하려면 --scope user를 추가합니다.
codeindex MCP를 Cursor에 추가하려면 어떻게 하나요?
~/.cursor/mcp.json를 열고 mcpServers 아래에 서버를 추가합니다. 위 설치 섹션에 표시된 Cursor 구성을 사용합니다.
codeindex MCP는 어떤 도구를 제공하나요?
38개 도구를 제공합니다. 예: status, search, find_symbol, find_word, find_callers.
codeindex는 어떤 언어를 지원하나요?
Rust, Python, TypeScript, Go, Zig, C++, Java 등을 포함하여 tree-sitter를 통해 40개 이상의 언어를 지원합니다.
codeindex가 AI 코딩 에이전트에 어떤 도움을 주나요?
에이전트가 전체 파일을 읽는 대신, 단 몇 백 개의 토큰만 사용하여 심볼 개요, 정의, 의존성 체인과 같은 구조적 질문에 답변할 수 있도록 합니다.
Docker를 사용하여 codeindex를 실행할 수 있나요?
네, 워크스페이스를 읽기 전용으로 바인드 마운트하여 Docker를 통해 실행할 수 있습니다.