codeintel
Click on "Install 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., "@codeintelfind callers of the login function"
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.
codeintel
One MCP tool that lets a coding agent search, trace, and understand a codebase — structurally, not by grepping. codeintel unifies three engines — a call/import graph, an LSP for exact symbols, and semantic embedding search — behind a single code.query call that routes to the right engine, caches the answer, and never throws. The agent always gets back a clean, well-formed result to reason over.

codeintel visualizing its own codebase. One command —
codeintel graph <repo> --html— turns any indexed repo into a self-contained, interactive call graph you can open offline or share as a file. Layouts, complexity-sized nodes, click-to-inspect metrics, and JSON/Markdown/SVG/PNG export. See docs/graph-viewer.md.
Prefer plain text? codeintel map writes a readable architecture overview to CODE_INTEL.md — node/edge counts, ranked symbols by caller count, and entry points — for skimming or for MCP hosts that can't render a graph:
What CODE_INTEL.md is for. It's a static, committable snapshot of a codebase's shape — meant to be read (by a person or an agent) first, instead of reconstructing structure by grepping. It covers the cases the live code.query tool doesn't:
Agents & hosts that don't speak MCP. Not every agent supports MCP, and the server isn't always running.
codeintel mapwrites a plain file any agent can read;codeintel map --injectalso drops a pointer intoCLAUDE.md/AGENTS.md, so an agent picks up the codebase's structure automatically at the start of a session.A committed, diffable overview. It lives in the repo — reviewable in a PR, browsable on GitHub, available offline. Re-run
codeintel mapaftercodeintel indexto refresh it.The load-bearing code at a glance. Ranking symbols by caller count surfaces what most of the codebase depends on (the risky-to-change core) plus the entry points — the first things a newcomer, or an agent, should understand before touching anything.
See docs/map-file.md for the format and the --inject flow.
Why an agent needs it
Without structural tools, an agent dropped into unfamiliar code falls back on grep and reads whole files to reconstruct relationships by hand — burning tokens, missing call sites, and guessing at blast radius before it edits anything. codeintel answers those questions directly instead:
"What calls this? What breaks if I change it?" → the real call graph, which catches cross-file and module-level callers a text search silently misses.
"Where is this symbol defined, and everywhere it's used?" → the language server, with exact locations.
"Where's the code that does X?" (when you don't know the name) → semantic search over the repo.
Always a clean answer. Every call returns the same JSON envelope. A missing or broken backend degrades to a safe
nullwith a reason — so the agent falls back to grep instead of crashing on an exception it can't reason its way out of.
Net effect: fewer, sharper tool calls, less re-reading, and an agent that can see structure — callers, impact, call chains — that plain search can't.
Related MCP server: codemap
What your agent can ask
It's one call: code.query(op, target, engine="auto"). In auto mode (the default) codeintel picks the engine per operation:
Ask |
| Engine (auto) | Comes back as |
Find code by meaning ("auth middleware") |
| semantic | ranked |
A symbol's definition and all references |
| lsp | definition body + reference list |
Who calls this? |
| graph | caller symbols + files |
What does this call? |
| graph | callee symbols + files |
Blast radius of a change |
| graph | callers and callees together |
Trace a call chain up/downstream |
| graph | ordered, risk-labeled hops |
Find symbols by pattern |
| graph | matching nodes + locations |
Project shape at a glance |
| graph → lsp | modules, node/edge counts, languages |
Everything about one symbol |
| graph + lsp | both views merged |
Impact of your uncommitted edits |
| graph | changed files → impacted symbols |
Refactor-risk hotspots |
| graph | highest complexity / fan-in symbols |
Unreferenced (dead) code |
| graph | non-test symbols with no callers |
Pin one engine with --engine graph│lsp│semantic, or fan out with --engine both / all to merge results.
Example — "who uses safe_null_result?"
// request
{ "op": "callers", "target": "safe_null_result", "engine": "auto" }
// response — always this exact envelope; `result` is ready-to-read markdown
{
"ok": true, "op": "callers", "target": "safe_null_result",
"engine": "graph", "cached": false,
"result": "## Callers of safe_null_result (7)\n- …gateway [USAGE] (src/codeintel/gateway.py)\n- …providers.graph [USAGE] (src/codeintel/providers/graph.py)\n- …server [USAGE] (src/codeintel/server.py)\n- … (4 more)"
}The agent hands result straight to the model. If the graph backend isn't installed, the identical call returns "result": null, "reason": "engine-unavailable" — no exception, and the agent just falls back to its own search.
What makes it good
Local-first and private. One process on your machine — no cloud service, no API keys, no telemetry, no per-query network. Safe to point at a private repo, even with
--engine all. (The one-time exception:fastembeddownloads its embedding model once, then runs fully offline.)It never throws. Every call returns the same JSON envelope; a missing or broken backend degrades to
nullwith a reason. No exceptions, no 500s, no malformed output for the agent to trip over — so you never wrapcode.queryin atry.One tool, not three. Register a single MCP server and it auto-routes each question to graph, LSP, or semantic — instead of wiring up three backends with three response shapes and three failure modes.
Degrades instead of breaking. No graph backend installed? That engine returns
nulland the agent falls back to grep. The semantic engine needs nothing external, so codeintel is useful the moment it's installed and only gets sharper as you add backends.Fast on repeat, never stale. A content-hash cache returns instantly for unchanged code and self-invalidates when a background reindex advances the index — answers stay both quick and fresh. The cache is bounded (LRU), so a long-running server holds steady memory.
Concurrency-safe. The HTTP transport handles requests on threads, so one slow query (an LSP session warming, a first-time index) can't block every other agent.
Honest about its own health.
codeintel doctorreports exactly which engines are ready for a repo and the single command to fix each gap — no guessing why a query came back empty.
Quickstart
pip install codecortexThis installs the codeintel CLI; the semantic engine works out of the box. (On PyPI the
distribution is codecortex because codeintel was taken; the CLI and import stay codeintel.)
One command prepares the rest and indexes your repo:
codeintel setup --all /path/to/your/projectThis installs uv (for the LSP engine), warms serena, downloads the embedding model, indexes the
repo, and prints a health report ending in a Next: list — exactly what's ready and the one
remaining step. It's idempotent, so re-running is safe. The graph engine (codebase-memory-mcp)
is an optional external binary that adds who-calls / impact / hotspots / changed; codeintel is
fully usable without it.
Or from source:
git clone https://github.com/hamilton-sky/codeintel.git
cd codeintel
pip install -e .Register with your AI agent(s), then query:
codeintel install # registers with Claude, Codex, Gemini, Zed
codeintel query --op search --target "authentication middleware"Enable native Codex integration
codeintel is an MCP server, so Codex can call its tools directly rather than invoking the CLI.
After installing the package, explicitly register it with Codex:
codeintel install --agent codexThis safely adds a [mcp_servers.codeintel] entry to ~/.codex/config.toml without changing your
other Codex settings. Registration is deliberately opt-in: installing a Python package should not
silently modify an agent's configuration. Start a new Codex task (or restart Codex) after
registration; the refreshed task will have native code.query, code.status, code.doctor, and
code.map MCP tools available.
For a fully prepared local setup, run:
codeintel setup --all /path/to/your/project && codeintel install --agent codexEnable native Claude Code integration
After installing the package, explicitly register it with Claude Code:
codeintel install --agent claudeThis adds the codeintel MCP server to ~/.claude/settings.json while preserving your existing
settings. Start a new Claude Code session after registration so it can load the native
code.query, code.status, code.doctor, and code.map MCP tools.
For a fully prepared local setup, run:
codeintel setup --all /path/to/your/project && codeintel install --agent claudeHow it works
A Gateway receives every query and dispatches it to one of three providers — graph (structural relationships), LSP (precise symbol resolution), or semantic (embedding-based search) — based on the operation type. Each provider is fully isolated: if it is unavailable or raises an exception, the gateway catches it and returns a safe-null envelope. The caller always gets a well-formed response with no exception to catch.
flowchart LR
A["AI agent · MCP"] --> GW
H["Harness · HTTP"] --> GW
C["Developer · CLI"] --> GW
GW["Gateway<br/>route · cache · safe-null"] -->|"auto: search"| SP[SemanticProvider]
GW -->|"auto: impact / callers / …"| GP[GraphProvider]
GW -->|"auto: symbol"| LP[LspProvider]
GP --> GB[("codebase-memory-mcp")]
LP --> LB[("language server")]
SP --> SB[("fastembed + sqlite-vec")]Full walkthrough: docs/architecture.md · docs/query-flow.md.
Safe-null contract
Every Gateway.query() call returns a dict with exactly these keys:
{"ok": true, "op": "search", "target": "auth", "result": null, "engine": "semantic", "cached": false}ok is always true. result is null when no provider has an answer — never an exception, never a 500. An optional reason key explains null results (e.g. "engine-unavailable", "no-result"). Callers must check result is not None before using the value.
Engines
Engine | Key ops | Install prereq |
|
|
|
|
|
|
|
|
|
Run codeintel doctor at any time to see which engines are actually ready for a repo and how to fix the ones that aren't.
Pass --engine auto (the default) and codeintel chooses the best engine per operation. Pass --engine both or --engine all to fan out to multiple engines and merge results.
Documentation
Full system docs live in docs/ — start with the index:
Architecture — layers, the
CodeProviderprotocol, the safe-null contract, caching, freshness (ASCII + Mermaid).Query flow — request lifecycle, engine selection, fan-out & merge, and why it never throws.
Map file — the static
CODE_INTEL.mdorientation layer for hosts with no MCP support.Benchmarks — real numbers at scale: 25 k chunks indexed in ~8 min, ~235 ms warm queries, 60 MB index.
CLI reference
Command | Purpose |
| Register codeintel with AI agent(s) |
| Prepare backends + index this repo ( |
| Index a project for semantic search |
| Start the MCP server (stdio transport) |
| Start the HTTP transport (loopback-only unless |
| Run a single query and print the result |
| Show engine availability and index age |
| Diagnose per-engine health + repo index status, with a fix for each gap |
| Generate the |
| Emit the call graph as |
| Clear the semantic index (this repo, or |
| Print a secure random bearer token (for |
Human-facing commands (doctor, status, query, setup, reset) honor --no-color / NO_COLOR and --ascii, and auto-degrade to plain text when piped.
Config
Create .codeintel.toml at your project root to override defaults:
backend = "auto" # auto | graph | lsp | semantic
semantic = "on" # on | off
reindex = "on-demand" # on-demand | never
cosine_floor = 0.25 # minimum similarity score for semantic hits (0–1)
max_chunks = 500 # max chunks to embed per file
max_total_chunks = 100000 # safety ceiling on chunks embedded in one index pass
model = "BAAI/bge-small-en-v1.5" # fastembed embedding modelConfig is validated on load — an out-of-range number, a misspelled enum, or a wrong type falls back to that key's default (with a logged warning) instead of breaking every query.
Environment variables:
Variable | Effect |
| Bearer token required by |
| Path to an RBAC token→role config (default |
|
|
| Structured (JSON-per-line) logs for ELK / Splunk / Datadog |
| One log line per HTTP request (method, path, status, latency) |
| Log the full traceback of any error the never-throw contract swallows (silent by default) — the switch for diagnosing an unexpected |
| Disable the background reindexer; queries then index inline to stay fresh |
Privacy & dependencies
codeintel is local-first — one local process, no cloud service, no API keys, no telemetry, and no per-query network. Its own code makes zero outbound HTTP calls, and the HTTP transport binds to 127.0.0.1 only by default — binding a non-loopback host requires --allow-remote, and --token (or CODEINTEL_HTTP_TOKEN) then gates every request behind a bearer token. The server bounds concurrent connections, but for exposure to a hostile network you should still front it with a reverse proxy (TLS, rate-limiting) — the built-in http.server is not hardened for the open internet.
Bundled (installed with the package, run locally): mcp (the tool interface) · sqlite-vec (the semantic index, a local DB file) · fastembed (the local embedding model).
Optional external backends — auto-detected on PATH; if one is absent, that engine returns a safe-null and the agent simply degrades to grep:
Engine | Needs on | Third-party? |
|
| yes — external CLI |
|
| yes — oraios/serena |
| nothing external | no — fully in-house |
Not sure what's installed? codeintel doctor reports exactly which backends are present, whether this repo is indexed, and the command to fix each gap.
The only network touch is first-run setup: fastembed downloads the BAAI/bge-small-en-v1.5 weights once (cached under ~/.cache, fully offline thereafter); the optional backends also install on first use if you opt in. After that, no code or data leaves your machine — which is what makes --engine all safe to run on a private repo.
For agents
Register codeintel as an MCP server (codeintel install) and the agent gets four tools:
MCP tool | HTTP equivalent | Purpose |
|
| The main call — search, trace, understand (the |
|
| Which engines are live + whether an index exists |
|
| Per-engine health + repo index status, with a fix for each gap |
| — | Generate/refresh |
Over MCP the agent calls code.query directly. Over HTTP, start the server and POST to /code/query:
codeintel serve-http & # listens on 127.0.0.1:8766 by defaultFor a shared or remote deployment, start it with --allow-remote --token "$CODEINTEL_HTTP_TOKEN" and send Authorization: Bearer <token> on each request — a missing or wrong token gets a clean 401. Requests are handled concurrently, so one slow query never blocks another.
import urllib.request, json
def code_query(op: str, target: str, engine: str = "auto") -> dict:
body = json.dumps({"op": op, "target": target, "engine": engine}).encode()
req = urllib.request.Request(
"http://127.0.0.1:8766/code/query",
data=body,
headers={"Content-Type": "application/json"},
)
with urllib.request.urlopen(req) as resp:
return json.loads(resp.read())
result = code_query("search", "authentication middleware")
if result["result"] is not None:
print(result["result"]) # ranked semantic matchesThe response is always JSON-safe. Check result["result"] is not None before use. Never catch an exception from the gateway — it never raises.
Operations & deployment
Running codeintel as a shared service? It ships with what ops teams expect:
Endpoint | Auth | Purpose |
| none | Liveness — always |
| none | Readiness — |
| token | Prometheus exposition — request counts, latency, in-flight, build info |
Plus bearer-token auth — or RBAC (per-token roles + op scopes via auth.toml; a disallowed op returns 403, and the role is server-authoritative so a client can't escalate) — structured JSON logs (CODEINTEL_LOG_FORMAT=json) with optional per-request access logs, graceful SIGTERM shutdown, a bounded connection pool, and a non-root Dockerfile with a healthcheck.
Full guide → docs/deploy.md: systemd, Docker / Compose, Kubernetes (liveness + readiness probes, token from a Secret), reverse-proxy TLS, RBAC + SSO-via-auth-proxy, a Prometheus scrape config, and a security checklist.
docker build -t codeintel . && docker run -p 127.0.0.1:8766:8766 \
-e CODEINTEL_HTTP_TOKEN="$(openssl rand -hex 32)" codeintelDevelopment
git clone https://github.com/hamilton-sky/codeintel.git
cd codeintel
pip install -e .[dev]
pytest tests/ -q # full suite (~15s — includes live graph/LSP backend tests)This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityAmaintenanceLocal-first codebase intelligence engine providing AI coding agents with a typed MCP toolset for understanding and navigating code repositories.10051Apache 2.0
- AlicenseNot gradedqualityAmaintenanceMCP server for local-first code intelligence, providing structural code graph, semantic search, and impact analysis to AI agents.1MIT
- AlicenseNot gradedqualityBmaintenanceLocal-first code intelligence and safety layer for AI coding agents. MCP server exposes dependency graph, impact analysis, and AST-compressed repo context, backed by typed local memory, patch-scope safety gates, and git-independent transaction rollback.1MIT
- AlicenseNot gradedqualityBmaintenancePrivate, local-first code intelligence MCP server that builds a static graph of repositories and exposes search, architecture, impact analysis, and review tools via MCP.MIT
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/hamilton-sky/codeintel'
If you have feedback or need assistance with the MCP directory API, please join our Discord server