Scopewalker Mcp

io.github.timohaa由 GitHub 帳號 timohaa 發布v1.4.2更新於 Nov 3, 2026

Codebase analysis tools for AI agents: complexity, prop drilling, doc coverage, code smells.

已驗證STDIO僅桌面開發者工具資料與分析

概覽

AI 產生的概覽

本機唯讀 MCP 伺服器,用來分析程式碼庫的規模、複雜度、文件覆蓋率、程式碼異味、prop drilling 與死碼。

可以做什麼
  • 統計檔案與函式:行數、函式/方法辨識、規模門檻檢查
  • 評估複雜度:巢狀深度、參數數量、認知與圈複雜度、熱點標記
  • 盤點程式碼結構:類別、方法、介面、列舉、常數與匯出
  • 檢查文件覆蓋率並列出缺少文件的函式、類別與方法
  • 找出程式碼異味,例如 TODO/FIXME/HACK 標記與 TypeScript 雙重型別斷言
  • 偵測 prop drilling 以及未被引用的符號或匯出
適用情境
適合在助理撰寫或審查程式碼時,對檔案與函式規模、複雜度、文件與殘留標記做客觀檢查,例如提交前核對。也適合透過技能、子代理或規則檔推行更嚴格程式碼規範的團隊。
執行需求
透過 npx 或全域 npm 安裝後在本機以 stdio 執行;需要 Node.js 22+ 以及另外安裝的 tokei 執行檔。不需 API 金鑰或帳號。分析範圍限於允許的根目錄,由 SCOPEWALKER_ALLOWED_ROOTS 或用戶端共享的工作區根目錄決定。
安裝前請注意
所有工具皆為唯讀,伺服器不發出網路請求,資料不會離開本機。程式碼異味中的註解文字預設會被遮蔽,除非設定 include_text;掃描不會超出允許的根目錄,不跟隨符號連結,AST 工具會略過超過 1 MB 的檔案。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Scopewalker Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Scopewalker MCP

[Buy Me A Coffee]

AI agents will happily create 1000+ line source files and add a 20th parameter to a function call, even if there's a rule file telling them not to. Scopewalker exists to enforce stricter codebase standards.

It's a local MCP server (open source, runs over stdio, makes no network calls) that exposes 9 read-only tools:

  • get_line_counts - per-file line counts (total, code, blank, comment) with sorting, extension filters, and project-wide totals
  • get_functions - function and method detection; per-file counts, or per-function line metrics via detail=lines with a min_lines filter for hunting oversized functions
  • get_complexity_metrics - max/average nesting depth and parameter counts (JSX props included), import counts, a per-file cognitive-complexity score, and per-function cyclomatic complexity with high/extreme severity bands, plus hotspots flagged for deeply nested or over-parameterized functions
  • check_thresholds - flags files and functions exceeding size thresholds (defaults: 300 lines per file, 100 per function)
  • get_code_inventory - classes with their methods, functions, interfaces/types, enums, and constants, each marked exported or not; private symbols hidden by default
  • get_documentation_coverage - coverage percentage plus every function, class, or method missing a doc comment (JSDoc, Python docstrings, Rust ///, and other per-language formats)
  • get_code_smells - TODO/FIXME/HACK/XXX/BUG/UNUSED/DEPRECATED markers found by scanning actual comments via the AST (no false positives from string literals), plus as unknown as / as any as double casts in TypeScript
  • get_prop_drilling - parameter names threaded through many functions and files, with forwarding evidence and a high/medium/low risk rating
  • find_dead_code - unreferenced top-level symbols and private methods, split into certain dead_code and human-judgment unreferenced_exports

It's tree-sitter (parsing) + tokei (line counting) + fast-glob (file discovery) under the hood; nothing is custom-parsed. Tested on macOS with Claude Code, but should work with Cursor, VS Code, Windsurf, Antigravity CLI, Codex, or anything else that speaks MCP.

See TOOLS.md for the quick reference, docs/ for per-tool parameters and example responses, and docs/usage-examples.md for a guide to wiring Scopewalker into skills, subagents, and AGENTS.md.

Safety Defaults

  • No network access: All analysis runs locally over stdio: no data leaves your machine, no API keys or external services involved.
  • Path scoping: All tools only operate inside allowed roots. SCOPEWALKER_ALLOWED_ROOTS=/abs/path1,/abs/path2 takes precedence when set. Otherwise the server uses the workspace roots your MCP client shares, and falls back to the current working directory and system temp when the client shares none.
  • Large file guard: AST-based tools skip files larger than 1 MB to avoid excessive memory/CPU use. Tokei-based line counts do not enforce this limit.
  • Input ceilings: max_files caps at 10000, max_depth at 64, limit at 5000.
  • Symlinks: Directory scans do not follow symbolic links.
  • Output limits: Tools default to returning 20 files/items unless limit is set.
  • Comment redaction: get_code_smells redacts comment text by default; pass include_text: true to return snippets explicitly.

Requirements

  • Node.js 22+
  • tokei - Install via brew install tokei or cargo install tokei

Installation

Scopewalker is published to npm as scopewalker-mcp; no clone or build needed. Configure your MCP client to run it via npx (examples below), or install it globally with npm install -g scopewalker-mcp.

To build from source instead, see Development.

Configuration

Claude Code

bash
claude mcp add --scope user scopewalker-mcp -- npx -y scopewalker-mcp

Or add to ~/.claude.json:

json
{  "mcpServers": {    "scopewalker-mcp": {      "command": "npx",      "args": ["-y", "scopewalker-mcp"]    }  }}

See Claude Code MCP documentation for details.

Claude Desktop

Download scopewalker-mcp.mcpb from the latest release and open it with Claude Desktop (or drag it into Settings > Extensions) for one-click installation.

Cursor

Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project):

json
{  "mcpServers": {    "scopewalker-mcp": {      "command": "npx",      "args": ["-y", "scopewalker-mcp"]    }  }}

Or configure via File > Preferences > Cursor Settings > MCP.

See Cursor MCP documentation for details.

VS Code (GitHub Copilot)

Add to .vscode/mcp.json in your workspace:

json
{  "servers": {    "scopewalker-mcp": {      "command": "npx",      "args": ["-y", "scopewalker-mcp"]    }  }}

Requires VS Code 1.102+ with Agent Mode enabled.

See VS Code MCP documentation for details.

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

json
{  "mcpServers": {    "scopewalker-mcp": {      "command": "npx",      "args": ["-y", "scopewalker-mcp"]    }  }}

Or configure via Windsurf Settings > Cascade > Manage MCPs.

See Windsurf MCP documentation for details.

Antigravity CLI

Add to ~/.gemini/config/mcp_config.json (global) or .agents/mcp_config.json (per project):

json
{  "mcpServers": {    "scopewalker-mcp": {      "command": "npx",      "args": ["-y", "scopewalker-mcp"]    }  }}

Use /mcp inside the prompt panel to check server status and reload the config.

See Antigravity CLI MCP documentation for details.

For Gemini CLI, add the same mcpServers configuration to ~/.gemini/settings.json. See Gemini CLI MCP documentation.

OpenAI Codex CLI

Add to ~/.codex/config.toml:

toml
[mcp_servers.scopewalker-mcp]command = "npx"args = ["-y", "scopewalker-mcp"]

Or use the CLI:

bash
codex mcp add scopewalker-mcp -- npx -y scopewalker-mcp

See Codex MCP documentation for details.

Usage

Once configured, the assistant calls Scopewalker's tools on its own; no special syntax needed. Ask things like:

  • "Check this repo against our size thresholds before I commit"
  • "Which functions in src/ have the highest cognitive complexity?"
  • "Find undocumented exports in src/auth"
  • "Are there any TODO/FIXME/HACK markers left in this module?"
  • "Show me functions that take more than 5 parameters"

It picks the right tool and parameters for the request.

This repo enforces shared quality requirements through its skills and agents:

Development

To run from source instead of npm:

bash
git clone https://github.com/timohaa/scopewalker-mcp.gitcd scopewalker-mcpnpm installnpm run build

Then point your MCP client at the build output, e.g. claude mcp add --scope user scopewalker-mcp -- node /path/to/scopewalker-mcp/dist/index.js.

bash
npm run build          # Build the projectnpm run check          # Version sync + lint + typechecknpm run test           # Run testsnpm run test:coverage  # Run tests with coverage

See CONTRIBUTING.md for contribution guidelines and docs/patterns.md for tool registration, error handling, and testing patterns.

Supported Languages

The AST-based tools (everything except get_line_counts) parse:

  • TypeScript/JavaScript (.ts, .tsx, .js, .jsx, .mjs, .cjs)
  • Python (.py)
  • Go (.go)
  • Rust (.rs)
  • Java (.java)
  • C/C++ (.c, .h, .cpp, .cc, .cxx, .hpp)
  • Ruby (.rb)

get_line_counts runs through tokei, so it reports on every language tokei recognizes. See docs/tools-overview.md for what is detected per language.

License

MIT

來源:README.md,提交 9835ffe

工具

9

get_line_counts

Line Counts

Returns file line counts (code/blank/comment). Use extensions to filter.

輸入參數greppath必填limitsort_byextensionsinclude_hiddenignore_patterns

get_functions

Functions

Returns function/method info. Use detail=lines for line counts per function.

輸入參數greppath必填limitdetailsort_bymax_depthmax_filesmin_linesextensionsinclude_hiddenignore_patterns

check_thresholds

Size Thresholds

Finds files/functions exceeding size thresholds. Use limit to control output.

輸入參數path必填limitmax_depthmax_filesextensionsinclude_hiddenmax_file_linesignore_patternsmax_function_lines

get_code_inventory

Code Inventory

Lists classes, functions, methods, and exports. Use extensions to filter.

輸入參數greppath必填limitmax_depthmax_filesextensionsinclude_hiddenignore_patternsinclude_private

get_code_smells

Code Smells

Finds TODO/FIXME/HACK/BUG markers and unsafe casts in code.

輸入參數path必填limittypesmax_depthmax_filesextensionsinclude_textinclude_hiddenignore_patterns

get_complexity_metrics

Complexity Metrics

Returns complexity metrics (nesting, params, cognitive, per-function cyclomatic). Use limit/summary_only to control output.

輸入參數path必填limitmax_depthmax_filesextensionssummary_onlyinclude_hiddenignore_patterns

get_documentation_coverage

Documentation Coverage

Finds undocumented functions/classes. Use limit/summary_only to control output.

輸入參數path必填limitmax_depthmax_filesmin_linesextensionssummary_onlyinclude_hiddenignore_patterns

get_prop_drilling

Prop Drilling

Detects parameter threading (prop drilling) by finding parameter names passed through chains of functions. Use limit/summary_only to control output.

輸入參數path必填limitmax_depthmax_filesextensionssummary_onlyexclude_commoninclude_hiddenignore_patternsmin_occurrences

find_dead_code

Dead Code

Finds declared symbols that nothing references. dead_code is proven unreachable within the scan; unreferenced_exports may be used outside it.

輸入參數path必填limitmax_depthmax_filesextensionsinclude_hiddenignore_patterns

版本歷史

6
  1. v1.4.2最新Oct 29, 2026
  2. v1.4.1Oct 23, 2026
  3. v1.4.0Oct 9, 2026
  4. v1.3.3Oct 8, 2026
  5. v1.3.2Sep 25, 2026
  6. v1.3.1Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分