rpg-encoder MCP server
✓ 인증됨tree-sitter를 사용하여 시맨틱 코드 그래프를 구축하며, 단 한 번의 도구 호출로 AI agent에게 저장소 전체에 대한 깊은 이해를 제공합니다.
다른 이름 userFRM/rpg-encoder
- 스타
- 33
- Tools
- 27
- 다운로드, 30일
- —
- 최신 버전
- 0.6.7
- 마지막 커밋
- 2026년 5월 29일
- 라이선스
- MIT
rpg-encoder MCP란?
rpg-encoder은(는) MCP server입니다. tree-sitter를 사용하여 시맨틱 코드 그래프를 구축하며, 단 한 번의 도구 호출로 AI agent에게 저장소 전체에 대한 깊은 이해를 제공합니다. 27개 도구를 제공합니다. 예: build_rpg, update_rpg, reload_rpg.
프로젝트 README에서 생성된 요약
rpg-encoder MCP server 정보
rpg-encoder는 구조화된 그래프를 통해 AI 코딩 agent에게 전체 코드베이스에 대한 깊은 시맨틱 이해를 제공합니다. 이 server는 grep이나 cat과 같은 기본적인 텍스트 검색에 의존하는 대신, tree-sitter를 사용하여 15가지 언어를 파싱하고 클래스, 메서드, 함수와 같은 기능적 엔티티를 추출합니다. 단순히 파일 구조에 의존하는 것이 아니라 코드가 실제로 수행하는 동작을 기반으로 계층 구조를 구축합니다.
개발자는 단 한 번의 npx 명령으로 Claude Code, Cursor 또는 Windsurf와 같은 MCP 호환 클라이언트에 이 server를 통합할 수 있습니다. 시스템은 로컬에서 작동하며, LLM이 각 엔티티에 의도 수준의 기능을 추가하는 lifting 프로세스를 통해 기능을 강화할 수 있습니다. 대규모 저장소의 경우, Anthropic 또는 OpenAI와 같은 provider의 외부 API key를 사용하는 자율 lifting 모드를 통해 기본 agent 토큰을 소모하지 않고 엔티티를 효율적으로 처리할 수 있습니다.
그래프가 구축되면 semantic_snapshot 도구를 통해 agent가 복잡한 소스 코드를 관리 가능한 토큰 수로 압축하여 단 한 번의 호출로 저장소 전체를 파악할 수 있습니다. 이를 통해 프로젝트 아키텍처 전반에 걸쳐 더 스마트한 계획 수립, 영향 분석 및 탐색이 가능해집니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
rpg-encoder MCP 설치 방법
형식 확인: 2026년 11월 10일Cursor에 추가Goose에 추가Claude Code에 rpg-encoder MCP 설치
$ claude mcp add rpg-encoder -- npx -y rpg-encoderCursor에 rpg-encoder MCP 설치
~/.cursor/mcp.json
{
"mcpServers": {
"rpg-encoder": {
"command": "npx",
"args": [
"-y",
"rpg-encoder"
]
}
}
}VS Code에 rpg-encoder MCP 설치
.vscode/mcp.json
{
"servers": {
"rpg-encoder": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"rpg-encoder"
]
}
}
}VS Code CLI에 rpg-encoder MCP 설치
$ code --add-mcp '{"name":"rpg-encoder","type":"stdio","command":"npx","args":["-y","rpg-encoder"]}'Claude Desktop에 rpg-encoder MCP 설치
claude_desktop_config.json
{
"mcpServers": {
"rpg-encoder": {
"command": "npx",
"args": [
"-y",
"rpg-encoder"
]
}
}
}Codex에 rpg-encoder MCP 설치
$ codex mcp add rpg-encoder -- npx -y rpg-encoderCodex config.toml에 rpg-encoder MCP 설치
~/.codex/config.toml
[mcp_servers.rpg-encoder] command = "npx" args = ["-y", "rpg-encoder"]
Gemini CLI에 rpg-encoder MCP 설치
$ gemini mcp add -s user rpg-encoder npx -- -y rpg-encoderGemini settings.json에 rpg-encoder MCP 설치
~/.gemini/settings.json
{
"mcpServers": {
"rpg-encoder": {
"command": "npx",
"args": [
"-y",
"rpg-encoder"
]
}
}
}rpg-encoder MCP 도구 27
README에서 감지됨build_rpgupdate_rpgreload_rpgrpg_infosemantic_snapshotsearch_nodefetch_nodeexplore_rpgcontext_packimpact_radiusplan_changefind_paths
| build_rpg | — | |
| update_rpg | — | |
| reload_rpg | — | |
| rpg_info | — | |
| semantic_snapshot | — | |
| search_node | — | |
| fetch_node | — | |
| explore_rpg | — | |
| context_pack | — | |
| impact_radius | — | |
| plan_change | — | |
| find_paths | — |
도구 27개 모두 보기도구 수 줄이기
slice_betweenanalyze_healthdetect_cyclesreconstruct_planauto_liftlifting_statusget_entities_for_liftingsubmit_lift_resultsfinalize_liftingget_files_for_synthesissubmit_file_synthesesbuild_semantic_hierarchysubmit_hierarchyget_routing_candidatessubmit_routing_decisions
| slice_between | — | |
| analyze_health | — | |
| detect_cycles | — | |
| reconstruct_plan | — | |
| auto_lift | — | |
| lifting_status | — | |
| get_entities_for_lifting | — | |
| submit_lift_results | — | |
| finalize_lifting | — | |
| get_files_for_synthesis | — | |
| submit_file_syntheses | — | |
| build_semantic_hierarchy | — | |
| submit_hierarchy | — | |
| get_routing_candidates | — | |
| submit_routing_decisions | — |
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →자동 검사를 통과했습니다. 이는 보안 감사가 아닙니다. 코드를 직접 읽고 서버에 필요한 최소한의 권한만 부여하십시오. 검사 방식
- 소스 저장소 연결 및 접근 가능userfrm/rpg-encoder is public and reachablegithub.com/userfrm/rpg-encoder ↗통과
- 패키지가 이 저장소를 소스로 명시rpg-encoder names userfrm/rpg-encoder as sourcenpmjs.com/package/rpg-encoder ↗통과
- 빌드 출처(Sigstore 증명)Sigstore attestation for rpg-encodernpmjs.com/package/rpg-encoder/v/0.6.7#provenance ↗통과
- 오픈 소스 라이선스 (OSI)MITspdx.org/licenses/MIT.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-05-29github.com/userfrm/rpg-encoder ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음No popular package one edit away from rpg-encoder통과
- 패키지 및 해당 종속성에 중요한 보안 권고 없음1 resolved dependencies checked; no critical advisoryosv.dev ↗통과
- 모델에 대한 숨겨진 지침 없음27 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨No tool named like delete, drop or exec통과
- 원격 엔드포인트가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기AI coding agents waste most of their tool calls fumbling through your codebase with grep, cat, find, and file reads. rpg-encoder fixes that. It builds a semantic graph of your code with Tree-sitter — not just what calls what, but what every function does — and gives your AI assistant whole-repo understanding via MCP in a single tool call.
Quick Start
claude mcp add rpg -- npx -y -p rpg-encoder rpg-mcp-server
One command. Works with Claude Code, Cursor, opencode, Windsurf, or any MCP-compatible agent. No Rust toolchain, no cloning, no building — npx downloads a pre-built binary for your platform.
Then open any repo and tell your agent:
"Build and lift the RPG for this repo"
Your agent handles everything: indexes entities (seconds), reads each function and adds intent-level features (a few minutes), organizes them into a semantic hierarchy, and commits .rpg/graph.json for your team.
For repos with ~100+ entities, lifting_status will tell your agent to delegate the lifting loop to a sub-agent or a cheaper model — feature extraction is pattern-matching, not novel reasoning. If your runtime has no sub-agent mechanism, run rpg-encoder lift --provider anthropic|openai from the terminal with an API key — the CLI drives an external LLM directly with no agent involvement. After the CLI finishes, call reload_rpg in your session to load the updated graph. The CLI lifts entities with no features; re-lifting stale entities (features present but outdated after code changes) is handled by the in-session MCP flow, not the CLI.
Once lifted, try:
- "What handles authentication?" — finds code even when nothing is named "auth"
- "Show everything that depends on the database connection"
- "Plan a change to add rate limiting to API endpoints"
Use RPG before grep, cat, find
The server instructions tell your agent to reach for RPG tools FIRST for any
question about code structure or behavior. That reflex matters — grep, cat,
and ad-hoc file reads burn tokens and miss semantic relationships RPG already
knows.
| If you'd otherwise reach for... | Use this instead |
|---|---|
grep -r / rg (by intent) |
search_node(query="...") |
grep -r / rg (by name) |
search_node(query="...", mode="snippets") |
cat / reading a function |
fetch_node(entity_id="file:name") |
| chained greps for callers/callees | explore_rpg(entity_id="...", direction="...") |
| recursive grep for "what depends on X" | impact_radius(entity_id="...") |
wc -l / find / tree |
rpg_info |
| reading many files for context | semantic_snapshot |
| manual search → fetch → explore chains | context_pack(query="...") |
| "how do I refactor X safely" | plan_change(goal="...") |
Fall back to grep, cat, or file reads only when the query is about literal text
(string search, comments, TODOs, log messages) — not about structure.
How It Works
- Parse — Tree-sitter extracts entities (functions, classes, methods) and dependency edges (imports, calls, inheritance) from 15 languages.
- Lift — An LLM (your agent, or a cheap API like Haiku) reads each entity and writes verb-object features: "validate JWT tokens", "serialize config to disk".
- Organize — Features cluster into a 3-level semantic hierarchy (Area → Category → Subcategory) that emerges from what the code does, not the file tree.
- Understand —
semantic_snapshotcompresses the whole graph into ~25K tokens. Your LLM reads it once and knows the repo.
The semantic snapshot
Instead of grepping through files, the LLM calls semantic_snapshot once and receives:
- Hierarchy — every functional area with aggregate features
- Entities — every function, class, method grouped by area, with its semantic features
- Dependency skeleton — condensed call graph with qualified names
- Hot spots — top 10 most-connected entities (the architectural backbone)
~25K tokens covers ~1000 entities. That's 2-3% of a 1M context window — the LLM starts every session already knowing your repo.
Self-maintaining graph
Whenever your working tree changes — committed, staged, or unstaged — the MCP server automatically re-syncs before responding to the next query. A changeset hash over (path, size, mtime) means repeated saves of the same file trigger one sync, and idle queries trigger none. Reverts are detected too: if a previously-dirty file returns to its HEAD state, the graph is restored.
Two ways to lift
| Mode | Command | Cost | Who pays |
|---|---|---|---|
| Agent lifting | "Build and lift the RPG" | Subscription tokens | Your Claude Code / Cursor subscription |
| Autonomous lifting | auto_lift(provider="anthropic", api_key_env="ANTHROPIC_API_KEY") |
~$0.02 per 100 entities | External API key (Haiku, GPT-4o-mini, OpenRouter, Gemini) |
auto_lift calls a cheap external LLM directly — your coding subscription never touches the lifting work. Use api_key_env to resolve keys from environment variables so they never appear in tool call transcripts.
Architecture
Seven Rust crates, one MCP server binary, one CLI binary:
| Crate | Role |
|---|---|
rpg-core |
Graph types (RPGraph, Entity, HierarchyNode), storage, LCA algorithm |
rpg-parser |
Tree-sitter entity + dependency extraction (15 languages) |
rpg-encoder |
Encoding pipeline, lifting utilities, incremental evolution |
rpg-nav |
Search, fetch, explore, snapshot, TOON serialization |
rpg-lift |
Autonomous LLM lifting (Anthropic, OpenAI, OpenRouter, Gemini) |
rpg-cli |
CLI binary (rpg-encoder) |
rpg-mcp |
MCP server binary (rpg-mcp-server) with 27 tools |
MCP Tools (27)
| Tool | Description |
|---|---|
build_rpg |
Index the codebase (run once, instant) |
update_rpg |
Incremental update from git changes |
reload_rpg |
Reload graph from disk after external changes |
rpg_info |
Graph statistics, hierarchy overview, per-area lifting coverage |
| Tool | Description |
|---|---|
semantic_snapshot |
Whole-repo semantic understanding in one call (~25K tokens for 1000 entities) |
search_node |
Search entities by intent or keywords (hybrid embedding + lexical scoring) |
fetch_node |
Get entity metadata, source code, dependencies, and hierarchy context |
explore_rpg |
Traverse dependency graph (upstream, downstream, or both) |
context_pack |
Single-call search + fetch + explore with token budget |
| Tool | Description |
|---|---|
impact_radius |
BFS reachability analysis — "what depends on X?" |
plan_change |
Change planning — find relevant entities, modification order, blast radius |
find_paths |
K-shortest dependency paths between two entities |
slice_between |
Extract minimal connecting subgraph between entities |
analyze_health |
Code health: coupling, instability, god objects, clone detection |
detect_cycles |
Find circular dependencies and architectural cycles |
reconstruct_plan |
Dependency-safe reconstruction execution plan |
| Tool | Description |
|---|---|
auto_lift |
One-call autonomous lifting via cheap LLM API (Haiku, GPT-4o-mini, OpenRouter, Gemini) |
lifting_status |
Dashboard — coverage, per-area progress, NEXT STEP |
get_entities_for_lifting |
Get entity source code for your agent to analyze |
submit_lift_results |
Submit the agent's semantic features back to the graph |
finalize_lifting |
Aggregate file-level features, rebuild hierarchy metadata |
get_files_for_synthesis |
Get file-level entity features for holistic synthesis |
submit_file_syntheses |
Submit holistic file-level summaries |
build_semantic_hierarchy |
Get domain discovery + hierarchy assignment prompts |
submit_hierarchy |
Apply hierarchy assignments to the graph |
get_routing_candidates |
Get entities needing semantic routing (drifted or newly lifted) |
submit_routing_decisions |
Submit routing decisions (hierarchy path or "keep") |
Supported Languages
15 languages via Tree-sitter:
| Language | Entity Extraction | Dependency Resolution |
|---|---|---|
| Python | Functions, classes, methods | imports, calls, inheritance |
| Rust | Functions, structs, traits, impl methods | use, calls, trait impls |
| TypeScript | Functions, classes, methods, interfaces | imports, calls, inheritance |
| JavaScript | Functions, classes, methods | imports, calls, inheritance |
| Go | Functions, structs, methods, interfaces | imports, calls |
| Java | Classes, methods, interfaces | imports, calls, inheritance |
| C / C++ | Functions, classes, methods, structs | includes, calls, inheritance |
| C# | Classes, methods, interfaces | using, calls, inheritance |
| PHP | Functions, classes, methods | use, calls, inheritance |
| Ruby | Classes, methods, modules | require, calls, inheritance |
| Kotlin | Functions, classes, methods | imports, calls, inheritance |
| Swift | Functions, classes, structs, protocols | imports, calls, inheritance |
| Scala | Functions, classes, objects, traits | imports, calls, inheritance |
| Bash | Functions | source, calls |
Install
MCP server (recommended)
# Claude Code
claude mcp add rpg -- npx -y -p rpg-encoder rpg-mcp-server
# Cursor — add to ~/.cursor/mcp.json
{
"mcpServers": {
"rpg": {
"command": "npx",
"args": ["-y", "-p", "rpg-encoder", "rpg-mcp-server"]
}
}
}
The server auto-detects the project root from the current working directory — no path argument needed.
npm install -g rpg-encoder
# Build a graph
rpg-encoder build
# Query
rpg-encoder search "parse entities from source code"
rpg-encoder fetch "src/parser.rs:extract_entities"
rpg-encoder explore "src/parser.rs:extract_entities" --direction both --depth 2
rpg-encoder info
# Autonomous lifting via API
rpg-encoder lift --provider anthropic --dry-run # estimate cost
rpg-encoder lift --provider anthropic # lift with Haiku (~$0.02/100 entities)
# Incremental update
rpg-encoder update
# Pre-commit hook (auto-updates graph on commit)
rpg-encoder hook install
git clone https://github.com/userFRM/rpg-encoder.git
cd rpg-encoder && cargo build --release
Then point your MCP config at target/release/rpg-mcp-server.
Documentation
- How RPG Compares — honest comparison with GitNexus, Serena, Repomix, and others
- Paper Fidelity — algorithm-by-algorithm comparison with the research paper
- Use Cases — practical examples of what RPG enables
- CHANGELOG — release history
Inspirations & References
rpg-encoder is built on the theoretical framework from the RPG-Encoder research paper, with original extensions inspired by tools across the code intelligence landscape:
- RPG-Encoder paper (Luo et al., 2026, Microsoft Research) — semantic lifting model, 3-level hierarchy construction, incremental evolution algorithms, formal graph model
G = (V_H ∪ V_L, E_dep ∪ E_feature). - GitNexus — precomputed relational intelligence, blast radius analysis, Claude Code hooks. Showed that a code graph tool must be invisible to be essential.
- Serena — symbol-level precision via LSP. Demonstrated that real-time code awareness matters more than batch analysis.
- TOON — Token-Oriented Object Notation for LLM-optimized output.
This is an independent implementation. All code is original work under the MIT license. Not affiliated with or endorsed by Microsoft.
License
rpg-encoder MCP 질문
rpg-encoder MCP를 Claude Code에 추가하려면 어떻게 하나요?
터미널에서 claude mcp add rpg-encoder -- npx -y rpg-encoder를 실행합니다. 모든 프로젝트에서 사용할 수 있게 하려면 --scope user를 추가합니다.
rpg-encoder MCP를 Cursor에 추가하려면 어떻게 하나요?
~/.cursor/mcp.json를 열고 mcpServers 아래에 서버를 추가합니다. 위 설치 섹션에 표시된 Cursor 구성을 사용합니다.
rpg-encoder MCP는 어떤 도구를 제공하나요?
27개 도구를 제공합니다. 예: build_rpg, update_rpg, reload_rpg, rpg_info, semantic_snapshot.
rpg-encoder가 AI 코딩 agent를 어떻게 돕나요?
grep이나 cat과 같은 비효율적인 파일 검색을 시맨틱 그래프로 대체하여, agent가 단 한 번의 스냅샷만으로 함수의 의도와 저장소 구조를 이해할 수 있게 합니다.
agent의 토큰을 사용하지 않고 lifting 프로세스를 실행할 수 있나요?
CLI를 사용하여 Anthropic 또는 OpenAI와 같은 저렴한 외부 LLM provider의 API key를 통해 자율적인 lifting을 실행할 수 있습니다.
코드 변경 사항에 따라 그래프가 최신 상태로 유지되나요?
네, 파일이 commit, stage 또는 unstage되는 등 working tree가 변경될 때마다 MCP server가 그래프를 자동으로 다시 동기화합니다.