Symbols

io.github.Jordan-Horner由 GitHub 帳號 Jordan-Horner 發布v1.0.3更新於 Nov 10, 2026

Fast polyglot source code intelligence: symbols, imports, dependencies, and impact analysis.

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

為助理提供唯讀的程式碼智慧:符號、匯入、相依性、被相依性、影響分析與專案相依圖。

可以做什麼
Symbols 是一個透過 MCP 暴露的多語言原始碼智慧工具。它使用 tree-sitter AST 解析擷取符號(函式、類別、常數、變數),解析匯入陳述式,並解析檔案層級相依性。工具包括 syms_list、syms_imports、syms_deps、syms_dependents、syms_impact、syms_search 與 syms_graph,支援可選的符號類型篩選與行列範圍。結果以結構化內容回傳。
適用情境
當助理需要程式碼庫的結構化脈絡時使用:梳理陌生儲存庫、評估變更可能影響的範圍、檢視相依關係,或依名稱尋找符號。它面向希望隨需取得最新專案事實、而不必反覆閱讀檔案或依賴過時聊天記錄的開發者。
執行需求
以本機 stdio 程序在使用者機器上執行(僅限桌面端)。可透過發行壓縮檔、Homebrew 或使用 Go 1.26+ 從原始碼建置來安裝 syms 二進位檔。未宣告任何帳戶、API 金鑰或環境變數。它從本機檔案系統讀取原始碼檔案。
安裝前請注意
它會讀取本機原始碼並回傳給助理,因此只應指向你願意向該助理暴露的專案。它是唯讀的:不會修改、傳送或刪除檔案。相依性解析基於慣例且為檔案層級,因此對動態匯入、C/C++ include 以及 monorepo 跨套件匯入,結果可能不完整。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

symbols

A fast, polyglot source code intelligence CLI. Extract symbols, parse imports, trace dependencies, and analyze impact — all from the command line.

No language server required. No build step for your projects. Just point it at your code.

[Go] [License: MIT] [MCPAmpel]

[symbols MCP server]

Table of contents

Why this exists

symbols is for the moments when you need to understand a codebase quickly without opening 30 files first.

Common pain points it targets:

  • You are about to change a file and need to know blast radius immediately.
  • You are onboarding to an unfamiliar repo and need a map, not a scavenger hunt.
  • You are reviewing a PR and want concrete dependency and ownership signals.
  • You are using AI coding tools and need reliable, structured project context on demand.

Instead of manually reconstructing context from editor tabs, grep output, and memory, symbols gives you the structural view in one step.

How it saves context

symbols saves context in two practical ways:

  1. It externalizes code structure into fast, repeatable queries (list, deps, dependents, impact, graph, search) so you do not have to rebuild mental maps every session.
  2. It exposes the same model through MCP (syms mcp) so agents and tools can fetch fresh project facts directly, rather than relying on stale chat history or guessed file relationships.

Net effect:

  • less re-reading
  • fewer "what will this break?" surprises
  • faster onboarding and safer refactors
  • more useful AI assistance because context is retrieved, not improvised
  • lower cost from fewer exploratory engineering cycles and reduced AI token spend on repo re-discovery

What it does

syms list server.py           # functions, classes, constants, variablessyms imports server.py        # parsed import statementssyms deps server.py           # files this file imports fromsyms dependents server.py     # files that import this filesyms impact server.py         # full impact analysis (direct + transitive)syms graph .                  # project-wide dependency summarysyms search User              # find symbols by name across a projectsyms mcp                      # run as MCP server for AI tools

Install

Option 1: Build from source

sh
git clone https://github.com/Jordan-Horner/symbols.gitcd symbolsgo build -o syms .sudo mv syms /usr/local/bin/

Requirements: Go 1.26+

Option 2: Direct installation (Linux/macOS)

sh
# Install directly to /usr/local/bincurl -L https://github.com/Jordan-Horner/symbols/releases/latest/download/syms-$(uname -s)-$(uname -m) -o /usr/local/bin/symschmod +x /usr/local/bin/syms

Option 3: Homebrew (macOS)

sh
brew tap Jordan-Horner/tapbrew install syms

Verify installation

sh
syms --version

Language support

Symbol extraction uses tree-sitter for full AST parsing (function signatures with parameters, classes, types, constants). Import parsing and dependency resolution use regex.

LanguageSymbolsImport parsingDependency resolution
Pythontree-sitter (functions, classes, constants, variables)regexRelative + absolute imports
TypeScripttree-sitterregextsconfig.json path aliases, relative paths, index.ts
JavaScripttree-sitterregexSame as TypeScript (also reads jsconfig.json)
Sveltetree-sitter (script block)regexSame as TypeScript
Gotree-sitterregexgo.mod module prefix, package directories
Javatree-sitterregexDot-to-slash, src/main/java prefix
Kotlintree-sitterregexSame as Java + .kt
Rusttree-sitterregexcrate/self/super, mod.rs
C#tree-sitterregexNamespace-to-path, class name fallback
PHPtree-sitterregexPSR-4 conventions, require/include
C/C++tree-sitter——
Rubytree-sitter——
Scalatree-sitter——
Bashtree-sitter——

Usage

Symbol extraction

sh
# Single filesyms list app.py
# Multiple filessyms list src/main.go src/handlers.go
# Recursive directory scansyms list -r src/
# JSON output (for piping to other tools)syms list --json app.py
# Pretty JSON output (human-readable)syms list --json --pretty app.py
# Optional: include precise symbol rangessyms list --json --ranges app.py
# Count symbols per filesyms list --count src/
# Filter by symbol kind (repeatable or comma-separated)syms list --filter class src/syms list --filter class,function src/syms list --filter class --filter function src/

Output:

### `app.py` — 245 lines
  constant VERSION  # line 1  constant API_URL  # line 3  variable app  # line 5  class Application  # line 12  def __init__(self, config)  # line 15  async def start(self)  # line 34  def shutdown(self)  # line 78

Import parsing

sh
syms imports server.py

Output:

### `server.py`
  from flask import Flask, jsonify  # line 1  from .models import User, Post  # line 2  import os  # line 3

Dependency queries

sh
# Direct dependenciessyms deps src/handlers.go
# Transitive (everything it depends on, recursively)syms deps -t src/handlers.go
# Who imports this file?syms dependents src/models.py
# Transitive dependentssyms dependents -t src/models.py

Impact analysis

sh
syms impact src/core/utils.py

Output:

### `src/core/utils.py` — impact analysis
  Direct dependents:     8  Transitive dependents: 23
  Direct:    src/api/handlers.py    src/core/auth.py    src/core/db.py    ...
  Indirect (transitive):    src/api/routes.py    src/main.py    tests/test_auth.py    ...

Project graph summary

sh
syms graph .

Output:

Project dependency graph
  Files:              187  Import edges:       562  Unresolved imports: 43
  Most depended-on files:    src/utils.py  (36 dependents)    src/config.py  (33 dependents)    src/models.py  (23 dependents)
  Heaviest importers:    src/app.py  (28 imports)    src/main.py  (24 imports)
  Circular dependencies (1):    src/config.py <-> src/runner.py

JSON output

All commands support --json for machine-readable output:

sh
syms impact --json src/utils.py | jq '.direct_dependents'syms graph --json . | jq '.hot_spots[:5]'
# Optional: pretty-print JSON for humanssyms graph --json --pretty .
# Full edge map (file → its dependencies)syms graph --json . | jq '.edges'
# What does a specific file depend on?syms graph --json . | jq '.edges["src/app.py"]'

Shorthand

The list subcommand is the default — you can omit it:

sh
# These are equivalent:syms list app.pysyms app.py
# Flags work too:syms -r src/ --json

Symbol search

sh
# Find symbols by name (fuzzy: exact > prefix > contains)syms search User
# JSON outputsyms search --json handle
# Search in a specific projectsyms search --root /path/to/project Config
# Search only specific symbol kindssyms search --filter class User
# Optional: include precise symbol ranges in search resultssyms search --json --ranges User

Output:

Found 3 symbols matching "User":
  class User  models.py:1  class UserProfile  models.py:5  function get_user(id)  api/handlers.py:12

MCP server

Run syms as an MCP server for AI tool integration (e.g. Claude Code):

sh
syms mcp

Exposes all functionality as MCP tools over stdio (JSON-RPC 2.0):

ToolDescription
syms_listExtract symbols from files
syms_importsParse import statements
syms_depsFile dependencies
syms_dependentsReverse dependencies
syms_impactImpact analysis
syms_searchSearch symbols by name
syms_graphProject dependency graph

syms_list and syms_search accept optional kinds: string[] arguments to filter symbol kinds. syms_list and syms_search also accept optional include_ranges: boolean for start/end line+column metadata. Tool results are returned in structuredContent (not JSON text blobs in content[].text).

Claude Code setup

After installing syms, configure it as an MCP server:

Project-level (recommended for teams):

Create .mcp.json in your project root:

json
{  "mcpServers": {    "symbols": {      "command": "syms",      "args": ["mcp"]    }  }}

Commit this file so your team gets the symbols server automatically.

Global (all projects):

Create or edit ~/.mcp.json:

json
{  "mcpServers": {    "symbols": {      "command": "syms",      "args": ["mcp"]    }  }}

After configuration:

  1. Restart Claude Code
  2. When prompted, approve the symbols MCP server
  3. Claude Code will now have access to code intelligence tools in all your projects

How it works

Symbol extraction uses tree-sitter for full AST parsing. Each language has a compiled grammar (linked statically into the binary) that produces a syntax tree. The tool walks the tree to extract top-level declarations with names, kinds, line numbers, and function parameters. For Python, module-level assignments are also extracted as constants (UPPER_CASE) or variables.

Import parsing uses regex patterns tuned to each language's import syntax. This is fast and reliable for standard import forms without needing AST parsing.

Dependency resolution maps import specifiers to actual files on disk using language-specific conventions:

  • Python: module dot-path to file path, relative import resolution
  • Go: go.mod module name stripping, package-to-directory mapping
  • Java/Kotlin: dot-to-slash convention, standard source root prefixes (src/main/java/)
  • Rust: crate/self/super path resolution, mod.rs convention
  • C#: namespace-to-path with progressive prefix stripping
  • PHP: PSR-4 backslash-to-slash mapping, require/include path resolution

Directory scanning uses early pruning of .git, node_modules, dist, build, vendor, target, and other common non-source directories.

Project root detection

For deps, dependents, impact, and graph, the tool auto-detects the project root by walking up the directory tree looking for .git, package.json, or pyproject.toml. Override with --root:

sh
syms deps src/app.py --root /path/to/project

Limitations

  • Convention-based resolution — dependency resolution uses file path conventions, not compiler/build system integration. TypeScript/JavaScript paths from tsconfig.json/jsconfig.json are supported (including extends), but webpack/vite aliases defined outside tsconfig are not.
  • File-level granularity — dependencies are traced at the file level (import graph), not at the function or symbol level. There is no call graph.
  • C/C++ includes — #include parsing and header resolution are not yet implemented. Symbol extraction works, but dependency tracing does not.
  • Ruby/Scala/Bash — symbol extraction works via tree-sitter, but import parsing and dependency resolution are not implemented.
  • Dynamic imports — Python's importlib.import_module(), JavaScript's computed require(), and similar dynamic patterns are not detected.
  • Monorepo boundaries — the tool resolves imports within a single project root. Cross-package imports in monorepos may not resolve correctly.

License

MIT

來源:README.md,提交 84af4cc

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.3最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分