PocketDex MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PocketDex MCPsearch my-app for where badge rules are calculated"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PocketDex MCP
A tiny local code index for AI agents, served over MCP. One Python file, no dependencies, no background server, no vectors — just SQLite FTS5.
Ask an agent "where are badge rules calculated?" and it gets a file path, a line range, and a short highlighted snippet instead of opening five files.

Why
An agent exploring a repo opens file after file, and every file costs context.
PocketDex indexes the folder once, then answers search with the passage the
agent needs.
Measured on a 34-file Flask app:
Query | Result size |
|
| ~120 tokens | ~4,442 tokens |
| ~69 tokens | ~4,442 tokens |
| ~285 tokens | ~4,442 tokens |
Index time: 0.06 s. Index size: ~0.5 MB. Query latency: 8–29 ms.
(Token counts are characters / 4, an approximation.)
Related MCP server: SyntaxRAG (SYNRAG)
Why it is different
PocketDex MCP | Shared code index |
| |
Dependencies | None (stdlib only) | Service + client | None |
Setup | One file, no install | Install + run server | None |
Storage | One DB per project | Often one shared index | None |
Results | Ranked passages + lines | Ranked passages | Raw matching lines |
Context cost | Low | Low | Low, but no ranking |
Best at | 20–500 files | Large repos / corpora | One known symbol |
The important design choice is isolation. Each project gets its own database inside PocketDex's folder:
PocketDex/
├── pocketdex.py
├── data/projects/
│ ├── my-app-3f2a1b9c.db
│ └── other-api-7d1e0c44.db
├── tests/
└── ARCHITECTURE.mdNothing is written into the project being indexed.
Two projects never share a database, so results cannot leak across them.
Deleting a
.dbfile removes that project's index completely.There is no central registry that can drift out of sync.
Override the location with --data-dir or POCKETDEX_DATA. Run from a clone,
data stays in data/projects/ (gitignored). Installed as a package, it falls
back to ~/.local/share/pocketdex/projects/ because site-packages is not
writable.
rg is still the right tool for one known symbol. PocketDex is for exploring
an unfamiliar repo without paying for whole files.
Install
There is nothing to install. Clone the repo and run it:
git clone https://github.com/sujalkumar1029-gif/pocketdex-mcp.git
cd pocketdex-mcp
python3 pocketdex.py --helpOr run it straight from Git with uv:
uvx --from git+https://github.com/sujalkumar1029-gif/pocketdex-mcp pocketdex index ~/Projects/my-appRequirements: Python 3.10+ and SQLite built with FTS5 (standard in CPython builds).
Docker
Build the stdio server into a small image:
docker build -t pocketdex-mcp .
docker run --rm -i pocketdex-mcpThe index lives under /app/data inside the container. To keep it between
runs, use a named volume:
docker run --rm -i -v pocketdex-data:/app/data pocketdex-mcpQuick start
# index or refresh a project (incremental)
python3 pocketdex.py index ~/Projects/my-app
# search
python3 pocketdex.py search "parse_amount_cents"
python3 pocketdex.py search "badge rules" --limit 5
python3 pocketdex.py search "connect" --path-prefix src/db
# inspect every project's separate index
python3 pocketdex.py stats
# MCP server (what the agent runs)
python3 pocketdex.py servesearch without --project uses the most recently indexed project. Pass
--project ~/Projects/other when several are indexed.
MCP configuration
Add this to your MCP client's config (for example
~/.gemini/config/mcp_config.json for Antigravity):
{
"mcpServers": {
"pocketdex": {
"command": "python3",
"args": ["/absolute/path/to/pocketdex.py", "serve"]
}
}
}Tools exposed:
Tool | Purpose |
| Index or refresh one folder into its own DB. Incremental. |
| Keyword/identifier search in one project, with snippets. |
| Every indexed project, its DB path, file/chunk counts, size. |
Reproduce the numbers
python3 benchmark.py ~/Projects/my-appIt indexes the folder, prints index time and database size, then measures the approximate token cost of a few queries against the total source size.
How it works
Walks the folder, skipping
.git,node_modules,.venv,dist, build output, lockfiles, hidden folders, files over 512 KB, and binaries.Splits files into 40-line chunks with 12 lines of overlap.
Stores chunks in SQLite FTS5 with
_as a token character, soparse_amount_centsstays one searchable token.BM25 ranking, at most two results per file, snippets capped at 12 tokens of context.
Re-indexing compares
mtime_nsand size; unchanged files are skipped.
ARCHITECTURE.md explains the data model, indexing pipeline, ranking, MCP
lifecycle, failure modes, and extension points.
Limits (on purpose)
No embeddings / vector search. Keyword + prefix matching only. Code search is dominated by exact identifiers.
No regex tool. Add one only if a real need appears.
Small-to-medium projects. A 20–500 file range is the target; a multi-GB monorepo belongs on a dedicated search service.
No file watching. Call
index_projectafter large edits; unchanged files are cheap to skip.Plaintext index. Treat the data folder with the same care as the source it indexes.
Tests
python3 -m pip install pytest
python3 -m pytest -q11 tests: indexing, ignored dirs, binary skip, incremental re-index, deletion, path filters, stats, per-project isolation, latest-project selection, and a real MCP stdio handshake (initialize → tools/list → tools/call).
Status
Early (0.x). The MCP contract and CLI are stable; internals may change. Issues and pull requests are welcome.
If PocketDex saves you tokens, a star helps other agent builders find it.
License
MIT — see LICENSE.
Available Tools
3 toolsindex_projectA
Index or refresh one project folder in its own private database. Call once before searching an unfamiliar repository, and again after large changes. Incremental: unchanged files are skipped.
| Name | Required | Description | Default |
|---|---|---|---|
| root | Yes | Absolute path to the project folder. | |
| force | No | Re-index every file even if mtime and size match. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are supplied, so the description carries the full burden, and it does disclose two non-obvious traits: each project gets its own private database (isolation), and indexing is incremental with unchanged files skipped. It omits cost/latency expectations for large repositories and what happens on failure or partial indexing, which matters for a no-annotation write-like operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short sentences, front-loaded with purpose, then trigger timing, then the incremental behavior. Every sentence adds distinct information with no filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 2-parameter, no-output-schema tool this covers purpose, timing, and the incremental/force interaction adequately. The one gap is return values: with no output schema, the description could say what an index run reports (files indexed vs skipped), leaving the agent guessing about the result shape.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3; the description adds real meaning by explaining the incremental default that `force` exists to override. `root` is contextualized as 'one project folder', reinforcing that the tool operates on a single folder per call rather than a tree of repositories.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource with scope: 'Index or refresh one project folder in its own private database.' The clause 'Call once before searching an unfamiliar repository' positions it relative to the search sibling, so an agent can tell what this does and where it sits in the workflow.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives explicit triggers: once before searching an unfamiliar repository, and again after large changes. That is concrete when-to-use guidance tied to observable conditions. It does not state when NOT to call it (e.g. already-fresh index, non-repository folders), so it falls short of the 5 bar.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
searchA
Search one project's index by keyword or identifier. Returns file paths, line ranges and short highlighted snippets, so use this before opening whole files. Good for 'where is X', 'who calls Y', 'how is Z implemented'.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum results (1-25). Default 8. | |
| query | Yes | Words or identifiers to find. | |
| project | No | Project root. Defaults to the most recently indexed project. | |
| path_prefix | No | Only search files under this relative path, e.g. 'src/api'. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden. It usefully discloses that results include file paths, line ranges, and short highlighted snippets, and that it searches one project's index, but it omits read-only status, permissions, rate limits, pagination, and error behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences, front-loaded with the core purpose, and each sentence adds distinct value about return contents and usage. There is no redundant or wasted wording.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple search tool with a fully described input schema and no output schema, the definition explains what is returned and when to use it. Minor gaps remain around alternatives and operational behavior, but the core invocation context is complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already defines all four parameters. The description reinforces keyword/identifier searching and the one-project scope but adds no extra syntax, default, or constraint details beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: search one project's index by keyword or identifier. It is clear what the tool does, though it does not explicitly name or differentiate itself from the sibling tools index_project and stats.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives clear usage context by saying to use this before opening whole files and provides example query intents like 'where is X' and 'who calls Y'. It does not state when not to use it or name alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
statsA
Show indexed projects, their separate databases, file and chunk counts, and index size. Use to check whether a folder is indexed.
| Name | Required | Description | Default |
|---|---|---|---|
| project | No | Project root. Defaults to all projects. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. The verb 'Show' implies a read-only operation and the enumeration of returned fields (databases, counts, size) is genuinely useful behavioral context. However, it says nothing about behavior when no index exists, whether the output is empty or an error, or any cost/performance traits for enumerating all projects by default.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two tight sentences: the first front-loads the reported fields, the second gives the use case. No filler, no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a one-parameter read tool with no output schema, the description adequately covers what is returned and why an agent would call it. The only real gap is the unaddressed empty/unindexed case.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There is a single optional parameter with 100% schema description coverage ('Project root. Defaults to all projects.'), so the schema already covers its meaning. The description adds nothing about the project parameter or what 'all projects' yields in practice; baseline 3 applies when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a specific verb ('Show') and enumerates exactly what it reports: indexed projects, their separate databases, file and chunk counts, and index size. That is enough to distinguish it from index_project (writes an index) and search (queries content). It loses a point only because it never names or contrasts with those siblings explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
One concrete use case is given: check whether a folder is indexed. That is real guidance, but there is no statement of when NOT to use it, no mention that indexing first requires index_project, and no contrast with search. Usage is implied rather than fully framed.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.2.0- First observed
index_project - First observed
search - First observed
stats
TDQS
Scored across 3 tools
The three tools target clearly separate actions: building an index (index_project), querying it (search), and inspecting index metadata (stats). There is no overlap in purpose and the descriptions reinforce the boundaries (index before search, stats to verify indexing).
index_project follows a verb_noun pattern, but 'search' is a bare verb and 'stats' is a bare noun, so the set mixes conventions. All names are short and readable, but there is no single predictable pattern.
Three tools is a tight, well-scoped surface for a code-index/search server, and each tool clearly earns its place. It sits at the lower bound of a comfortable range, leaving little room for complementary operations.
Index, query, and inspect cover the core workflow, but there is no way to delete or drop a stale project database, refresh all projects at once, or retrieve full file contents (search only returns snippets). Agents can work around some of this, but index lifecycle management is notably absent.
Maintenance
Related MCP Connectors
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Token-efficient search for coding agents over public and private documentation.
Codebase intelligence for agents: 152 structured artifacts across 21 programs, one call.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables semantic and keyword search over a local codebase by chunking source files along function and class boundaries, embedding them offline, and fusing vector and BM25 results. Runs entirely on your machine in a single SQLite file, so AI coding agents can find relevant code with no API keys, telemetry, or cloud calls.711 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI coding agents to search indexed local codebases through AST-aware chunks with BM25 retrieval and CPU reranking, returning whole functions, classes and types instead of arbitrary token windows. It also exposes file outlines, dependency impact radius, related-test mapping, index statistics and reindexing, so agents can navigate and assess blast radius before editing without reading entire files.1MIT
- AlicenseNot gradedqualityAmaintenanceEnables coding agents to search a project's code and receive the most relevant source excerpts with exact line numbers, so agents spend fewer tokens, tool calls and rounds locating the code behind a question. Search runs locally, with only the question and selected snippets sent to a relevance ranking service.14MIT
- AlicenseBqualityBmaintenanceEnables AI coding agents to query a fully local SQLite FTS5 memory index of a codebase, returning high-density identity cards with exact line references, AST symbol contracts, phase maps, and colloquial intent search so agents can work without scanning raw files. It also supports incrementally syncing code changes and enriching knowledge under a six-pillar quality gate, keeping everything on-device with no cloud leakage.5MIT