trngtien/vfs 是一个从 https://github.com/trngtien/vfs. 导入的 MCP 服务器候选
概览
trngtien/vfs 是一个从 https://github.com/trngtien/vfs. 导入的 MCP 服务器候选
概述(AI 翻译)
**提取导出的函数签名,去除主体——在每次代码搜索中,AI代理读取的token数占60-70%。
安装 • 快速启动 • 命令 • AI工具设置 • 支持语言 • 安全与隐私
vfs 通过 AST 和 tree-sitter 解析源文件,只返回导出签名——这是任何代码库的紧凑“目录”。一个命令(或一个 MCP 调用)用精确的 file:line 指针替换 grep-and-read-所有内容。单 Go 二进制,零网络访问,适用于任何 AI 工具。
VFS的工作
| 代替 | VFS 返回 |
|---|---|
grep -r "HandleLogin" . → 345行匹配 |
21条签名行 |
| 读取7,979行以找到一个函数 | auth.go:23: func HandleLogin(w http.ResponseWriter, r *http.Request) |
| ~48,757个上下文标记 | ~570个标记 |
储蓄的运作方式
VFS测量到达模型的源字节**,估计为bytes / 4。解析时会剥离实体,因此耗费50行上下文的函数耗费一行。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
vfs
Extract exported function signatures with bodies stripped – cutting 60-70% of the tokens your AI agent reads on every code search.
Install • Quick Start • Commands • Setup for AI Tools • Supported Languages • Security & Privacy
vfs parses source files via AST and tree-sitter and returns only exported signatures – a compact “table of contents” of any codebase. One command (or one MCP call) replaces grep-and-read-everything with exact file:line pointers. Single Go binary, zero network access, works with any AI tool.
What VFS Does
| Instead of | vfs returns |
|---|---|
grep -r "HandleLogin" . → 345 lines of matches |
21 signature lines |
| Reading 7,979 lines to find one function | auth.go:23: func HandleLogin(w http.ResponseWriter, r *http.Request) |
| ~48,757 tokens of context | ~570 tokens |
How Savings Work
vfs measures bytes of source that reach the model, estimated as bytes / 4. Bodies are stripped at parse time, so a function that costs 50 lines of context costs one line. The savings are real but the absolute token numbers are approximate – vfs ships no tokenizer.
On this repository (vfs bench --self, pattern "Extract"):
| Read all files | grep | vfs | |
|---|---|---|---|
| Output size | 190.5 KB | 47.5 KB | 2.2 KB |
| Lines | 7,979 | 345 | 21 |
| Est. tokens | 48,757 | 12,154 | 570 |
- 98.8% fewer tokens vs reading all files (48,757 → 570)
- 95.3% fewer tokens vs grep (12,154 → 570)
These are reductions in context tokens, not in your bill – but for a tool your agent runs on every search, they add up fast.
Installation
Pre-built binary (Linux – nothing else needed)
# x86_64
curl -L https://github.com/TrNgTien/vfs/releases/latest/download/vfs-linux-amd64.tar.gz | tar xz
sudo mv vfs /usr/local/bin/
# ARM64
curl -L https://github.com/TrNgTien/vfs/releases/latest/download/vfs-linux-arm64.tar.gz | tar xz
sudo mv vfs /usr/local/bin/
Build from source (macOS / Linux / Windows)
安装
docker run --rm -v $(pwd):/workspace -p 8080:8080 -p 3000:3000 vfs-mcp配置
{
"mcpServers": {
"vfs": {
"command": "vfs",
"args": ["mcp"]
}
}
}