search_codeLABSCO SUMMARY
Aimed squarely at the duplicate-function problem, not at code search in general.
The failure it targets is specific: an agent that cannot find createUser writes newUser next to it. Chunking by function and searching by meaning is what stops that, and the committed codemap means a teammate's checkout starts with the same memory rather than rebuilding it. update_project is the part people skip and then wonder why answers are stale — the index only reflects what it last scanned, which is why the file watcher exists. Local embedding through Transformers.js or Ollama keeps private code off a vendor's servers.
What it is
A Node server that chunks a repository function by function, embeds each chunk, and serves semantic search over a local SQLite index — with a codemap file you commit so the context travels with the repo.
What you get
- search_code — natural-language search across the indexed project, with similarity scores and a SHA per result
- get_code_chunk — the complete source of one chunk, fetched by the SHA search returned
- index_project and update_project — build the index, then re-scan after changes so new, modified and deleted functions stay in sync
- get_project_stats for looking at the index itself, plus two MCP prompts — analyze_code and find_similar_functions — that frame a follow-up analysis
- Hybrid retrieval: BM25 and vector search fused, with a cross-encoder re-ranker on top
- Scoped filters — path_glob, tags and lang — so a search can be narrowed to part of the tree
- Automatic semantic tagging from the code's own context, with optional @pampa-tags and @pampa-intent comments to sharpen it further
- An intention cache that answers repeat searches instantly once a phrasing has proven itself
- A file watcher for incremental re-indexing as you work
- JavaScript, TypeScript, PHP, Python, Go and Java indexed out of the box
Requirements
Run with npx as pampa mcp — no account needed if you embed locally. The embedding provider is your choice: Transformers.js or Ollama run free and keep everything on your machine, while OpenAI or Cohere need their API keys and bill per run. The index lives under .pampa in the project, and pampa.codemap.json is meant to be committed.
Setup effort
One command — npx pampa mcp
USE CASES
Checking whether the function you are about to write already exists
Search by what it does rather than what it might be called, and read the chunk before duplicating it.
Getting an agent oriented in a large repository
Index once, then let it search instead of walking the tree file by file and spending the context on it.
Keeping the memory current as you work
Re-run the update at the start of a session and after refactoring, so deleted functions stop showing up in results.
Narrowing a search to one part of the codebase
Filter by path glob, tag or language when the same term appears everywhere.
Finding the other places that do the same thing
Look for functions similar to one you already have, before changing behaviour in only one of them.
6 tools
Listed in project docs. Your client may show a different list.
get_code_chunkindex_projectupdate_projectget_project_statsuse_context_packBEFORE YOU INSTALL
What to know first
Tools you get
6 tools named in the project's documentation.
Requires
npx on PATH
Where it runs
Both documented clients run the server on your machine.
INSTALLATION
Connect your client
Server setup
npx pampa mcpMCP Clients
Claude Desktop, Cursor
{
"mcpServers": {
"pampa": {
"command": "npx",
"args": [
"-y",
"pampa",
"mcp"
]
}
}
}