queryRepoLABSCO SUMMARY
Local clone and local embeddings, so it works on private repositories and costs nothing per query.
Working from a git clone rather than a hosted code API means private repositories, any branch, and no rate limit; embedding through Ollama means the code is never sent to a vendor. The cost is setup — Ollama has to be installed and a model pulled before the first query — and the first run on a large repository pays for cloning and embedding the whole thing before it answers. After that the SQLite cache carries it.
What it is
A TypeScript server with one tool, queryRepo, that clones a repository, splits it into semantic chunks, embeds them with a local Ollama model, and answers a search query over them.
What you get
- Semantic search over a whole repository, not a filename or grep match
- Any git repository by URL, on the branch you name — or its default branch if you do not
- filePatterns and excludePatterns as glob filters, so you can search only the TypeScript sources or skip vendored directories
- Keywords as an extra filter, keeping only chunks that contain at least one of them, matched case-insensitively
- Limit to control how many chunks come back, defaulting to 10
- Everything cached in a local SQLite database — repositories, branches, files and chunk embeddings — so a second query on the same repo is fast
Requirements
Ollama running locally with an embedding model pulled — unclemusclez/jina-embeddings-v2-base-code is the recommended one — plus git and Node.js v16 or higher. No API key and no data leaving your machine. DATA_DIR and REPO_CACHE_DIR decide where the database and the clones live.
Setup effort
Build from source — git clone https://github.com/fkesheh/code-context-mcp.git
USE CASES
Understanding an unfamiliar dependency before you rely on it
Clone it by URL and ask how a feature is implemented, instead of reading the repository top to bottom.
Finding where something is handled in a large codebase
Search by intent rather than by symbol name, which is what you need when you do not know what it is called.
Searching a private repository
The clone is local and the embeddings are local, so nothing about the code leaves the machine.
Keeping results out of generated and vendored code
Exclude those paths with a glob and restrict the search to the sources you actually maintain.
Comparing how two branches do the same thing
Run the same query against each branch — the branch is a parameter, so nothing has to be checked out by hand.
1 tool
Listed in project docs. Your client may show a different list.
BEFORE YOU INSTALL
What to know first
Tools you get
1 tool named in the project's documentation.
Requires
- Node.js (v16+)
- Git
- Ollama with an embedding model
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
# Clone the repository
git clone https://github.com/fkesheh/code-context-mcp.git
cd code-context-mcp
# Install dependencies
npm install
# Build the project
npm run build
# Pull an embedding model (unclemusclez/jina-embeddings-v2-base-code is recommended)
ollama pull unclemusclez/jina-embeddings-v2-base-codeMCP Clients
Claude Desktop
{
"mcpServers": {
"code-context-mcp": {
"command": "<YOUR_PATH_TO_NODE>",
"args": [
"<YOUR_PATH_TO_CODE_CONTEXT_MCP>/dist/index.js"
]
}
}
}<YOUR_PATH_TO_NODE> is the full path to your Node.js executable, and <YOUR_PATH_TO_CODE_CONTEXT_MCP> is the absolute path to your clone.