Code Pathfinder MCP sunucusu
✓ DoğrulandıYapay zeka asistanlarının Python projelerinde çağrı grafiklerini sorgulamasına, veri akışlarını izlemesine ve güvenlik kurallarını çalıştırmasına olanak tanır.
Ayrıca bilinen adı shivasurya/code-pathfinder, code-pathfinder, codepathfinder
- Yıldızlar
- 143
- Araçlar
- —
- İndirmeler, 30 gün
- 426
- En son sürüm
- 2.1.1
- Son commit
- 10 Tem 2026
- Lisans
- Apache-2.0
Code Pathfinder MCP nedir?
Code Pathfinder bir MCP sunucusudur. Yapay zeka asistanlarının Python projelerinde çağrı grafiklerini sorgulamasına, veri akışlarını izlemesine ve güvenlik kurallarını çalıştırmasına olanak tanır.
Özet, projenin README dosyasından oluşturuldu
Code Pathfinder MCP sunucusu hakkında
Güvenlik mühendisleri ve geliştiriciler, Python projeleri, Dockerfile ve Docker Compose dosyaları üzerinde derin statik analiz gerçekleştirmek için Code Pathfinder'ı kullanabilirler. Bu MCP server'ı Claude Code, Cursor veya Cline gibi yapay zeka kodlama asistanlarına entegre ederek, kullanıcılar yapay zekalarına kod yapısı ve güvenlik açıkları konusunda gelişmiş bir anlayış kazandırabilirler. Sunucu, bir yapay zekanın çağrı grafiklerini sorgulamasına, verilerin bir sistem içinde nasıl hareket ettiğini izlemesine ve belirli güvenlik kurallarını doğrudan geliştirme iş akışı içinde yürütmesine olanak tanır.
Standart desen eşleştirme araçlarının aksine bu motor, kirli verileri (tainted data) bir dosyadaki kaynaktan (source) başka bir dosyadaki hedefe (sink) kadar takip etmek için dosyalar arası veri akışı analizi gerçekleştirir. Soyut Sözdizimi Ağaçları (AST) oluşturmak için Tree-sitter kullanır ve karmaşık etkileşimleri haritalandırmak için bir Değişken Bağımlılık Grafiği (Variable Dependency Graph) kurar. Sistem, Homebrew veya pip aracılığıyla kurulduktan sonra tamamen yerel olarak çalışır ve herhangi bir API anahtarı veya bulut hesabı gerektirmez. SQL injection ve RCE gibi yaygın sorunları kapsayan ve bir CDN üzerinden otomatik olarak indirilen 190 adet kullanıma hazır kural ile birlikte gelir.
Neler yapabilirsiniz
- 1Dosyalar arası veri akışlarını izleyinYapay zeka asistanınızdan, bir HTTP işleyicisinden gelen kullanıcı girişini çeşitli fonksiyonlar boyunca takip ederek bir veritabanı sorgusuna ulaşıp ulaşmadığını kontrol etmesini isteyin.
- 2Python güvenlik açıklarını denetleyinBir yapay zeka asistanının, bir Python kod tabanındaki SQL injection veya RCE gibi güvenlik açıklarını belirlemek için belirli güvenlik kural setlerini çalıştırmasını sağlayın.
- 3Kod tabanı yapısını sorgulayınYapay zeka asistanından, oluşturulan çağrı grafiğini kullanarak belirli bir fonksiyon için tüm çağırıcıları veya çağrılanları bulmasını isteyin.
Projenin README dosyasından alınmıştır. Her kullanım durumu, oradaki bir alıntı ile kontrol edilir.
Code Pathfinder MCP nasıl yüklenir
Biçimler 10 Kas 2026 tarihinde doğrulandıCursor'a ekleGoose'a ekleCode Pathfinder MCP'yi Claude Code içine yükleyin
$ claude mcp add code-pathfinder -- uvx codepathfinderCode Pathfinder MCP'yi Cursor içine yükleyin
~/.cursor/mcp.json
{
"mcpServers": {
"code-pathfinder": {
"command": "uvx",
"args": [
"codepathfinder"
]
}
}
}Code Pathfinder MCP'yi VS Code içine yükleyin
.vscode/mcp.json
{
"servers": {
"code-pathfinder": {
"type": "stdio",
"command": "uvx",
"args": [
"codepathfinder"
]
}
}
}Code Pathfinder MCP'yi VS Code CLI içine yükleyin
$ code --add-mcp '{"name":"code-pathfinder","type":"stdio","command":"uvx","args":["codepathfinder"]}'Code Pathfinder MCP'yi Claude Desktop içine yükleyin
claude_desktop_config.json
{
"mcpServers": {
"code-pathfinder": {
"command": "uvx",
"args": [
"codepathfinder"
]
}
}
}Code Pathfinder MCP'yi Codex içine yükleyin
$ codex mcp add code-pathfinder -- uvx codepathfinderCode Pathfinder MCP'yi Codex config.toml içine yükleyin
~/.codex/config.toml
[mcp_servers.code-pathfinder] command = "uvx" args = ["codepathfinder"]
Code Pathfinder MCP'yi Gemini CLI içine yükleyin
$ gemini mcp add -s user code-pathfinder uvx -- codepathfinderCode Pathfinder MCP'yi Gemini settings.json içine yükleyin
~/.gemini/settings.json
{
"mcpServers": {
"code-pathfinder": {
"command": "uvx",
"args": [
"codepathfinder"
]
}
}
}Otomatik kontroller
Çalıştırıldı 12 Kas 2026Tam rapor →Otomatik kontrollerimizden geçti. Bu bir güvenlik denetimi değildir: kodu okuyun ve sunucuya ihtiyaç duyduğu en dar erişimi verin. Kontroller nasıl çalışır
- Kaynak deposu bağlantılı ve erişilebilirGeçti
- Açık kaynak lisansı (OSI)Geçti
- Son bir yıl içinde commit veya sürüm mevcutGeçti
- Paket adı popüler bir pakete yakın değilGeçti
- Uzak uç nokta HTTPS kullanıyorKontrol edilmedi
- Yıkıcı araçlar etiketlenmişKontrol edilmedi
- Modele yönelik gizli talimat yokGeçti
- Pakette veya bağımlılıklarında kritik uyarı yokGeçti
Website · Docs · Rule Registry · MCP Server · Blog
Quick Start
Install:
brew install shivasurya/tap/pathfinder
Scan a Python project (rules download automatically):
pathfinder scan --ruleset python/all --project .
Scan Dockerfiles:
pathfinder scan --ruleset docker/all --project .
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:
app.py:5 user_input = request.get("query") ← Source: user-controlled input
↓ calls
db.py:12 cursor.execute(query) ← Sink: SQL execution
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
Source Code → Tree-sitter AST → Call Graph → Variable Dependency Graph → Taint Analysis → Findings
↓
Inter-procedural
Taint Summaries
(cross-file flows)
- 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.
| Language | Bundles | Rules | Coverage |
|---|---|---|---|
| Python | django, flask, aws_lambda, cryptography, jwt, lang, deserialization, pyramid | 158 | SQL injection, RCE, SSRF, path traversal, XSS, deserialization, crypto misuse, JWT vulnerabilities |
| Docker | security, best-practice, performance | 37 | Root user, exposed secrets, image pinning, multi-stage builds, layer optimization |
| Docker Compose | security, networking | 10 | Privileged mode, socket exposure, capability escalation, network isolation |
# Scan with a specific bundle
pathfinder scan --ruleset python/django --project .
# Scan with multiple bundles
pathfinder scan --ruleset python/flask --ruleset python/jwt --project .
# Scan a single rule
pathfinder scan --ruleset python/PYTHON-DJANGO-SEC-001 --project .
# Scan all rules for a language
pathfinder scan --ruleset python/all --project .
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.
pathfinder serve --project .
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:
from codepathfinder import calls, flows, QueryType
from codepathfinder.presets import PropagationPresets
class DBCursor(QueryType):
fqns = ["sqlite3.Cursor", "psycopg2.extensions.cursor"]
match_subclasses = True
@python_rule(
id="PYTHON-DJANGO-SEC-001",
name="Django SQL Injection via cursor.execute()",
severity="CRITICAL",
cwe="CWE-89",
)
def detect_django_cursor_sqli():
return flows(
from_sources=[
calls("request.GET.get"),
calls("request.POST.get"),
],
to_sinks=[
DBCursor.method("execute").tracks(0),
calls("cursor.execute"),
],
sanitized_by=[calls("escape"), calls("escape_string")],
propagates_through=PropagationPresets.standard(),
scope="global", # cross-file taint analysis
)
# Run your custom rules
pathfinder scan --rules ./my_rules/ --project .
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)
brew install shivasurya/tap/pathfinder
pip
Installs the CLI binary and Python SDK for writing rules.
pip install codepathfinder
Docker
docker pull shivasurya/code-pathfinder:stable-latest
docker run --rm -v "$(pwd):/src" \
shivasurya/code-pathfinder:stable-latest \
scan --ruleset python/all --project /src
Pre-Built Binaries
Download from GitHub Releases for Linux (amd64, arm64), macOS (Intel, Apple Silicon), and Windows (x64).
From Source
git clone https://github.com/shivasurya/code-pathfinder
cd code-pathfinder/sast-engine
gradle buildGo
./build/go/pathfinder --help
Usage
# Scan with text output (default)
pathfinder scan --ruleset python/all --project .
# JSON output
pathfinder scan --ruleset python/all --project . --output json --output-file results.json
# SARIF output (GitHub Code Scanning)
pathfinder scan --ruleset python/all --project . --output sarif --output-file results.sarif
# CSV output
pathfinder scan --ruleset python/all --project . --output csv --output-file results.csv
# Fail CI on critical/high findings
pathfinder scan --ruleset python/all --project . --fail-on=critical,high
# MCP server mode
pathfinder serve --project .
# Verbose output with statistics
pathfinder scan --ruleset python/all --project . --verbose
GitHub Action
name: Code Pathfinder Security SAST Scan
on:
pull_request:
permissions:
security-events: write
contents: read
pull-requests: write
jobs:
security-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Run Security Scan
uses: shivasurya/code-pathfinder@v2.1.1
with:
ruleset: python/all, docker/all, docker-compose/all
verbose: true
pr-comment: ${{ github.event_name == 'pull_request' }}
pr-inline: ${{ github.event_name == 'pull_request' }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v4
if: always()
with:
sarif_file: pathfinder-results.sarif
See the full example: .github/workflows/code-pathfinder-scan.yml
| Input | Description | Default |
|---|---|---|
rules |
Path to local Python rule files or directory | - |
ruleset |
Remote ruleset(s), comma-separated (e.g., python/all, docker/security) |
- |
project |
Path to source code | . |
output |
Output format: sarif, json, or csv |
sarif |
output-file |
Output file path | pathfinder-results.sarif |
fail-on |
Fail on severities (e.g., critical,high) |
- |
verbose |
Enable verbose output | false |
debug |
Enable debug diagnostics with timestamps | false |
skip-tests |
Skip test files | true |
refresh-rules |
Force refresh cached rulesets | false |
disable-metrics |
Disable anonymous usage metrics | false |
python-version |
Python version to use | 3.12 |
pr-comment |
Post summary comment on pull request | false |
pr-inline |
Post inline review comments for critical/high findings | false |
github-token |
GitHub token (required when pr-comment or pr-inline is enabled) |
- |
no-diff |
Disable diff-aware scanning (scan all files) | false |
Either rules or ruleset is required.
Supported Languages
| Language | Analysis | Status |
|---|---|---|
| Python | Cross-file dataflow, taint analysis, call graphs | Stable |
| Dockerfile | Instruction analysis, security patterns | Stable |
| Docker Compose | Configuration analysis, security patterns | Stable |
| Go | AST analysis, call graphs | Coming soon |
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
Code Pathfinder MCP soruları
Code Pathfinder MCP'yi Claude Code'a nasıl eklerim?
Terminalinizde claude mcp add code-pathfinder -- uvx codepathfinder komutunu çalıştırın. Her projede kullanılabilir olması için --scope user ekleyin.
Code Pathfinder MCP'yi Cursor'a nasıl eklerim?
~/.cursor/mcp.json dosyasını açın ve yukarıdaki yükleme bölümünde gösterilen Cursor yapılandırmasını kullanarak sunucuyu mcpServers altına ekleyin.
Code Pathfinder MCP server hangi araçları sunar?
Kod grafiğini sorgulamak için araçlar sunar: çağırıcıları ve çağrılanları bulma, veri akışlarını izleme, desen arama ve güvenlik kurallarını çalıştırma gibi özelliklere sahiptir.
Code Pathfinder MCP server nasıl başlatılır?
pathfinder serve komutunu, kod tabanınızı işaret eden --project bayrağı ile çalıştırın.
Code Pathfinder ile hangi yapay zeka kodlama asistanları çalışır?
Claude Code, Cursor, Cline ve MCP destekleyen diğer yapay zeka asistanları ile çalışır.
Code Pathfinder hangi dilleri destekler?
Python, Dockerfile ve Docker Compose sürümleri stabildir; Go AST analizi ve çağrı grafikleri yakında eklenecektir.
Kullanmak için bir API anahtarına veya bulut hesabına ihtiyacım var mı?
Hayır, taramalar yerel olarak çalışır; herhangi bir yapılandırma dosyası, API anahtarı veya bulut hesabı gerektirmez.