code-context — AI agent MCP server for repo search
A local search layer for coding agents: exact matches, semantic search and SQL over one index kept in your repo. Useful when the codebase outgrows the agent.
claude mcp add --env CX_ROOT=<CX_ROOT> --env CX_INDEX_DIR=<CX_INDEX_DIR> --env CX_AUTO_SYNC=<CX_AUTO_SYNC> --env CX_NO_EMBED=<CX_NO_EMBED> --env CX_NO_RECEIPT=<CX_NO_RECEIPT> --transport stdio code-context -- npx -y @infino-ai/code-contextWhat code-context does
The server hands the agent four tools. find lists every line with an exact string, like grep -n, adding repo-wide and per-file counts. search runs one ranked pass that fuses keyword hits with semantic similarity, so it still works when you don't know the wording; results carry the code and a path:line citation. sql reads the index, and ask sends a repo-spanning question to small models on the Infino service, which return the rows they found rather than prose.
find and plain sql run locally against the keyword index. Anything meaning-based — search, a sql statement with a ranked search inside, ask — runs in the Infino cloud, which keeps the heavy compute and embeddings off your laptop. There is one index, stored in your repository.
Setup goes through npx -y @infino-ai/code-context. In the Cursor and GitHub Copilot configs the repo root and index folder are set with CX_ROOT and CX_INDEX_DIR; leave them empty and the server has nothing to index and nowhere to put the index.
What it helps with
- list every caller of a function before a refactor
- explain how a feature works end to end without reading the tree
- search code, logs and an issue export in one query
- rank files by how much code covers a topic
- make sense of a long CI stack trace
Example prompts for the agent
- Find every call site of
parseConfigand give me per-file counts - Walk me through the auth flow from request to token
- Use
sqlto rank files by how much code mentions retries
How to install code-context
Platform CLI
claude mcp add --env CX_ROOT=<CX_ROOT> --env CX_INDEX_DIR=<CX_INDEX_DIR> --env CX_AUTO_SYNC=<CX_AUTO_SYNC> --env CX_NO_EMBED=<CX_NO_EMBED> --env CX_NO_RECEIPT=<CX_NO_RECEIPT> --transport stdio code-context -- npx -y @infino-ai/code-contextReplace <…> with your own values
Platform CLI
codex mcp add code-context --env CX_ROOT=<CX_ROOT> --env CX_INDEX_DIR=<CX_INDEX_DIR> --env CX_AUTO_SYNC=<CX_AUTO_SYNC> --env CX_NO_EMBED=<CX_NO_EMBED> --env CX_NO_RECEIPT=<CX_NO_RECEIPT> -- npx -y @infino-ai/code-contextReplace <…> with your own values
Config file
{
"mcpServers": {
"code-context": {
"command": "npx",
"args": [
"-y",
"@infino-ai/code-context"
],
"env": {
"CX_ROOT": "<CX_ROOT>",
"CX_INDEX_DIR": "<CX_INDEX_DIR>",
"CX_AUTO_SYNC": "<CX_AUTO_SYNC>",
"CX_NO_EMBED": "<CX_NO_EMBED>",
"CX_NO_RECEIPT": "<CX_NO_RECEIPT>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"code-context": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@infino-ai/code-context"
],
"env": {
"CX_ROOT": "<CX_ROOT>",
"CX_INDEX_DIR": "<CX_INDEX_DIR>",
"CX_AUTO_SYNC": "<CX_AUTO_SYNC>",
"CX_NO_EMBED": "<CX_NO_EMBED>",
"CX_NO_RECEIPT": "<CX_NO_RECEIPT>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e CX_ROOT=<CX_ROOT> -e CX_INDEX_DIR=<CX_INDEX_DIR> -e CX_AUTO_SYNC=<CX_AUTO_SYNC> -e CX_NO_EMBED=<CX_NO_EMBED> -e CX_NO_RECEIPT=<CX_NO_RECEIPT> code-context npx -y @infino-ai/code-contextReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about code-context
How do I install code-context in Claude Code?
Run claude mcp add code-context -- npx -y @infino-ai/code-context. For custom settings use `claude mcp add --env CX_ROOT=<CX_ROOT> --env CX_INDEX_DIR=<CX_INDEX_DIR> --env CX_AUTO_SYNC=<CX_AUTO_SYNC> --env CX_NO_EMBED=<CX_NO_EMBED> --env CX_NO_RECEIPT=<CX_NO_RECEIPT> --transport stdio code-context -- npx -y @infino-ai/code-context`.
What does code-context do?
It gives the agent four tools over one repo index: find for exact strings, search for ranked meaning-based results, sql for reading the index and ask for repository-wide questions.
Which settings does it need?
Point CX_ROOT at the repository root and CX_INDEX_DIR at the index folder. Other flags such as CX_AUTO_SYNC and CX_NO_EMBED are passed as env values too.