
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 分