# code-context

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 32
- Author: infino-ai
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/infino-ai/supergrep
- Updated: 2026-10-21
- HTML: https://affpapa.org/en/nevibecode/mcp/code-context

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `CX_ROOT`, `CX_INDEX_DIR`, `CX_AUTO_SYNC`, `CX_NO_EMBED`, `CX_NO_RECEIPT` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
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
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
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-context
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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

### Gemini CLI

**Platform CLI**
```bash
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-context
```
Replace <…> with your own values

## When to use it
- 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
- Find every call site of `parseConfig` and give me per-file counts
- Walk me through the auth flow from request to token
- Use `sql` to rank files by how much code mentions retries

## Similar
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872
- [AIHawk](https://affpapa.org/en/nevibecode/mcp/aihawk.md) — MCP server · ★ 32221

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
