PGR 是一个实验性的无状态 MCP 代码搜索服务器,用于研究排名、延迟和输出塑造如何影响智能搜索。
概览
PGR是一个实验性的无状态代码搜索MCP服务器,旨在研究编码代理如何搜索代码库。 它是一个可运行的原型和公共研究成果,而非精致产品。 它将本地代码搜索包裹在为代理工作流程设计的排序和输出整形中:提前显示可能的实现文件,降低测试和低价值匹配的优先级,并格式化结果,使模型能更少频繁地决定下一步阅读内容。 该仓库还包含了公开数据集、基准测试包以及用于附带智能代码搜索文章的保存结果。 然后添加到任何能启动 stdio 服务器的 MCP 客户端中: 将cwd设置为你希望代理搜索的仓库。PGR搜索启动该进程当前的工作目录。 配置好后,请你的代理搜索仓库。例如: 如果安装后 pgr 还没有在你的 shell PATH 上,请直接在:
概述(AI 翻译)
pgr 是一个实验性的无状态 MCP 代码搜索服务器,作为
研究编码代理如何搜索仓库。
它是一个可运行的原型和公共研究成果,而非精致产品。
它将本地代码搜索包裹起来,并结合了为代理设计的排名和输出整形 工作流程:更早展示可能的实现文件,降低测试优先级 以及低价值匹配和格式化结果,以便模型决定阅读内容 接下来是少些挣扎的。
该仓库还包括公开数据集、基准测试包和已保存的资料 结果用于附带的智能码搜索文章。
- 快速入门
- 使用文档
- 公开基准与数据
- 贡献指南
- 安全政策
- 许可证
快速启动
1.安装 PGR
从此仓库安装 pgr
2.添加到你的MCP客户端中
然后添加到任何能启动 stdio 服务器的 MCP 客户端中:
3.指向仓库进行搜索
将cwd设置为你希望代理搜索的仓库。pgr 搜索
启动该进程的当前工作目录。
4.让你的经纪人帮忙搜索
配置好后,请你的代理搜索仓库。例如:
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
pgr
pgr is an experimental, stateless MCP server for code search, built as part of
research into how coding agents search repositories.
It is a working prototype and public research artifact, not a polished product.
It wraps local code search with ranking and output shaping designed for agent workflows: surfacing likely implementation files earlier, de-prioritizing tests and low-value matches, and formatting results so a model can decide what to read next with less thrashing.
This repository also includes the public datasets, benchmark packages, and saved results used in the accompanying writeup on agentic code search.
- Quick Start
- Usage Documentation
- Public Benchmarks and Data
- Contributing guide
- Security policy
- License
Quick Start
1. Install pgr
Install pgr from this repository:
git clone https://github.com/entireio/pgr.git
cd pgr
cargo install --path .
2. Add it to your MCP client
Then add it to any MCP client that can launch a stdio server:
{
"mcpServers": {
"pgr": {
"command": "pgr",
"cwd": "/absolute/path/to/repo"
}
}
}
3. Point it at the repo to search
Set cwd to the repository you want your agent to search. pgr searches the
current working directory of the process that launches it.
4. Ask your agent to search
Once configured, ask your agent to search the repo. For example:
search for where checkpoint commits are written
find the code that handles MCP tool calls
If pgr is not yet on your shell PATH after install, use the binary directly
at:
~/.cargo/bin/pgr
What pgr gives agents
pgr is not trying to replace ripgrep. It shells out to local rg for fast
content search and file listing, then ranks and shapes the results for coding
agents.
That means an agent is more likely to see implementation files before test noise, repeated references, or lower-signal matches.
At a high level it provides tools for:
search_coderead_codefind_fileslist_dir
The search output profile is controlled with PGR_OUTPUT_PROFILE. If it is
unset, the server defaults to the richer planner-oriented output profile used in
the public results.
There is no index to build, no background daemon, and no separate storage layer.
pgr starts, answers MCP tool calls over stdio, and exits when the client stops
it.
Build from source
cargo build --release
The binary will be available at target/release/pgr.
If you want the binary on your PATH, you can also install it locally with:
cargo install --path .
For most first-time users, this is the easiest way to try pgr.
Requirements
- Rust toolchain for building from source
ripgrepinstalled and available as
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"pgr": {
"command": "pgr",
"cwd": "/absolute/path/to/repo"
}
}
}