Skip to main content Switch to mobile version indexed-sh 0.1.1 CLI and MCP server for semantic document search with AI agent integration
pip install indexed-sh==0.1.1 Copy PIP instructions
One local knowledge base per project. Code, docs, issues, wikis — one MCP, zero cloud.
Quickstart · Documentation · Blog & Guides
Local-first semantic search for AI agents. Give Claude Code, Cursor, Codex, and other MCP-compatible agents deep context over your codebase, docs, issues, and wikis — no source read in isolation.
Privacy-first — all processing and storage happens locally, no data sent to third parties
Semantic search — understands meaning, not just keywords, using a LlamaIndex-powered engine with optional cross-encoder reranking
Multiple sources — local files (25+ formats), Jira, Confluence, Outline Wiki, and GitHub (issues, PRs, Projects v2)
MCP integration — works with Claude Code, Cursor, Windsurf, Cline, and other MCP-compatible agents
LSP integration — indexed lsp serves the same index to any editor: search it from the symbol palette, hover a file to see what the index knows, jump to the definition the index has seen, list the places it has seen a name, and get diagnostics that say only what the index can prove — this file is not in any collection, or the index holds an older version of it (VS Code, Neovim, Zed, Helix)
Incremental updates — keep your index fresh with git-based change tracking
# 1. Install indexed globally uv tool install indexed-sh # 2. One-time setup: fetch the embedding model indexed init # 3. Create a collection from local files indexed index create files --collection my-project --path ./src # 4. Search your collection indexed index search "your query" # 5. Or take the machine payload (the MCP tools return the same object) indexed index search "your query" --json What the first run downloads. Indexed fetches the embedding model sentence-transformers/all-MiniLM-L6-v2 — about 88 MB of weights and tokenizer — into the HuggingFace cache (~/.cache/huggingface, override with HF_HOME). Skipping indexed init only moves that download into the first index create; after that every command reads from the cache and works offline (HF_HUB_OFFLINE=1).
On success, --json prints one object with a schema id, documents grouped, and a locator per hit. Check the CLI exit code before parsing stdout; escaping errors can print a non-JSON error panel, and exit 0 can still contain an error body. This excerpt keeps values from a real collection; the second hit is elided, which is why counts.hits says 2:
{ "schema": "indexed.search/1", "query": "how are failed requests retried", "counts": { "documents": 1, "hits": 2 }, "collections": ["docs-quick"], "collection_errors": [], "sources": [ { "collection": "docs-quick", "source_type": "localFiles", "status": "ok", "hits": 2 } ], "documents": [ { "collection": "docs-quick", "source_type": "localFiles", "id": "retry.md", "path": "/var/lib/srv/hermes/profiles/prism/cache/scratch/docs-retry-min/retry.md", "score_kind": "l2_squared", "hits": [ { "relevance": 0.6003, "score": 0.7995, "locator": { "kind": "headings", "headings": ["Retry policy"] }, "text": "Retry policy\nRequests are retried three times with exponential backoff. A 429 response resets the backoff window instead of failing the call." } ] } ] } Full field list: docs/reference/search-output.md. Every hit in that payload also carries ref, an opaque token for that exact chunk. indexed index expand "" --before 1 --after 1 (or the MCP expand tool) returns the match plus a bounded window of neighbours, and refuses a reference whose chunk no longer holds the text it was issued for — see docs/reference/expand-output.md.
Indexed pre-computes a semantic search index over your code, docs, and project tools, then exposes it via MCP. The result: instant, relevant context retrieval without the token overhead.
Not just search. A single index over one source is the easy part — every RAG toolkit does that. The hard, useful part is that no single source has the answer: code doesn't explain why, a ticket doesn't show what shipped, history doesn't say if it's still true. Indexed's direction is one merged knowledge base per project — code, docs, issues, and wikis tied together, not five indexes you query separately. See docs/spec/concepts/vision.md for where this is headed (structural graph relationships, graph-aware retrieval, optional local-model-driven merging).
Not just code. Index Markdown, PDFs, DOCX, PPTX, images, and 25+ formats via Docling. AST-aware code chunking via tree-sitter.
Not just local files. Native Jira, Confluence, Outline Wiki, and GitHub connectors pull tickets, pages, issues, and PRs into your index.
Not cloud-dependent. Runs entirely on your machine. Local embedding models, FAISS or LlamaIndex-managed vector storage. No API keys required.
Not one-shot. Incremental updates via indexed index update keep your index fresh as your sources evolve.
Indexed exposes a Model Context Protocol server for AI agent integration.
Repository scope (MCP roots)
One server can serve several agents at once, so scope is per request: the server asks the client which directories it is working in (MCP roots), reads the committed indexed.toml at that repository root, and searches exactly that selection from the global store. The server's own working directory is never scope, so two clients in two repositories get two different, correct answers.
A request that cannot be placed fails closed and says why:
The remedy is a committed definition — indexed storage migrate writes one at the repository root, or write it yourself:
version = 1 [collections] use = ["my-docs"] A client that does not advertise MCP roots cannot use the server; the error envelope above is what it receives instead of another project's collections.
Claude Code (CLI, VS Code, JetBrains)
Works across all Claude Code surfaces — CLI, VS Code extension, and JetBrains plugin. One command registers the MCP server, installs the index-use skill and adds a PreToolUse hook that nudges Claude away from Grep/Glob toward semantic search:
indexed install claude-code # server + skill + hook indexed install claude-code --dry-run # print the plan, write nothing indexed install claude-code --remove # undo exactly what it installed indexed install claude-code --home /data/agent-home # collections in /data/agent-home/.indexed It writes a user-scope server (available in every project) using the absolute path of the running indexed executable, and touches five files:
Everything else in those files — other servers, other hooks, projects, credentials — is preserved, and each rewritten file keeps a .bak beside it. Safe to run twice: an existing install is upgraded in place, never duplicated. --remove deletes only the artifacts above (and only ones it recognises as its own) and prunes the directories it emptied.
The hook is silent unless indexed actually has collections (the collections root this install points at, or a .indexed/collections.json workspace pointer), so it costs nothing on a machine that does not use indexed. It only adds context to Grep/Glob calls — it never approves, blocks or prompts, so your permission rules and directory prompts behave exactly as before. Set INDEXED_HOOK_LOG=/path/to/log to trace its firings.
Restart Claude Code, then use /index-use.
Manual alternative (registers the server only — no skill, no hook):
claude mcp add indexed -s user -- indexed mcp run To add it per project instead, create or edit .mcp.json in your project root:
{ "mcpServers": { "indexed": { "command": "indexed", "args": ["mcp", "run"] } } } The installed skill documents the indexed.search/1 result shape; the full contract is in docs/reference/search-output.md.
One command registers the MCP server, installs the index-use skill and adds a PreToolUse hook that nudges Codex away from shell grep/rg toward semantic search:
indexed install codex # server + skill + hook indexed install codex --dry-run # print the plan, write nothing indexed install codex --remove # undo exactly what it installed indexed install codex --home /data/agent-home # collections in /data/agent-home/.indexed It writes a user-scope server (available in every project) using the absolute path of the running indexed executable, into ~/.codex — or $CODEX_HOME when you set one:
config.toml is hand-edited TOML, so the installer edits it as text: only its own table block is ever written or deleted, and everything else — comments, spacing, projects, other servers — stays byte for byte. (This is deliberate: codex mcp add re-serialises the whole [mcp_servers] region and drops the comments inside it.) Files the command rewrote keep a .bak beside them, and running it twice upgrades in place rather than duplicating. --remove deletes only the artifacts above, only ones it recognises as its own, and puts the rest of config.toml back exactly as it was.
Codex does not run a hook until it is trusted. Rather than forge that state, the installer asks Codex for the hash it computed (codex app-server → hooks/list) and records it in config.toml — the same write Codex's TUI makes when you approve a hook. If codex is not on PATH, the install still completes and says the hook needs a one-time approval.
Codex has no Grep/Glob tool: it searches through the shell. So the installed hook watches Bash (and the platform equivalents), and when the command line looks like a recursive text search while indexed has collections, it adds a reminder pointing at mcp__indexed__search. It is silent for anything else — non-search commands, commands already using indexed, machines with no collections — and it never approves, blocks or prompts. Set INDEXED_HOOK_LOG=/path/to/log to trace its firings.
Restart Codex; the index-use skill is listed and the nudge hook runs on shell search commands.
codex mcp add indexed -- indexed mcp run The installed skill documents the indexed.search/1 result shape; the full contract is in docs/reference/search-output.md.
Same four commands, against OpenCode's own config dir ($OPENCODE_CONFIG_DIR, else $XDG_CONFIG_HOME/opencode, else ~/.config/opencode):
indexed install opencode # server + skill + context nudge indexed install opencode --dry-run # print the plan, write nothing indexed install opencode --remove # undo exactly what it installed indexed install opencode --home /data/agent-home # collections in /data/agent-home/.indexed Path What it owns opencode.json (or opencode.jsonc) the mcp.indexed server entry skills/index-use/SKILL.md the index-use skill plugins/indexed-nudge.js the context nudge plugin indexed-install.json the manifest: what was installed, by which version The server goes under the flat mcp.indexed key. This build normalises that into mcp.servers in memory, and public opencode 1.x only understands the flat form, so one file serves both. Tested against opencode v2.3.2 (@opencode/cli@2.3.2); the plugin API it uses is the 2.x one.
The config is hand-edited JSONC, and OpenCode never rewrites it — no command, not even loading a server, touches the bytes. So the installer splices text: only the indexed member is written or deleted, and comments, key order, indentation and CRLF endings all survive. --remove puts the file back byte for byte, and prunes the mcp block only if this install created it. Each file the command rewrites has a .bak of its previous contents beside it (last write only), and a second run upgrades in place rather than duplicating.
There is no hook-trust gate on this host: a plugin is a bare .js file in plugins/, which OpenCode imports and calls setup() on with no prompt, no hash and no approval marker. So there is nothing to approve after installing, and the command writes each file exactly once. The plugin registers one session.hook("context") handler and only ever appends a paragraph to the system prompt — it registers no permission or tool hook, so it cannot allow, deny or rewrite a tool call. It is silent when indexed has no collections, and every filesystem read is wrapped, so a broken install cannot break a session. Set INDEXED_HOOK_LOG=/path/to/log to append one JSON line per firing.
Code Mode is on by default in OpenCode, so the skill teaches await tools.indexed.search({ query: "..." }) (and tools.indexed.search_collection({...})) inside the execute tool, with the flat indexed_search named for codemode: false installs. The skill text is advertised from skills/index-use/SKILL.md; the directory name is the skill id.
Restart OpenCode; the index-use skill is advertised and the nudge plugin loads from plugins/.
opencode mcp add --global indexed -- indexed mcp run The installed skill documents the indexed.search/1 result shape; the full contract is in docs/reference/search-output.md.
Cursor / Windsurf / Other Agents
Add to your agent's MCP configuration file:
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
# HTTP server mode indexed mcp run --transport http --port 8000 Keeping an MCP server fresh
An MCP server is long-lived, so there is no per-collection command to run. Turn the index watch watcher on for the server with an opt-in switch (off by default — nothing changes if you don't set it):
[mcp] watch_enabled = true watch_debounce_seconds = 2.0 watch_poll_interval_seconds = 2.0 With it on, indexed-mcp run plans a watcher for every localFiles collection that exists at startup: an edit, new file or deletion shows up in search within roughly one poll (watch_poll_interval_seconds), one quiet period (watch_debounce_seconds) and the update pass itself — with no manual index update and no server restart. A startup catch-up pass also indexes edits made while the collection was not watched.
The watched set is fixed at startup: a collection created while the server is running is not watched, and is picked up on the next restart — the set is never re-planned behind you. Remote collections (Jira, Confluence, Outline, GitHub) are never watched: only local files have a change signal.
Its cost is one background thread per watched collection, held for the lifetime of the server. Those threads come from the event loop's default pool, which is capped at min(32, CPU count + 4): collections past that cap wait without refreshing instead of starting. A watcher that fails three update passes in a row also stops for that collection — the server keeps serving the last good index, and only a restart starts it again. Same caveats as the CLI: the server is a single writer per collection, and a source directory that disappears keeps the last good index rather than emptying the collection.
Requires Python 3.11–3.14 and uv. The upper bound is temporary: onnxruntime publishes no cp315 wheel yet, so a 3.15 interpreter cannot resolve the dependency set.
uv tool install indexed-sh This installs indexed as a global CLI tool from PyPI.
indexed --version # prints the installed version, e.g. 0.0.11 Then run the one-time setup, which creates ~/.indexed, validates your config, and fetches the default embedding model into the HuggingFace cache:
indexed init indexed init fetches only the files the embedder loads — the ONNX export it runs by default, the safetensors weights it falls back to, the tokenizer, and the configs the sentence-transformers modules read — about 178 MB on a clean cache. It does not fetch the repository's other exports (OpenVINO, TF, the quantised ONNX, the torch .bin), so setup stays bounded to the model files that loading actually reads. It is idempotent.
Skipping it is safe, and it defers nothing beyond that download: the first index create fetches the same ~178 MB at that moment instead. Neither path ever pulls the whole repository, and after that one download every command reads the cache and works offline. A cache from an older release has no ONNX export: re-running indexed init fetches just that one file (90 MB) and switches the search path over — no --force, no weight re-download.
uvx indexed-sh index search "your query" Alternative: install from source git clone https://github.com/LennardZuendorf/indexed.git cd indexed uv sync uv run indexed --help Usage
# Setup indexed init # one-time model fetch (~88 MB) + data dirs # Create collections (Jira/Confluence auto-detect Cloud vs Server from --url) indexed index create files --collection my-project --path ./src indexed index create jira --collection jira-issues --url https://your-domain.atlassian.net indexed index create confluence --collection wiki --url https://your-domain.atlassian.net/wiki indexed index create outline --collection docs indexed index create github --collection my-repo --repo owner/repo indexed index create files --collection my-app --path ./src --engine v2 # Search indexed index search "authentication flow" indexed index search "bug reports" --collection jira-issues indexed index search "why was this refactored" --rerank # v2 collections only indexed index search "authentication flow" --json # indexed.search/1 payload indexed index search "recent work" --changed-since HEAD~5 # v2 files collections indexed index search "who wrote this" --git-provenance # v2 files collections only indexed index search "who wrote these lines" --git-line-blame # v2 files collections only indexed index search "what changed lately" --git-rerank # v2 files collections only indexed index search "auth" --freshness # warn if the index is behind # A filter a collection cannot honour warns per collection, never silently # Manage collections indexed index inspect # list all collections indexed index inspect my-project # inspect specific collection (+ freshness) indexed index update my-project # update a collection indexed index remove my-project # delete a collection indexed index migrate my-project # migrate to the v2 engine # Keep a collection fresh while you work (opt-in, foreground) indexed index watch my-project # Ctrl-C to stop indexed index watch my-project --debounce 5 --poll-interval 1 # Configuration indexed config list # resolved configuration indexed config set core.v1.search.max_docs 20 # set a value # Share one collection between projects (stable id in ~/.indexed) indexed storage migrate --dry-run # report collisions and affected data indexed storage migrate # move this project's collections to the shared store indexed storage migrate --on-collision adopt # reuse an identical copy instead of keeping a second indexed storage migrate --verify hash # compare file content, not just names and sizes indexed storage migrate --rollback # put this project's collections back # Editor integration (Language Server Protocol, stdio) indexed lsp # point your editor's LSP client here indexed storage migrate gives a collection a stable id in the global store and records that id in a committed indexed.toml at your repository root, so a second clone reads the same index instead of rebuilding it. It journals every step, so an interrupted run resumes where it stopped, and --rollback restores the original local collection. Two collections are judged identical by --verify structural by default — manifest plus file names and sizes, which is fast but does not compare content — so a same-size, different-bytes copy passes. Use --verify hash for a streamed SHA-256 of every file: it refuses on any mismatch (naming the files), checks the moved bytes before registering them, and --on-collision adopt then never deletes a local copy whose content differs.
Commit that file — it is the repository's scope, and it is the only thing that travels between clones:
# indexed.toml — commit this file. version = 1 [collections] use = ["indexed-docs", "8b1d2f5e6a7c4b9d0e3f2a1c8d7b6e5f"] Entries are stable ids (what storage migrate writes) or collection names (what you type); both resolve against ~/.indexed/data/, so nothing is copied into the repository. With the file in place indexed search searches only the listed collections, and indexed lsp scopes workspace/symbol, hover and diagnostics the same way; --collection NAME still searches outside the list, with one warning line. Without the file nothing changes: every collection in the store is in scope.
The file is a declaration, not a lock: it says what the repository will search, and the store says what exists today. So a fresh clone is not deadlocked by it — on a machine where the store does not hold the listed collections yet, indexed index create
The older ./.indexed/collections.json pointer is deprecated and read-only; it keeps working with one warning naming indexed.toml, and is removed in the next minor.
For the full CLI reference and configuration guide, see the documentation.
indexed lsp is a stdio server over the same storage as the CLI. Start it from the project root; a workspace .indexed store needs indexed --local lsp. VS Code has no built-in hook, so register the command in a generic LSP client extension's settings.json: {"indexed": {"command": "indexed", "args": ["lsp"]}}; Neovim 0.11+: vim.lsp.start({ name = "indexed", cmd = { "indexed", "lsp" } }); Zed and Helix take the same command and args. Diagnostics are not-in-any-collection and index-stale — severity Information, source indexed. There is no per-keystroke sync (textDocumentSync.change: 0): the server reads the file from disk, by design. Definition returns at most 5 locations (a whole-file range when the source has no line span); references at most 50.
Watching a collection
indexed index watch
While it runs it prints one line per update it applies (updated collection from N watched file(s)) and one line when it picks up again after the source path went away — at the default log level, so an edit landing is visible without -v.
If the watched directory disappears (unmounted drive, renamed folder), the watcher logs an error and keeps the last good index instead of updating against an empty tree; it resumes when the path returns. Three consecutive failed updates end the command with a non-zero exit code. If the source path is already missing when the command starts, it refuses up front with exit 2 — updating against an unreachable source would empty the collection. A directory that exists but cannot be read is not caught by that check: the first update pass fails (Permission denied, non-zero exit) and the last good index is kept.
Tune the cadence with --debounce / --poll-interval (seconds; both default to 2.0), or in config:
[watch] debounce_seconds = 2.0 poll_interval_seconds = 2.0 Serving the same collections to a long-lived MCP server, where a per-collection command has nowhere to run? The server takes the same watcher behind an opt-in [mcp] switch — see Keeping an MCP server fresh for the keys, the startup-scope rule and its cost.
Indexed today runs parallel semantic indexes per source. The direction is one merged knowledge graph per project — code, docs, issues, git history, connected codebases, and accumulated lessons/memory as one structure instead of several. See docs/spec/concepts/vision.md and Knowledge Graph for what's shipped vs. planned.
Search result reference — the indexed.search/1 payload that --json and the MCP tools return, field by field
Expand a hit into context — the indexed.ref/1 token you store, the bounded indexed.expand/1 window, and the stale-reference contract
Full Documentation — CLI reference, configuration, and guides
Blog & Guides — tutorials and use cases
Issue Tracker — report bugs or request features
git clone https://github.com/LennardZuendorf/indexed.git cd indexed uv sync --all-groups uv run pytest -q Performance benchmarks (tests/benchmarks/, tests/system/) run in CI via pytest-bench-action — see .github/workflows/python-benchmark.yml. Run them locally with:
uv run pytest tests/system tests/benchmarks --benchmark-only Retrieval quality has its own measurement: a pinned corpus and judged query set with hit-rate@k / MRR, so a ranking change can be compared instead of argued about. Reproduce the committed baseline and compare against it:
uv run indexed-eval run --out /tmp/report.json uv run indexed-eval compare --report /tmp/report.json See eval/README.md for provenance, the metric definitions and the measured baseline.
See AGENTS.md and docs/spec/tech.md for architecture details.
See LICENSE file for details.
The Core v1 implementation is based on documents-vector-search by shnax0210, licensed under MIT and modified extensively.
indexed.sh · Star the repo if you find it useful!
Released: Dec 3, 2026
Author: Lennard Zündorf
Both files in this release have provenance metadata.
View provenance details
Other/Proprietary License (See LICENSE file)
Python <3.15, >=3.11.5
ai cli faiss mcp rag semantic-search
Development Status 3 - Alpha
Intended Audience Developers
License Other/Proprietary License
Programming Language Python :: 3.11
Topic Scientific/Engineering :: Artificial Intelligence
Software Development
Software Development :: Libraries
Release files for indexed-sh 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 1.2 MB
Release files / indexed_sh-0.1.1.tar.gz
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.
Release files / indexed_sh-0.1.1-py3-none-any.whl
Security for indexed-sh 0.1.1
Both files in this release have been uploaded with provenance metadata.
With provenance indexed_sh-0.1.1.tar.gz Dec 3, 2026
With provenance indexed_sh-0.1.1-py3-none-any.whl Dec 3, 2026
Attestation for indexed_sh-0.1.1.tar.gz
Attestation for indexed_sh-0.1.1-py3-none-any.whl
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release history Release notifications | RSS feed
Dec 3, 2026 2 release files Full provenance
Dec 2, 2026 2 release files Full provenance
Nov 20, 2026 2 release files Full provenance
Oct 19, 2026 2 release files Full provenance
Sep 17, 2026 2 release files Full provenance
Aug 13, 2026 2 release files Full provenance
Jun 21, 2026 1 release file Full provenance
Apr 29, 2026 1 release file Full provenance
Apr 27, 2026 1 release file No provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation
Deployed from 6571ef3











