
Code Pathfinder
dev.codepathfinder由 codepathfinder.dev 發布v2.1.1更新於 Oct 24, 2026
Code intelligence MCP server: call graphs, type inference, and symbol search for Python/Go.
概覽
一個本機程式碼智慧 MCP 伺服器,為助理提供 Python 與 Docker 專案的呼叫圖、跨檔案資料流追蹤、符號搜尋與安全規則掃描。
- 可以做什麼
- Code Pathfinder 會將專案解析為 AST,建立呼叫圖與每個函式的變數相依圖,並執行汙點分析以追蹤跨檔案與跨函式邊界的來源到匯資料流。透過 MCP,它提供尋找呼叫者與被呼叫者、追蹤資料流、搜尋程式碼模式以及執行安全規則的工具。它內建針對 Python、Dockerfile 與 Docker Compose 的規則包,並支援以文字、JSON、SARIF 或 CSV 輸出結果。
- 適用情境
- 當助理需要超出 LSP 所能提供的 Python 程式碼結構理解時,或需要審查跨多個檔案的 SQL 注入、SSRF、路徑遍歷、反序列化等弱點時使用。它也適用於 Dockerfile 與 Compose 設定檢查。
- 執行需求
- 以 stdio 方式作為本機程序執行。可透過 Homebrew、pip(codepathfinder)、預先建置的執行檔或 Docker 映像安裝;pip 套件另提供用於撰寫規則的 Python SDK。不需要 API 金鑰、設定檔或雲端帳號。規則集會從 CDN 自動下載,因此需要網路存取。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Code Pathfinder,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Open-source SAST engine that traces vulnerabilities across files and functions
Website · Docs · Rule Registry · MCP Server · Blog
[Build] [GitHub Release] [Apache-2.0 License] [GitHub Stars] [Ask DeepWiki]
Quick Start
Install:
Scan a Python project (rules download automatically):
Scan Dockerfiles:
No config files, no API keys, no cloud accounts. Results in your terminal in seconds.
What is Code Pathfinder?
Code Pathfinder is an open-source static analysis engine that builds a graph of your codebase and traces how data flows through it. It parses source code into Abstract Syntax Trees, constructs call graphs across files, and runs taint analysis to find source-to-sink vulnerabilities that span multiple files and function boundaries.
v2.0 introduces cross-file dataflow analysis: trace user input from an HTTP handler in one file through helper functions and into a SQL query in another file. This is the kind of analysis that pattern-matching tools miss entirely.
Cross-File Taint Analysis
Most open-source SAST tools operate on single files. Code Pathfinder v2.0 tracks tainted data across file boundaries:
The engine builds a Variable Dependency Graph (VDG) per function, then connects them through inter-procedural taint transfer summaries. When user_input flows into a function parameter in another file, the taint propagates through the call graph to the sink.
How It Works
- Parse: Tree-sitter builds ASTs for Python, Dockerfiles, and Docker Compose files
- Index: Extract functions, call sites, parameters, and assignments into a queryable call graph
- Analyze: Build VDGs per function, resolve inter-procedural flows, run taint analysis
- Detect: Python-based security rules query the graph to find source-to-sink paths
- Report: Output findings as text, JSON, SARIF (GitHub Code Scanning), or CSV
190 Security Rules, Ready to Use
Rules download from CDN automatically. No need to clone the repo or manage rule files.
Browse all rules with examples and test cases at the Rule Registry.
MCP Server for AI Coding Assistants
Code Pathfinder runs as an MCP server, giving Claude Code, Cursor, Cline, and other AI assistants access to call graphs, data flows, and security analysis. More context than LSP, focused on security and code structure.
The MCP server exposes tools for querying the code graph: find callers/callees, trace data flows, search for patterns, and run security rules — all available to the AI assistant during code review or development.
Write Custom Rules
Security rules are Python scripts using the PathFinder SDK. Define sources, sinks, and sanitizers — the dataflow engine handles the analysis.
Here's a real rule from the repo (PYTHON-DJANGO-SEC-001) that detects SQL injection in Django:
Explore all 190 rules in the rules/ directory or browse the Rule Registry. See the rule writing guide and dataflow documentation to write your own.
See the rule writing guide and dataflow documentation for more.
Installation
Homebrew (Recommended)
pip
Installs the CLI binary and Python SDK for writing rules.
Docker
Pre-Built Binaries
Download from GitHub Releases for Linux (amd64, arm64), macOS (Intel, Apple Silicon), and Windows (x64).
From Source
Usage
GitHub Action
See the full example: .github/workflows/code-pathfinder-scan.yml
Action Inputs
Either rules or ruleset is required.
Supported Languages
Contributing
Contributions are welcome. Read the Contributing Guide for setup instructions, how to run tests locally, and the PR process.
Pushing an in-product announcement
In-product announcements (workshops, blog posts, security advisories) are
managed via release/latest.json. Add an entry to announcements[],
open a PR, and once it merges to main the publish workflow uploads the
manifest to the CDN within ~60 seconds. See the version-update-check tech
spec for the schema and version_range semantics.
All contributors must sign the Contributor License Agreement (CLA) before any pull request can be merged.
License
來源:README.md,提交 460d0d3
工具
0版本歷史
1- v2.1.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分