sqry-claude
Original:🇺🇸 English
Translated
Setup and workflow for using sqry semantic code search as an MCP server with Claude Code. Covers installation, MCP configuration, tool naming conventions, and recommended search patterns. Install this skill to give Claude Code full access to sqry's 34 AST-based code analysis tools.
17installs
Sourceverivus-oss/sqry-skills
Added on
NPX Install
npx skill4agent add verivus-oss/sqry-skills sqry-claudeTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →sqry for Claude Code
This skill configures Claude Code to use sqry's MCP server for AST-based semantic code search across 37 languages.
Setup
1. Install sqry
bash
# Recommended: signed release installer
curl -fsSL https://raw.githubusercontent.com/verivus-oss/sqry/main/scripts/install.sh | bash -s -- --component all
# Fallback: build from source
cargo install sqry-cli
cargo install sqry-mcp
# Alternative package manager
brew install verivus-oss/sqry/sqry2. Index your project
bash
cd /path/to/your/project
sqry index .3. Configure MCP server
Recommended:
bash
sqry mcp setup --tool claude
sqry mcp statusThis writes a Claude Code entry in or
pointing to . Claude defaults to per-project configuration with
pinned to the current repository.
.claude.json~/.claude.jsonsqry-mcpSQRY_MCP_WORKSPACE_ROOTManual config example:
json
{
"mcpServers": {
"sqry": {
"type": "stdio",
"command": "/absolute/path/to/sqry-mcp",
"env": {
"SQRY_MCP_WORKSPACE_ROOT": "/path/to/your/project"
}
}
}
}4. Verify
After restarting Claude Code, tools should appear with the prefix. Test with:
mcp__sqry__"Use sqry to show graph stats for this project"
This should invoke and return node/edge counts.
mcp__sqry__get_graph_statsSkill Dependency
This skill covers Claude Code setup and integration patterns. Also load the skill for tool selection guidance, query syntax, and disambiguation strategies.
sqry-semantic-searchsqry-semantic-search uses tiered discovery to save tokens: it loads a compact Quick Tool Selection guide first. If you need full parameter details, load . For advanced workflows (security audit, pre-change analysis), load . Only load what you need.
sqry-semantic-search/references/tool-reference.mdsqry-semantic-search/references/workflows.mdQuick Tool Selection
I know the symbol name and want to...
- See its definition →
mcp__sqry__get_definition - See who calls it → (depth=1) or
mcp__sqry__direct_callers(multi-depth)mcp__sqry__relation_query - See what it calls →
mcp__sqry__direct_callees - See what breaks if I change it →
mcp__sqry__dependency_impact - Understand it with context →
mcp__sqry__explain_code
I want to search for symbols...
- By name substring →
mcp__sqry__pattern_search - By kind/visibility/language →
mcp__sqry__semantic_search - With RAG-optimized grouping →
mcp__sqry__hierarchical_search
I want to analyze the codebase...
- Circular dependencies →
mcp__sqry__find_cycles - Dead code →
mcp__sqry__find_unused - Change impact →
mcp__sqry__dependency_impact - Trace call path A→B →
mcp__sqry__trace_path
Handling Ambiguous Symbols
When using , , or with common names (, , , , ), the tool may fail or return wrong results.
mcp__sqry__direct_callersmcp__sqry__direct_calleesmcp__sqry__call_hierarchyhandlenewinitprocessrunAlways disambiguate by providing :
file_pathjson
{
"symbol": "handle",
"file_path": "src/api/router.rs"
}Or use a qualified name:
"symbol": "UserService::authenticate"If relation tools fail, fall back to with a filter to scope results.
mcp__sqry__get_referencespathTool Naming in Claude Code
All sqry MCP tools use the prefix in Claude Code:
mcp__sqry__mcp__sqry__semantic_search
mcp__sqry__relation_query
mcp__sqry__dependency_impact
mcp__sqry__explain_code
mcp__sqry__trace_path
mcp__sqry__find_cycles
...Recommended CLAUDE.md Addition
Add this to your project's to guide Claude on when to use sqry:
CLAUDE.mdmarkdown
## Code Search
Use sqry MCP tools (`mcp__sqry__*`) as the default for semantic code search:
- `mcp__sqry__semantic_search` - Find symbols by meaning
- `mcp__sqry__hierarchical_search` - RAG-optimized search with grouping
- `mcp__sqry__relation_query` - Find callers, callees, imports
- `mcp__sqry__explain_code` - Understand a symbol with context
Use Grep for literal text search. Use Glob for file finding. Use sqry for everything structural.Workflow
- Search first: Use or
mcp__sqry__semantic_searchbefore reading files manually.mcp__sqry__hierarchical_search - Understand before changing: Call before modifying shared code.
mcp__sqry__dependency_impact - Trace relationships: Use and
mcp__sqry__direct_callersto understand call chains.mcp__sqry__direct_callees - Verify after changes: Use to compare before/after at the symbol level.
mcp__sqry__semantic_diff
Common Claude Code Patterns
Find a function and its callers
User: "Who calls the authenticate function?"
Claude uses: mcp__sqry__relation_query
symbol: "authenticate"
relation_type: "callers"
max_depth: 2Understand impact before refactoring
User: "What would break if I change UserService?"
Claude uses: mcp__sqry__dependency_impact
symbol: "UserService"
max_depth: 3
include_indirect: trueExplore unfamiliar code
User: "Help me understand the auth module"
Claude uses:
1. mcp__sqry__semantic_search query: "path:src/auth"
2. mcp__sqry__explain_code file_path: "src/auth/mod.rs", symbol_name: "authenticate"
3. mcp__sqry__subgraph symbols: ["authenticate", "verify_token"]Recent Features (since v6.0)
Plugin cost tiering
- Plugins classified as (default) or
FastHighWallClock - High-cost plugins (JSON, ServiceNow XML) excluded from default index
- CLI: /
--include-high-cost,--exclude-high-cost/--enable-plugin ID--disable-plugin ID - Env:
SQRY_INCLUDE_HIGH_COST=1
Time-expensive MCP operations
- : 10min timeout, full graph rebuild -- only when index stale
rebuild_index - : creates git worktrees + indexes -- scope with file/kind filters
semantic_diff - ,
find_cycles: can timeout on large graphs -- scope to filescomplexity_metrics - : quadratic scaling -- filter by file/language/kind
find_duplicates - depth>2,
call_hierarchydepth>3: exponential growthdependency_impact
Macro boundary analysis (Rust)
- CLI: ,
sqry cache expand,--enable-macro-expansion,--cfg,--cfg-filter,--include-generated--macro-boundaries - MCP: tool, macro metadata in search/definition results
mcp__sqry__expand_cache_status
JVM classpath analysis
- CLI: ,
--classpath,--classpath-depth--classpath-file - MCP: parameter on search tools,
include_classpathfield in resultsprovenance
Security defaults
- MCP redaction preset now by default (was
"minimal")"none" - Override:
SQRY_REDACTION_PRESET=none - Index timeout: 600s, query timeout: 60s
Other
- 37 language plugins (added JSON, ServiceNow XML)
- Snapshot format V7 -- rebuild index on major version upgrade
- Multi-root VS Code workspace support
Troubleshooting
- No tools visible: Restart Claude Code after running
sqry mcp setup --tool claude - Empty results: Run to build/rebuild the index
sqry index . - Stale results: Run to force rebuild
sqry index --force . - Snapshot version mismatch: Run after major upgrades
rm -rf .sqry/graph && sqry index . - Missing JSON/ServiceNow symbols: Rebuild with
sqry index --include-high-cost - Check health: Ask Claude to call
mcp__sqry__get_index_status