
Grafyx
io.github.bilal07karadeniz由 GitHub 帳號 bilal07karadeniz 發布v0.2.4更新於 Oct 24, 2026
Real-time codebase graph for AI assistants: call graphs, dependencies, symbol lookup.
概覽
Grafyx 將本機程式碼庫解析成即時關聯圖,並透過 MCP 提供給助理,用來追蹤呼叫鏈、相依性與符號。
- 可以做什麼
- 檢視專案結構、模組劃分與各模組統計,並可在執行時切換所服務的專案
- 查詢函式、類別與檔案,取得呼叫者、被呼叫者、匯入、繼承與使用位置
- 追蹤呼叫鏈與相依圖做影響分析,並檢視子類別樹、偵測未使用符號
- 依自然語言描述或依與某功能相關的符號搜尋程式碼
- 回報偵測到的編碼慣例,並強制重新解析程式碼庫
- 適用情境
- 適合助理處理 Python、TypeScript 或 JavaScript 專案時需要架構層面的脈絡,而非直接讀原始檔:追蹤呼叫鏈、評估變更影響、尋找相關程式碼或找出死程式碼。
- 執行需求
- 以 stdio 在本機執行,透過 uvx 從 PyPI 套件 grafyx-mcp 啟動(也可先以 pip 安裝)。需要 Python;在 Windows 上需使用 WSL,因為 Graph-sitter 要求 Linux。專案路徑預設為目前目錄,可用 --project 選項指定。預設搜尋編碼器會在首次使用時下載並快取於本機。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Grafyx,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Grafyx
[PyPI] [Downloads] [CI] [License: MIT] [Python 3.12+] [MCP] [Grafyx MCP server]
Real-time codebase understanding for AI coding assistants.
What is Grafyx?
AI coding tools read raw files with zero architectural understanding -- they don't know what calls what, which classes inherit from where, or how your modules connect. Grafyx fixes this by parsing your entire codebase into a full relationship graph using Graph-sitter (built on tree-sitter), then exposing that graph to any AI assistant through the Model Context Protocol (MCP). Your assistant can trace call chains, map dependencies, find related code by description, detect conventions, and understand your project's architecture -- all in real time, with a file watcher that keeps the graph current as you edit.
Quick Start
Claude Code
Cursor / Windsurf / Cline
Add to your MCP config file:
- Cursor:
.cursor/mcp.json(project) or~/.cursor/mcp.json(global) - Windsurf:
~/.codeium/windsurf/mcp_config.json - Cline: Cline MCP settings in VS Code
VS Code (GitHub Copilot)
Add to .vscode/mcp.json:
Using pip instead of uvx? Replace the command with:
"command": "grafyx"(no args needed).
Available Tools
How It Works
- Startup -- Grafyx detects languages in your project and parses all source files into a semantic graph via Graph-sitter.
- Serving -- The FastMCP server exposes 14 tools over stdio. Your AI assistant calls them as needed.
- Live updates -- Watchdog monitors file changes. When you save, the graph is automatically re-parsed after a short debounce.
ML-augmented search
Grafyx's find_related_code uses a pretrained code embedding model (default:
jinaai/jina-embeddings-v2-base-code, Apache-2.0, 161M params) running on CPU
via ONNX through fastembed. The model
is downloaded on first use and cached locally — no GPU, no daemon, no cloud
calls.
Since 0.2.1, fastembed is a hard dependency, so the default install
already includes the encoder — no extra needed.
Benchmark (0.2.0, 278 docstring→function queries across FastAPI + Django):
The default encoder more than doubles retrieval quality over plain source-token search (+135% nDCG@10).
Full breakdown + per-query JSONL: docs/benchmarks/0.2.0/.
Switch encoders via the GRAFYX_ENCODER env var:
jina-v2(default) — Apache-2.0, fastembed-native, ~150 MB. Wins on accuracy; recommended unless you have a specific reason to switch.coderankembed— MIT, 137M, ONNX-int8, ~140 MB. Lower latency but ~12 nDCG@10 points behind jina-v2 in our eval. Hosted atBilal7Dev/grafyx-coderankembed-onnx.
Supporting numpy-only MLPs (~5 MB total weights, bundled in the wheel):
- M1 Relevance ranker — 33-feature MLP that re-ranks the encoder's top candidates using structural signals (caller count, name overlap, exports).
- M3 Source token filter — suppresses noise tokens (imports, strings, magic methods) from full-text search.
- M4 Symbol importance — weights symbols by caller count, exports, and structural signals.
- Gibberish detector — character-bigram MLP that blocks nonsense queries before they hit the index.
Reproducible benchmarks against FastAPI, Django, and Home Assistant ship in
benchmarks/ (python -m scripts.run_all).
Supported Languages
Languages are auto-detected. To specify manually:
Options
Default ignored: node_modules, .git, __pycache__, .venv, venv, .env, dist, build, .tox, .mypy_cache, .pytest_cache, .ruff_cache, egg-info, .eggs, .next, .nuxt, coverage, .coverage, .nyc_output
Multi-Agent Support
Grafyx works with agent teams. A single Grafyx instance serves all agents connected to the same project. When one agent modifies code, the file watcher updates the graph automatically, so other agents immediately see the changes.
Contributing
Troubleshooting
Windows: Graph-sitter requires Linux. Use WSL and configure your MCP client to launch via wsl:
License
MIT -- see LICENSE for details.
來源:README.md,提交 2d93bd1
工具
0版本歷史
1- v0.2.4最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分