
MCP服务器,能让AI编码代理理解任何代码库的语义。按意图搜索,编辑自动同步,一次调用即可获得整个仓库上下文。Rust + 树状,15种语言,28个工具。
概览
给你的AI代理一个代码库的大脑。 AI编码代理大部分工具调用都浪费在代码库中笨拙地处理grep、cat、find和文件读取。RPG-Encoder解决了这个问题。它用Tree-sitter构建了你的代码——不仅是调用了什么,还包括每个函数的功能——并通过MCP在一个工具调用中让AI助手理解整个仓库。 一个命令。支持Claude代码、光标、opencode、Windsurf或任何兼容MCP的代理。无需Rust工具链,无需克隆,无需构建——npx会为你的平台下载预构建的二进制文件。 你的代理负责一切:索引实体(秒数),读取每个函数并添加意图层特征(几分钟),将它们组织成语义层级,并为团队提交 .rpg/graph.json。 对于具有~100+实体的仓库,lifting_status会告诉你的代理将提升环路委托给子代理或更便宜的模型——特征提取是模式匹配,而非新颖推理。
概述(AI 翻译)
RPG编码器
给你的AI代理一个代码库的大脑。
AI编码代理大部分工具调用都浪费在你代码库中摸索grep、cat、find,然后读取文件。rpg-encoder解决了这个问题。它用Tree-sitter构建了你的代码语义图——不仅仅是调用什么,而是每个函数的作用——并通过MCP在一次工具调用中让AI助手理解整个仓库。
快速启动
一个命令。支持Claude代码、光标、opencode、Windsurf或任何兼容MCP的代理。不使用Rust工具链,不克隆,不构建——npx下载了为你平台预构建的二进制文件。
然后打开任何一个仓库,告诉你的客服:
“为这个仓库建造并提升RPG”
你的代理处理所有事情:索引实体(秒数),读取每个函数并添加意图层特征(几分钟),将它们组织成语义层级,并为团队提交.rpg/graph.json。
对于具有~100+实体的仓库,lifting_status 会告诉你的代理将提升环路委托给子代理或更便宜的模型——特征提取是模式匹配,而非新颖推理。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
rpg-encoder
Give your AI agent a brain for your codebase.
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:
安装
npx -y -p rpg-encoder rpg-mcp-server配置
# 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"]
}
}
}