
sqry - Semantic Code Search
io.github.verivusOSS-releases由 GitHub 帳號 verivusOSS-releases 發布v4.8.16更新於 Oct 24, 2026
AST-based semantic code search: 33 tools, 35 languages, call tracing, impact analysis
概覽
本機語意程式碼搜尋伺服器,將原始碼解析為以 AST 為基礎的符號與關係圖,讓助理依結構、呼叫關係與影響範圍查詢程式碼。
- 可以做什麼
- 依種類、語言、可見性、名稱、回傳型別與引用搜尋並列出符號,支援結構化篩選與僅定義述詞。追蹤呼叫圖:呼叫者、被呼叫者、匯入、匯出、呼叫路徑、循環、未使用符號、重複項、影響分析、語意差異與聚焦子圖。在圖上執行宣告式規則包與結構形狀比對。分析跨語言 FFI 邊、Go 內容傳遞與 Rust 巨集邊界。產生一次性的儲存庫概覽,並將圖匯出為 Mermaid、Graphviz DOT 或 D2。以 MCP 資源形式提供自帶的參考文件與清單。
- 適用情境
- 當助理需要純文字搜尋無法可靠提供的程式碼庫結構答案時適用,例如誰呼叫了某個函式、某次變更會影響什麼、陌生儲存庫如何組織。最適合使用者願意先建立索引的本機儲存庫。
- 執行需求
- 以本機程序在使用者機器上執行(僅桌面端),以容器映像散布,可透過 shell 或 PowerShell 安裝腳本、Homebrew 或 Rust 原始碼建置安裝。目標儲存庫需先建立索引,會在 .sqry 目錄下寫入產物。從原始碼建置需要 Rust 1.94+ 與較大磁碟空間。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 sqry - Semantic Code Search,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
sqry
[MCP Registry] [crates.io] [License: MIT]
sqry is a local semantic code search tool. It parses source code into AST-backed symbol and relationship graphs so you can ask code questions that text search cannot answer reliably.
Everything runs on your machine. Indexing and querying make no network calls, and sqry sends no telemetry.
Website: https://sqry.dev
Current Capabilities
- 37 language plugins, 28 with full relation support and 9 with symbol extraction plus imports. By build cost, 29 are on the default fast path,
jsonis compiled but excluded by default as high-wall-clock, and 7 specialty plugins sit behind Cargo features. Thesqry://meta/manifestMCP resource reports these counts for the binary you have installed. - Structural queries over symbol kind, language, visibility, names, return types, references, and relations.
- Graph analysis for callers, callees, imports, exports, call paths, cycles, unused symbols, duplicates, impact, semantic diff, and focused subgraphs.
- Edge-backed
returns:<TypeName>and resolution-awareresolved_via:<kind>predicates for supported graph paths. See Call resolution predicates. - Cross-language FFI edges. The C, C++, C#, Elixir, Haskell, Kotlin, Lua, PHP, R, Ruby, and Rust plugins emit
FfiCalledges from mechanisms such asextern "C",DllImport/ P/Invoke, JNI, Ruby FFIattach_function, and R.Call/Rcpp. Query them withsqry graph cross-languageor thecross_language_edgesMCP tool. - Structural shape matching with
sqry shape-match, which finds functions with similar body structure independently of their identifiers. - A declarative rule layer.
sqry rules runexecutes shipped rule IDs and packs, or your own TOML rule packs, against the graph; therules_runMCP tool exposes the same engine. - Go context propagation analysis (
sqry context-propagation) for call sites that dropcontext.Context. - Rust macro-boundary analysis:
sqry cache expandbuilds a macro expansion cache,--expand-cachematerializes macro-generated symbols as searchable nodes, and--cfgmarks#[cfg]-gated symbols active or inactive. Both index-path options are execution-free and recorded in the index manifest, and every rebuild that persists reuses the record until--no-macro-options(orreset_macro_options) clears it:sqry index --force,sqry update,sqry watch, thesqry queryauto-index and--auto-rebuild, the daemon (sqry daemon rebuild, its file-watcher rebuilds, and its MCPrebuild_index), the LSP (sqry.index, its auto-index and self-heal), and the standalone MCP (rebuild_indexand its auto-index). Over an existing index they need--force. A relative--expand-cacheresolves against your working directory; the MCPexpand_cachefield resolves against the directory itspathargument names (that directory, or a file's parent directory), anddaemon/rebuildagainst the workspace it rebuilds. The directory must exist, and one whose canonical path is not valid UTF-8 is refused, because the manifest records it as JSON text.--cfgrefuses an empty or blank value, and one with leading or trailing whitespace. - Visualization and export as Mermaid, Graphviz DOT, or D2 (
sqry visualize,sqry export). - An interactive shell (
sqry shell) and batch runner (sqry batch) that keep the session cache warm across many queries. - Index refresh with
sqry updateandsqry watch, each a full rebuild that reuses the plugin selection and macro options the index records (no command re-indexes only the changed files). - Workspace-aware indexing through
.sqry-workspaceregistries and VS Code.code-workspacesqry.workspaceblocks. - Daemon-backed shared graph loading through
sqrydfor editor, MCP, and repeated-agent workflows. - One-shot repository orientation with
sqry overview(and the matchinggenerate_overviewMCP tool for agents): a single report of the load-bearing hubs, path/package subsystems, complexity hotspots, potential issues, and ready-to-run follow-up queries. - MCP integration for AI assistants. Standalone
sqry-mcpcurrently exposes 39 tools; daemon-hosted MCP exposes a 17-tool subset. Usetools/list,sqry-mcp --list-tools, orsqry://meta/manifestas the authoritative catalog. - LSP and VS Code extension support for editor workflows.
When To Use sqry
Use sqry when you need structural answers:
Use ripgrep for simple text search, ast-grep for syntax rewrite patterns, language linters for policy enforcement, and an IDE language server for full editor semantics. sqry stays focused on local semantic code search.
Install
Linux And macOS
The shell installer downloads release assets, verifies SHA256 checksums by default, and installs:
sqrysqry-mcpsqry-lspsqryd
Supported release platforms are Linux x86_64/arm64 (glibc and musl builds), macOS x86_64/arm64, and Windows x86_64.
Useful options:
--verify-signatures requires gh or Cosign. It verifies the current release-artifacts.attestation.json GitHub artifact attestation from release-distribute.yml; older releases can still fall back to legacy per-asset Cosign bundles. SHA256 verification remains the default integrity check.
Windows
The PowerShell installer downloads the Windows x86_64 release ZIP, verifies checksums by default, and installs sqry.exe, sqry-mcp.exe, sqry-lsp.exe, and sqryd.exe into the user install directory.
Use a pinned release when reproducibility matters:
Homebrew
Homebrew is the package-manager surface currently backed by the public release manifest.
The formula installs sqry, sqry-mcp, sqry-lsp, and sqryd for Linux x86_64/arm64 and macOS x86_64/arm64.
Scoop, Winget, AUR, Nix, and Snap are not advertised as public release assets until their release-control surfaces are complete and validated.
Build From Source
Requirements:
- Rust
1.94+with Edition 2024. - The repository pins toolchain
1.94.1inrust-toolchain.toml. - A full workspace build compiles the bundled tree-sitter grammars and language plugins and can require substantial disk space.
Agent Setup
Two steps connect the installed binaries to a coding agent. Run them in this order: MCP gives the agent the tools, the skills tell it when to reach for them.
1. Wire The MCP Server
Pass --scope global unless you specifically want a per-project entry. See MCP And Editors for what the scopes do and how to preview a change before it is written.
Once an agent is connected, sqry-mcp serves its own reference material as MCP resources (sqry://docs/tool-guide, sqry://docs/query-syntax, sqry://docs/patterns, sqry://docs/architecture, sqry://docs/capability-map, sqry://meta/manifest). Those ship inside the binary and version with it, so the tool reference an agent reads cannot drift from the tools it can actually call.
2. Add The Agent Skills
The skills are what teach an agent to reach for sqry mid-task instead of falling back to text search. That routing judgement is the part no amount of tool documentation supplies, which is why it is a separate artifact from the MCP resources above.
They live in verivus-oss/sqry-skills, which publishes eight: sqry-semantic-search, the core routing skill, plus one each for Claude Code, Codex, Gemini CLI, Grok, OpenCode, Antigravity, and Mistral Vibe.
That repository root is also a Claude-compatible plugin, registering the skills, sqry-mcp, and sqry-lsp together. Clone it into the plugin directory your agent reads, or point the agent at a checkout:
For the skills on their own, without the plugin wiring:
Per-agent paths and a doctor.sh health check are documented in that repository's README. Neither the shell installer nor the Homebrew formula stages the skills today, so this step is manual.
First Index
Index artifacts live under .sqry/. Add .sqry/ and legacy .sqry-index artifacts to your project ignore rules unless you intentionally share them.
Index Validation
--validate takes off, warn (default), or fail. Under fail a stale index aborts with exit code 2 instead of returning results computed from it, which is what makes it usable as a CI gate. --auto-rebuild makes fail rebuild a stale index once and then run on it; under warn and off it does nothing. The command's own arguments (the pattern, the query in every form, --var, the fuzzy algorithm) are checked before that rebuild, so an argument the command refuses leaves the index as it was. The one threshold is --threshold-orphaned-files RATIO (0.0 to 1.0, default 0.20): validation trips when more than that share of the indexed files no longer exists on disk, so --threshold-orphaned-files 0.5 tolerates half the files going missing and 0 tolerates none.
Note the limit: these are global flags, but validation runs only for the sqry search and sqry query subcommands (not the sqry <pattern> shorthand, and not a revision query, which reads a revision the daemon holds). Passing them to sqry index when an index already exists does not trigger a validation pass.
--metrics-format prometheus emits OpenMetrics-compatible text for scraping index status.
Plugin Selection
sqry records the plugin set that built an index so later graph-loading commands reuse the same semantics.
The registry has fast plugins, high-wall-clock plugins, and optional specialty plugins. json is high-wall-clock. Optional specialty plugins include apex, abap, servicenow-xanadu-js, servicenow-xml, terraform, puppet, and pulumi when compiled with the matching Cargo features or specialty-plugins.
See Indexing for artifact cleanup, plugin tiers, and high-cost behavior.
Query Examples
returns:<TypeName> uses graph TypeOf{Return} edges.
Call Resolution Predicates
resolved_via:<kind> filters call edges by what kind of binding produced the edge. That is a different question from how confident the resolver is: a duck_typed edge is not a low-confidence direct edge, it is a record that the call was bound by Python duck typing rather than by a syntactic reference. Knowing the mechanism lets you separate calls the compiler could have checked from calls that only resolve at runtime.
The parser accepts eight values:
framework filtering is exposed as a typed MCP parameter. The planner also parses framework:<id>, but framework-route metadata is only populated where extractors have run. Treat a non-match as absent metadata, not proof that a framework is unused.
See Advanced Analysis for graph predicates, snapshot wording, impact analysis, semantic diff, and visualization.
Workspaces
Use a workspace when one logical project spans several repositories or folders.
Workspace configuration can come from a .sqry-workspace registry or a VS Code .code-workspace file with a sqry.workspace block. See Workspaces.
Daemon
sqryd keeps graph state warm for repeated CLI, LSP, MCP, and editor workflows.
See Daemon Mode.
MCP And Editors
Configure MCP clients with:
--scope defaults to auto, which resolves to a per-project Claude Code entry when the working directory sits inside a repository, and errors when it does not. Pass --scope global for a machine-wide entry, or --scope project from inside the repository you want pinned. Codex and Gemini CLI only support global configuration, so the two scopes behave identically for them and workspace resolution follows the directory the tool is started from. sqry mcp setup --dry-run prints the changes without writing them, and sqry mcp status reports what is currently configured.
Standalone sqry-mcp is the full local tool surface. sqry-mcp --daemon attaches to sqryd and exposes the daemon-hosted subset. workspace_status.source_root_id is an opaque display/correlation token, not a path. See MCP Guide and the component docs in sqry-mcp/README.md.
MCP search tools keep string predicates and structured JSON parameters separate:
Use items:true or is_definition:true in query for definition-only query predicates. When calling list_symbols, use the structured items_only parameter:
If a graph was built before the V16 definition-signal snapshot format, definition-only query predicates and list_symbols.items_only return a reindexRequired / reindex-required advisory rather than trusting stale marker data.
For the VS Code extension, see sqry-vscode/README.md and sqry-vscode/USER_GUIDE.md.
User Guides
- Quick Start
- User Guide Index
- Indexing
- Workspaces
- Daemon Mode
- MCP Guide
- Query Languages
- Repository Overview
- Rules
- Context Propagation
- Doctor
- Revision-Aware Workspaces
- Advanced Analysis
- Structural Shape Matching
- Visualization
Security And Supply Chain
- Release artifacts carry a GitHub OIDC keyless attestation, published as the
release-artifacts.attestation.jsonasset and verifiable withgh attestation verifyor Cosign.SHA256SUMS.txtships alongside, and both installers verify checksums by default. - Each release also publishes a release manifest and a release ledger asset recording the stages the build passed through.
- Dependencies are gated in CI by
cargo-vet(importing the Mozilla, Google, Bytecode Alliance, and ISRG audit sets),cargo-deny, andcargo-audit. Clippy runs as-D warnings. - The query planner's text parser is fuzzed nightly with
cargo-fuzz.cargo-mutantsruns on changed lines per PR and against a canary-crate baseline on master; it currently reports rather than blocks. - SBOMs (CycloneDX and SPDX) and OpenVEX documents are generated by a separate workflow.
Do not assume an artifact is present unless it appears in the asset list for the release you are installing. To report a vulnerability, see SECURITY.md.
Project Scope
sqry is an MIT-licensed open-source project focused on one product goal: local semantic code search. It is not a hosted search platform, linter, IDE replacement, or general metrics platform.
來源:README.md,提交 8f139a6
工具
0版本歷史
1- v4.8.16最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分