dev-tools 5 min read

sqry – Semantic Code Search Using AST Patterns

sqry is an open-source Rust CLI and MCP server that parses codebases into AST-backed symbol graphs, letting you query by function kind, visibility, return type, call paths, and more.

By
Share: X in
sqry semantic code search interface

TL;DR

TL;DR: sqry is an open-source Rust tool that parses source code into AST-backed symbol graphs, letting you run structural queries — kind:function, returns:Result, graph direct-callers — that text search cannot answer. Ships as a CLI, MCP server, and LSP plugin.

Source and Accuracy Notes

⚠️ This section is MANDATORY. All links must be verified from actual source, not guessed.

What Is sqry?

sqry (pronounced “squiry”) is a local semantic code search engine built in Rust. Unlike grep-based text search or vector embedding tools, sqry parses code into an Abstract Syntax Tree and builds a symbol relationship graph. This lets you ask structural questions about your codebase: what functions return a specific type, which public APIs are unused, or what call paths connect two functions.

The project was created by Verivus and is licensed under MIT.

Key Features

From the sqry README:

  • Structural queries over symbol kind, language, visibility, names, return types, references, and relations
  • Graph analysis: callers, callees, imports, exports, call paths, cycles, unused symbols, duplicates, impact, semantic diff
  • returns:<TypeName> and resolved_via:<kind> predicates for supported graph paths
  • sqry overview: single-shot repository orientation report showing load-bearing hubs, path/package subsystems, complexity hotspots, and ready-to-run follow-up queries
  • MCP integration with 39 standalone tools and a 17-tool daemon-hosted subset for AI assistant workflows
  • LSP and VS Code extension support for editor workflows

Setup Workflow

Step 1: Install on Linux and macOS

curl -fsSL https://raw.githubusercontent.com/verivus-oss/sqry/main/scripts/install.sh | bash -s -- --component all

The installer downloads release assets and verifies SHA256 checksums.

Step 2: Index a Repository

sqry index .

This parses the codebase and builds the symbol graph locally.

Step 3: Query Structure

# Find public Rust functions returning Result
sqry query "kind:function AND visibility:public AND lang:rust AND returns:Result"

# See who calls authenticate
sqry graph direct-callers authenticate

# Trace the call path from main to handle_request
sqry graph trace-path main handle_request

# Visualize callers of a function as a Mermaid diagram
sqry visualize "callers:authenticate" --format mermaid

Step 4: Orient in an Unfamiliar Repo

sqry overview

This generates a single report covering load-bearing hubs, path/package subsystems, complexity hotspots, and suggested follow-up queries.

Step 5: Use with an MCP-Compatible AI Assistant

Install the MCP server for use with Claude Code, Codex, or Cursor:

sqry-mcp --list-tools   # list available MCP tools

The MCP manifest is available at sqry://meta/manifest.

Deeper Analysis

sqry fills a specific gap between ripgrep (plain text search) and full IDE language servers (full semantic analysis). The README explicitly positions it as complementary:

  • Use ripgrep for simple text search
  • Use ast-grep for syntax rewrite patterns
  • Use language linters for policy enforcement
  • Use an IDE language server for full editor semantics
  • Use sqry for local semantic code search — structural queries over symbol graphs

The daemon-backed sqryd enables shared graph loading across editor sessions and repeated agent workflows, which is useful for AI coding assistants that need to query the same codebase across multiple interactions.

The MCP server exposes 39 tools in standalone mode, making it a strong fit for agentic AI workflows that need to understand code structure before making changes.

Practical Evaluation Checklist

  • [x] Open-source MIT licensed (verified via README badge)
  • [x] Active repository (pushed 2026-08-05, 27 stars on GitHub)
  • [x] Cross-platform CLI (Linux/macOS via shell installer)
  • [x] MCP server integration for AI assistants
  • [x] LSP and VS Code extension available
  • [x] No external service required — fully local
  • [x] Structured query language vs plain text search

Security Notes

sqry runs entirely locally. There is no cloud component, no telemetry, and no external network calls for the core indexing and search operations. As a Rust binary with no runtime dependencies, the attack surface is minimal.

FAQ

Q: How is sqry different from ripgrep? A: ripgrep searches text patterns in files. sqry parses code into an AST and builds a symbol graph, letting you query by kind, visibility, returns:<Type>, and relationship-based predicates like direct-callers. Text search cannot answer structural questions.

Q: Does sqry require a running service? A: The CLI works standalone. The MCP server (sqry-mcp) runs as a daemon (sqryd) for shared graph loading across editor sessions and repeated agent workflows.

Q: Which languages are supported? A: sqry supports multiple languages through tree-sitter parsers. The exact supported language list is determined by the tree-sitter grammars available at query time.

Conclusion

sqry is a focused, well-scoped tool for developers who need structural code answers without spinning up a full language server or IDE. Its MCP integration makes it particularly useful for AI-assisted coding workflows. The MIT license and fully local execution model are strong differentiators for security-conscious teams.

Source: sqry.dev | GitHub: verivus-oss/sqry | MIT License