شعار Vfs

Vfs

المجتمع
TrNgTien

Reduce AI agent token usage by 98% via Virtual Function Signatures. MCP server for Cursor & Claude Desktop. Supports Go, TypeScript, Python, Rust, Java, Swift, Kotlin, C# and more.

الناشرTrNgTien
المستودعvfs
اللغةC
التفريعات
26
النجوم
143
الأدوات المتاحة
0
نوع نقل البياناتstdio, streamable-http
الفئات
الترخيصMIT
الروابط
  • اربط الأدوات بسير عمل الذكاء الاصطناعي

    يتيح Vfs إمكانات MCP التي يمكن لتطبيقات الذكاء الاصطناعي العميلة ووكلاء الذكاء الاصطناعي المتوافقة استخدامها.

  • الأدوات المتاحة: 0

    تصفّح الإجراءات القابلة للاستدعاء أدناه، بما في ذلك أسماؤها وأوصافها عندما يوفّرها الخادم.

  • إعدادات جاهزة للنسخ

    استخدم أمثلة إعداد التثبيت لتهيئة هذا الخادم في تطبيق MCP العميل المفضّل لديك.

  • مؤشرات الاهتمام بالمصدر المفتوح

    النجوم: 143، والنسخ المتفرعة: 26 في المستودع المرتبط.

vfs

Extract exported function signatures with bodies stripped -- cutting 60-70% of the tokens your AI agent reads on every code search.

CI Release License: MIT

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 ofvfs returns
grep -r "HandleLogin" . → 345 lines of matches21 signature lines
Reading 7,979 lines to find one functionauth.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 filesgrepvfs
Output size190.5 KB47.5 KB2.2 KB
Lines7,97934521
Est. tokens48,75712,154570
  • 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)

bash
# 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)

Requires Go 1.24+ and a C compiler (tree-sitter C bindings):

OSCommand
macOSxcode-select --install
Linux (Debian/Ubuntu)sudo apt install build-essential
Linux (Fedora/RHEL)sudo yum groupinstall "Development Tools"
WindowsInstall TDM-GCC (easiest) or MSYS2 + MinGW-w64
bash
git clone https://github.com/TrNgTien/vfs.git && cd vfs
go install ./cmd/vfs

vfs: command not found after install? Add Go's bin to PATH: export PATH="$PATH:$(go env GOPATH)/bin" (macOS/Linux) or add %USERPROFILE%\go\bin to PATH (Windows).

Docker (any OS)

bash
docker build -t vfs-mcp .
docker run --rm -v $(pwd):/workspace -p 8080:8080 -p 3000:3000 vfs-mcp

# Custom ports via environment variables
docker run --rm -v $(pwd):/workspace -e VFS_PORT=9090 -e VFS_DASHBOARD_PORT=4000 -p 9090:9090 -p 4000:4000 vfs-mcp

Verify Installation

bash
vfs . -f HandleLogin   # Should show signatures, not an error
vfs bench --self       # Should show the savings table

Quick Start

bash
# Find a function by name (case-insensitive)
vfs . -f HandleLogin

# List all signatures in a directory or file
vfs ./internal ./pkg
vfs server.go

# Show token savings after output
vfs . -f auth --stats

# Start the MCP server + dashboard (detached)
vfs up
# Check / stop it
vfs status
vfs down

Then open the dashboard at http://localhost:3000 for usage stats over time.

How It Works

  Without vfs:                                    With vfs:

  Agent  --grep "HandleLogin"-->  shell          Agent  --vfs search-->  vfs (AST)
    ^                                |             ^                          |
    |        345 lines of matches    |             |   2 sigs, ~570 tokens     |
    +--------------------------------+             +--- file:line + signature -+

Four properties make the savings work:

  1. AST parsing - understands structure, not just text. Finds class User, type User struct, func (u *User) Login, not just string matches.
  2. Bodies stripped - you get the signature, not the 50 lines underneath it.
  3. Case-insensitive filter - one search finds fare, Fare, and FARE.
  4. Token accounting - every invocation is measured and reported (--stats, vfs stats, dashboard).

The companion rule in this repo (.cursor/rules/vfs-agent-search.mdc) teaches agents when to use vfs (locate/understand/modify) vs grep (debug, string literals, callers) -- see Setup for AI Tools.

Commands

Search

bash
vfs .                        # All exported signatures (recursive)
vfs ./src ./lib              # Multiple directories
vfs handler.go               # Single file
vfs . -f auth                # Case-insensitive filter
vfs . -f auth --stats        # + token savings report
vfs . -f auth --no-record    # Skip history logging

Benchmarks

bash
vfs bench --self                            # Self-test on vfs source
vfs bench -f HandleLogin /path/to/project    # Benchmark any project
vfs bench -f Login /path --show-output       # Show actual grep/vfs output

Statistics

bash
vfs stats                   # Lifetime token savings
vfs stats --json            # JSON export for dashboards/CI
vfs stats --reset           # Clear all history

MCP Server

bash
vfs mcp                     # stdio transport (default, editor integration)
vfs mcp --http :8080        # HTTP transport (Docker / remote)
vfs serve                   # MCP + dashboard, foreground
vfs serve --port 9090 --dashboard-port 4000   # custom ports
vfs up                      # Same, detached (background)
vfs status                  # Is it running? show endpoints
vfs down                    # Stop the detached server
vfs dashboard               # Dashboard UI only

MCP tools exposed: search, extract, list_languages.

Global Flags

FlagDescription
-f, --filterCase-insensitive substring filter on signature names
--statsPrint token savings (raw vs vfs) to stderr
--no-recordSkip logging this invocation to ~/.vfs/history.jsonl
--versionShow version, commit, and build date

Examples

"Where is the login handler?"

# Without vfs: grep + read
grep -r "HandleLogin" .            # 345 lines of matches
cat auth.go                        # then read the whole file

# With vfs
vfs . -f login
  → internal/handlers/auth.go:23:   func HandleLogin(w http.ResponseWriter, r *http.Request)
  → internal/services/auth.go:10:   func ValidateToken(token string) (*Claims, error)
  → internal/middleware/jwt.go:45:  func RequireLogin(next http.Handler) http.Handler

Multi-language project:

vfs . -f user
  → internal/services/user.go:42:     func CreateUser(name string, email string) (*User, error)
  → src/hooks/useUser.ts:8:           export function useUser(id: string): UserState
  → app/models/user.py:15:            class User(BaseModel)
  → src/api/UserService.java:22:      public class UserService
  → contracts/UserRegistry.sol:10:    contract UserRegistry is Ownable { ... }

When grep IS the right tool -- vfs finds definitions, not bodies, callers, or config keys:

grep "INVALID_API_KEY" ./internal/     # string literal inside a function body
grep "database_url" ./*.yaml           # non-code file
grep "CalculateFare" ./internal/       # who CALLS it (vfs finds the definition)

Setup for AI Tools

Two steps -- both required:

  1. Connect vfs -- make it reachable from the agent (MCP preferred, CLI fallback).
  2. Add an agent rule -- tell the agent it should call vfs before grep. Without the rule, the agent ignores vfs even when installed.

Step 1: Connect vfs

MethodHow it worksBest for
MCP (recommended)Agent calls search / extract / list_languages directlyEditors with MCP support (most modern AI tools)
CLIAgent runs vfs <path> -f <pattern> via shellTerminal tools, scripts, sandboxed-free environments

Stdio config (Cursor, Claude Code, Claude Desktop, Antigravity, Windsurf, Cline):

json
{
  "mcpServers": {
    "vfs": {
      "command": "vfs",
      "args": ["mcp"]
    }
  }
}

Claude Code (preferred): claude mcp add vfs -- vfs mcp -- registers in ~/.claude.json.

Continue:

json
{
  "experimental": {
    "modelContextProtocolServers": [
      { "transport": { "type": "stdio", "command": "vfs", "args": ["mcp"] } }
    ]
  }
}

Zed:

json
{
  "context_servers": {
    "vfs": { "command": { "path": "vfs", "args": ["mcp"] } }
  }
}

HTTP config (Docker, remote, or tools that prefer HTTP):

bash
vfs up        # MCP on :8080, dashboard on :3000
vfs up --port 9090
json
{
  "mcpServers": { "vfs": { "url": "http://localhost:8080/mcp" } }
}

Step 2: Add an agent rule (required)

Installing vfs is not enough -- agents don't know it exists. This repo ships a production-ready rule at .cursor/rules/vfs-agent-search.mdc, and a one-command installer to put it into your tool:

bash
./scripts/install-rules.sh                   # auto-detect your AI tool
./scripts/install-rules.sh --agent cursor    # install for one tool
./scripts/install-rules.sh --agent all       # every tool
./scripts/install-rules.sh --project ../myapp --agent claude   # another project
./scripts/install-rules.sh --list            # supported tools + paths

Same via Make: make rules or make rules RULES_ARGS="--agent windsurf --project ../myapp".

The installer is idempotent and safe: plain-markdown tools (Claude Code, Cline, Aider, Antigravity) get the rule appended under a ## vfs: heading -- your existing config is never overwritten -- while frontmatter tools (Cursor, Windsurf, Continue, OpenCode) get a verbatim copy.

ToolRule fileNotes
Cursor.cursor/rules/vfs.mdcCopy of .mdc (frontmatter kept)
Claude CodeCLAUDE.mdAppended, frontmatter stripped
AntigravityGEMINI.mdAppended, frontmatter stripped; also reads AGENTS.md
Windsurf.windsurf/rules/vfs.mdCopy of .mdc
Cline / Roo Code.clinerulesAppended, frontmatter stripped
Continue.continue/rules/vfs.mdCopy of .mdc
Aider.aider.conventions.mdAppended, frontmatter stripped
OpenCode.opencode/rules/vfs.mdcCopy of .mdc

Without the rule, this is what happens:

You: "Where is the login handler?"

❌ No rule:   Agent greps + reads → 345 lines → 12,000+ tokens
✅ With rule: Agent calls vfs → reads 23 lines → ~570 tokens

Supported Languages

LanguageExtensionsParser
Go.gogo/ast
JavaScript.js, .mjs, .cjs, .jsxtree-sitter
TypeScript.ts, .mts, .cts, .tsxtree-sitter
Python.pytree-sitter
Rust.rstree-sitter
Java.javatree-sitter
C#.cstree-sitter
Dart.darttree-sitter
Kotlin.kt, .ktstree-sitter
Swift.swifttree-sitter
Ruby.rbtree-sitter
Solidity.soltree-sitter
HCL / Terraform.tf, .hcltree-sitter
DockerfileDockerfile, Dockerfile.*line-based
Protobuf.protoline-based
SQL.sqlline-based
YAML.yml, .yamlline-based

Security & Privacy

vfs is local-only and offline.

PropertyDetail
Zero network accessAll parsing is local. No outbound connections, ever
No secrets exposureDoes not read or store API keys, credentials, or environment variables
No data collectionNo telemetry, no analytics, no tracking
No code storageSource is parsed in memory and discarded. Only ~/.vfs/history.jsonl (scan statistics) is written

Configuration

There is no config file -- vfs is zero-config. The only state it keeps is scan history for stats and the dashboard:

FilePurpose
~/.vfs/history.jsonlOne line per invocation (paths, filter, bytes, tokens saved)
~/.vfs/vfs.stateRunning server PID + endpoints (used by up/down/status)

Clear it anytime with vfs stats --reset.

Contributing

Contributions welcome! See CONTRIBUTING.md for guidelines. When you add a language, update the supported-languages tables in AGENTS.md and README.md.

Releases are automated via .github/workflows/release.yml -- see scripts/release.sh.

Used By

Using vfs in your project or company? Submit a PR to be listed here.

LogoNameWebsiteUse CaseBlog
(img url)(Company/Project Name)Website(Use Case Description)Read

How to Add Your Use Case

  1. Fork this repo and create a branch: usecase/<your-company-or-project>
  2. Add one row to the table above (logo, name, website, one-line use case, optional blog).
  3. Open a pull request titled usecase: add <Company/Project>.

No proprietary details needed -- a high-level description is fine.

License

MIT

التثبيت

TypingMind
{
  "mcpServers": {
    "vfs": {
      "command": "vfs",
      "args": [
        "mcp"
      ]
    }
  }
}

استخدم MCP الخاص بـ Vfs مع نماذج ذكاء اصطناعي متعددة

يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا بمجرد توصيل Vfs، يمكنك استخدامه مع نماذج ذكاء اصطناعي مختلفة في TypingMind بدلًا من إعداده لكل نموذج على حدة. يمكنك تشغيل MCP محليًا على جهازك أو الاتصال بعنوان URL لخادم MCP بعيد.

الخيار 1: استخدام الموصل المحلي

استخدم هذا الخيار عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات أو موارد خاصة على جهاز الكمبيوتر لديك.

1

فتح إعدادات MCP

في TypingMind، انتقل إلى «الإعدادات»، ثم «الإعدادات المتقدمة»، ثم «بروتوكول سياق النموذج»، واختر «إعداد الموصل».

  1. افتح TypingMind في متصفحك.
  2. انقر على أيقونة الإعدادات.
  3. انتقل إلى الإعدادات المتقدمة.
  4. افتح قسم بروتوكول سياق النموذج.
  5. انقر على «إعداد الموصل» واختر «هذا الجهاز».
شاشة إعداد موصل MCP في TypingMind مع تحديد «هذا الجهاز»
2

تنفيذ أمر الموصل

اختر «هذا الجهاز»، وانسخ الأمر من TypingMind وشغّله في Terminal. أبقِ العملية قيد التشغيل أثناء استخدام MCP.

  1. انسخ أمر الإعداد الذي يعرضه TypingMind.
  2. افتح Terminal على macOS أو Windows Terminal على Windows.
  3. الصق الأمر ونفّذه.
  4. وافق على تثبيت الحزمة إذا طلب منك Terminal تأكيد المتابعة.
  5. أبقِ نافذة Terminal والعملية التي تعمل فيها قيد التشغيل أثناء استخدام أدوات MCP.
3

أضف Vfs كخادم

عندما تظهر حالة الموصل «جاهز»، انقر على «تعديل الخوادم» والصق إعدادات خادم MCP.

  1. انتظر حتى تظهر حالة الموصل «جاهز».
  2. انقر على «تعديل الخوادم».
  3. الصق إعدادات خادم MCP الخاص بـ Vfs.
  4. احفظ قائمة الخوادم.
  5. حدّث الحالة إذا أردت التأكد من أن الموصل لا يزال جاهزًا.
إعدادات MCP في TypingMind تعرض خادمًا نشطًا وزر «تعديل الخوادم»
{
  "mcpServers": {
    "vfs": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

استخدام الاتصال مع نماذج مختلفة

احفظ قائمة الخوادم، وافتح «الإضافات»، وفعّل أدوات MCP الخاصة بـ Vfs، ثم اختر أي نموذج ذكاء اصطناعي مدعوم في TypingMind واستخدم الأدوات في المحادثة أو أسندها إلى وكيل ذكاء اصطناعي.

  1. افتح صفحة الإضافات في TypingMind.
  2. فعّل أدوات MCP الخاصة بـ Vfs.
  3. ابدأ محادثة واختر نموذج الذكاء الاصطناعي الذي تريد استخدامه.
  4. استخدم أدوات MCP في المحادثة أو عيّنها لوكيل ذكاء اصطناعي.
  5. انتقل إلى نموذج ذكاء اصطناعي آخر عند الحاجة دون إعادة الاتصال بـ MCP.
محادثة في TypingMind تستخدم أدوات MCP المفعّلة مع نموذج ذكاء اصطناعي محدّد
هل يمكنك استخدام Vfs لمساعدتي في هذه المهمة؟
Vfs
بالتأكيد. قرأته.
إليك ما وجدته باستخدام Vfs.

الخيار 2: إضافة عنوان URL لخادم MCP

استخدم هذا الخيار عندما يكون Vfs مستضافًا بالفعل عن بُعد أو عندما يريد فريقك موصلًا مشتركًا واحدًا يمكن لعدة مستخدمين الوصول إليه.

1

فتح موصلات MCP

في TypingMind، انتقل إلى «الإضافات»، وافتح «موصلات MCP»، ثم اختر «إضافة رابط».

  1. افتح TypingMind في متصفحك.
  2. انتقل إلى الإضافات.
  3. افتح موصلات MCP.
  4. انقر على «إضافة عنوان URL».
نموذج إضافة عنوان URL لخادم MCP مخصص في TypingMind
2

لصق عنوان URL للخادم

أدخل عنوان URL لخادم MCP الذي يقدّمه مزوّد الخدمة في حقل «رابط الخادم». أضف اسمًا للاتصال أو وصفًا أو أيقونة أو ترويسات HTTP مخصصة أو إعدادات عميل OAuth إذا كان الخادم يتطلب ذلك.

  1. ألصق عنوان URL لخادم MCP الذي يقدّمه مزوّد الخدمة في حقل «رابط الخادم».
  2. أدخل اسمًا لاتصال Vfs.
  3. أضف وصفًا وأيقونة لتسهيل التعرّف على الاتصال إن أردت.
  4. أضف ترويسات HTTP مخصصة أو تفاصيل عميل OAuth إذا كان الخادم يتطلب المصادقة.
3

إنشاء الاتصال

انقر على «إنشاء اتصال»، ثم عُد إلى قائمة الإضافات وتأكد من أن اتصال MCP الجديد نشط.

  1. انقر على «إنشاء اتصال».
  2. عُد إلى قائمة موصلات MCP.
  3. تأكد من ظهور اتصال Vfs بحالة «نشط».
  4. حدّث قائمة الإضافات إذا لم يظهر الاتصال فورًا.
4

تبديل النماذج دون إعادة الاتصال

ابدأ محادثة مع نموذجك المفضل، وفعّل أدوات Vfs من «الإضافات»، وانتقل إلى نموذج آخر عند الحاجة. يظل اتصال MCP متاحًا في مساحة عمل TypingMind.

  1. ابدأ محادثة جديدة في TypingMind.
  2. اختر نموذج الذكاء الاصطناعي الذي تريد استخدامه.
  3. فعّل أدوات Vfs من قسم الإضافات.
  4. اطلب من النموذج استخدام الأداة عند الحاجة.
  5. انتقل إلى نموذج ذكاء اصطناعي آخر وأعد استخدام اتصال MCP نفسه.
محادثة في TypingMind تستخدم أدوات MCP المفعّلة مع نموذج ذكاء اصطناعي محدّد
هل يمكنك استخدام Vfs لمساعدتي في هذه المهمة؟
Vfs
بالتأكيد. قرأته.
إليك ما وجدته باستخدام Vfs.

الأسئلة الشائعة

ما استخدامات خادم MCP Vfs؟

Vfs هو خادم MCP يتيح لتطبيقات الذكاء الاصطناعي المتوافقة الاتصال بأدوات ومصادر سياق خارجية. في TypingMind، يمكنك إضافة خادم MCP هذا مرة واحدة وإتاحة أدواته في مساحة عملك للذكاء الاصطناعي.

هل يمكنني استخدام خادم MCP Vfs مع نماذج ذكاء اصطناعي متعددة في TypingMind؟

نعم. يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا يمكنك استخدام Vfs مع نماذج ذكاء اصطناعي مختلفة مثل Claude أو ChatGPT أو Gemini أو غيرها من النماذج التي أعددتها في TypingMind، دون إعداد خادم MCP لكل نموذج على حدة.

لماذا تستخدم موصل MCP Vfs مع TypingMind؟

يُعد TypingMind من أفضل واجهات المحادثة مع النماذج اللغوية الكبيرة، إذ يجمع نماذج ذكاء اصطناعي متعددة ومطالبات وإضافات ووكلاء ذكاء اصطناعي ومفاتيح API وأدوات MCP في مساحة عمل واحدة. بعد توصيل Vfs، يمكنك استخدام أدوات MCP الخاصة به عبر نماذجك المفضلة مع الحفاظ على سير عمل محادثاتك منظمًا في TypingMind.

كيف أوصّل خادم MCP Vfs بـ TypingMind؟

يمكن توصيل Vfs بـ TypingMind باستخدام موصل MCP المحلي أو بإضافة عنوان URL لخادم MCP بعيد. استخدم الموصل المحلي عندما يحتاج الخادم إلى الوصول إلى ملفات أو تطبيقات أو موارد خاصة على جهازك، واستخدم عنوان URL للخادم عندما يكون خادم MCP مستضافًا عن بُعد.

ما الأدوات التي يوفّرها خادم MCP Vfs في TypingMind؟

يتيح Vfs إمكانات MCP يمكنك تفعيلها من صفحة الإضافات في TypingMind واستخدامها في المحادثات أو تعيينها لوكلاء ذكاء اصطناعي.

هل أحتاج إلى مشاركة مفاتيح API الخاصة بي مع TypingMind لاستخدام خادم MCP Vfs؟

لا. يعطي TypingMind الأولوية للعمل المحلي ويُبقي مزوّدي النماذج ومفاتيح API والمطالبات وإعدادات MCP تحت تحكمك. إذا كان Vfs يتطلب مصادقة، فأضف الترويسات أو إعدادات OAuth أو الإعدادات المحلية المطلوبة لخادم MCP هذا عند إنشاء الاتصال.

خوادم MCP ذات صلة

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇