Semantic + structural code search MCP server for AI-native development.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
๐ก Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
semantic grep for AI coding agents
sensegrep understands your code semantically. Instead of matching text patterns, it uses AI embeddings and tree-sitter AST parsing to find code by meaning - so you can search for "authentication logic" and actually find your auth functions, even if they never contain the word "authentication".
AI agents should not read more code, they should read the right code. sensegrep combines semantic search, exact matching, and AST-aware structural retrieval to deliver smaller, more relevant context.

MP4 fallback: assets/time-to-value.mp4
Watch full product demo (25s): assets/time-to-value-full.mp4
Traditional search tools (grep, ripgrep, ast-grep) match text patterns. sensegrep matches concepts:
| Feature | grep/ripgrep | ast-grep | sensegrep |
|---|---|---|---|
| Exact text match | Yes | Yes | Yes (via --pattern) |
| AST-aware | No | Yes | Yes (tree-sitter) |
| Semantic search | No | No | Yes (AI embeddings) |
| Symbol metadata filters | No | Partial | Yes (30+ filters) |
| Duplicate detection | No | No | Yes (logical duplicates) |
| Tree-shaking output | No | No | Yes (collapse irrelevant code) |
| MCP server for AI agents | No | No | Yes |
The fastest way to get sensegrep into Claude Code โ zero configuration:
This automatically sets up the MCP server and teaches Claude when and how to use sensegrep instead of grep. No manual JSON editing required.
Marketplace setup (required on first install):
After the marketplace has been added once, the explicit marketplace form also works:
Running
claude plugin install sensegrep@sensegrepon a fresh machine beforeclaude plugin marketplace add Stahldavid/sensegrepwill fail because Claude Code does not know thesensegrepmarketplace yet.
Agent-facing JSON is minified and minimal by default. Opt into --json-detail content,
--diagnostic, --json-detail full, or --pretty only when that additional payload is needed.
Schema v2 uses one card vocabulary across transports: id, file, lines, symbol,
kind, rank, and relevance. Minimal output keeps retrieval sufficiency, compact index
state, and structured warnings; budgets appear only when constrained. Physical output
budgets apply to the final serialized JSON and retain a partial evidence card when possible.
Duplicate JSON excludes source code unless --show-code is supplied. Survey and cluster
JSON default to actionable summary mode with representative IDs.
Install from the Cursor marketplace or via CLI:
Includes the MCP server, an always-on rule to prefer sensegrep over grep, and a skill with full filter reference. Cursor plugin status: pending marketplace approval.
One-click MCP install link for Cursor:
Fallback deeplink (copy/paste if needed):
Install from the public marketplace โ no manual config:
See the Codex recipe for the manual ~/.codex/config.toml setup.
Add to your MCP configuration:
Or with npm global install first:
The MCP server provides canonical sensegrep_search, sensegrep_show, sensegrep_literal, sensegrep_context, sensegrep_survey, sensegrep_cluster, sensegrep_graph, sensegrep_index, and sensegrep_detect_duplicates tools. Legacy dotted names such as sensegrep.search remain available as compatibility aliases where supported.
For terminal-first agents or CI, you don't need an MCP server. Install the CLI and the
sensegrep-cli Agent Skill, which teaches the agent to run
sensegrep commands directly:
See docs/agent-skills.md for when to use the MCP tools vs the CLI skill.
Search for "Sensegrep" in the VS Code marketplace, or install from the extension page.
Features: semantic search sidebar, duplicate detection, code lens, semantic folding, and multi-root auto-indexing/watch mode.
Copy-paste setup and practical workflows:
Full index: docs/recipes/README.md
<script> / <script setup> semantic support)sensegrep supports 30+ structural filters that can be combined with semantic search:
Graph nodes use canonical file/range identities. Ambiguous same-name call targets are omitted instead of expanded into speculative impact edges.
Diagnostic commands are strictly read-only. An incompatible index reports migrationRequired: true; rebuild it with sensegrep index migrate --no-watch. Full builds stage and validate a new Lance table before switching metadata, while prior generations are retained for concurrent readers and rollback diagnostics.
Changed files reuse vectors for content-identical chunks, even when neighboring chunks or metadata changed. Full indexes checkpoint staging tables and skip IDs already persisted after a restart. For large indexes, LanceDB ANN and scalar indexes are created automatically at 10,000 chunks; set SENSEGREP_ANN_MIN_CHUNKS=0 to disable or choose another threshold.
Language support can be extended without modifying core. A plugin exports a LanguageSupport object (default, language, or languages[]) with its extensions and optional chunk(content, filePath) implementation. Add project-relative ESM modules or package names to languagePlugins in sensegrep.config.json, or set SENSEGREP_LANGUAGE_PLUGINS to a comma-separated list.
sensegrep supports local Ollama by default plus Gemini, OpenAI-compatible APIs, and Amazon Bedrock. If no API key or provider is configured, it defaults to Ollama at http://127.0.0.1:11434 with qwen3-embedding:0.6b (1024 dimensions, 32K context). Run sensegrep selftest --root . before indexing to confirm the selected provider/model/dimension and credential/endpoint guidance without making embedding calls.
Local OpenAI-compatible embedding servers also work if they implement /v1/embeddings; set SENSEGREP_PROVIDER=openai, SENSEGREP_OPENAI_BASE_URL to the server's /v1 base URL, and SENSEGREP_EMBED_DIM to the exact returned vector dimension. For native Ollama, use SENSEGREP_PROVIDER=ollama, SENSEGREP_OLLAMA_BASE_URL if not using the default, and the exact SENSEGREP_EMBED_DIM for your Ollama model.
Global defaults via ~/.config/sensegrep/config.json:
Common environment variables:
SENSEGREP_PROVIDER (ollama, gemini, openai, bedrock)SENSEGREP_EMBED_MODELSENSEGREP_EMBED_DIMSENSEGREP_OLLAMA_BASE_URL (Ollama, default http://127.0.0.1:11434)GEMINI_API_KEY / GOOGLE_API_KEY (Gemini)SENSEGREP_OPENAI_API_KEY / FIREWORKS_API_KEY / OPENAI_API_KEY (OpenAI-compatible)SENSEGREP_OPENAI_BASE_URL (OpenAI-compatible, default https://api.fireworks.ai/inference/v1)SENSEGREP_OPENAI_BATCH_SIZE (OpenAI-compatible request batch size)SENSEGREP_OPENAI_CONCURRENCY / SENSEGREP_EMBED_CONCURRENCY (provider request concurrency)SENSEGREP_INDEX_EMBED_CONCURRENCY (concurrent index embedding batches)SENSEGREP_QUERY_CACHE (true by default; set false for controlled benchmarks or sensitive environments)SENSEGREP_QUERY_CACHE_TTL_MS / SENSEGREP_QUERY_CACHE_MAX_ENTRIES (persistent query-vector cache bounds)SENSEGREP_ADAPTIVE_HYBRID_DELAY_MS / SENSEGREP_ADAPTIVE_HYBRID_MIN_SCORE (adaptive hybrid tuning)SENSEGREP_ANN_MIN_CHUNKS (automatic ANN threshold; 0 disables)SENSEGREP_PROFILE (named side-by-side index profile)SENSEGREP_LANGUAGE_PLUGINS (comma-separated ESM language plugins)SENSEGREP_OPENROUTER_REFERER / SENSEGREP_OPENROUTER_TITLE (optional OpenRouter attribution headers)SENSEGREP_BEDROCK_API_KEY (Amazon Bedrock bearer API key; omit when using the AWS SDK credential chain)SENSEGREP_BEDROCK_REGION / AWS_REGION / AWS_DEFAULT_REGION (Amazon Bedrock)SENSEGREP_ROOT (MCP root directory)SENSEGREP_WATCH (MCP watcher toggle)For the complete and official runtime variable list, see docs/mcp-setup.md.
OpenRouter Qwen embeddings use one provider request at a time by default. Benchmarking on
high-latency endpoints commonly shows that additional concurrent requests reduce throughput;
use sensegrep benchmark --concurrency 1,2,4 --json before overriding the default.
Each index records the embedding provider, model, dimension, distance metric, and a non-secret endpoint/configuration fingerprint. If you change provider, model, base URL, dimension, local server pooling behavior, or task-prefix strategy, rebuild the index with sensegrep index --root . --full --no-watch. Same dimension does not make embeddings interchangeable; two 768-dimensional models still produce different vector spaces.
More embedding providers and API integrations may be added in the future.
| Package | Description | npm |
|---|---|---|
| @sensegrep/core | Search engine library | |
| @sensegrep/cli | Command-line interface | |
| @sensegrep/mcp | MCP server for AI agents | |
| sensegrep | VS Code extension | Marketplace |
| sensegrep-plugin | Claude Code plugin | claude plugin marketplace add Stahldavid/sensegrep && claude plugin install sensegrep |
| sensegrep-cursor | Cursor plugin | cursor plugin install sensegrep |
| sensegrep (Codex) | Codex plugin | codex plugin marketplace add Stahldavid/sensegrep && codex plugin install sensegrep |
Reproducible qualitative examples from public repositories:
ripgrep / ast-grep is scheduled for Month 2.See the architecture guide for runtime and persistence design, and CONTRIBUTING.md for development setup and contribution guidelines. The VS Code extension stores provider API keys in VS Code SecretStorage; workspace settings contain only non-secret configuration.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/sensegrep)<a href="https://allmcps.com/mcp/sensegrep"><img src="https://allmcps.com/api/badge/sensegrep?style=directory" alt="Sensegrep on AllMCPs" /></a>