Your AI finally understands your codebase.

A MCP turns your codebase into a knowledge graph, giving AI tools instant access to functions, call chains, and context.

npx terrain-ai@latest --setup
↳ that's the whole install. one line.

"Most agents re-read your entire codebase every time they start a task — the same files, the same functions, the same slow discovery loop. Terrain indexes it once into a knowledge graph, and every session after that already knows where everything is."

— observed on real repos. not marketed.
Swipe left to discard card and explore next

One quiet read,
and nothing is forgotten.

Step 1: graph-build Waiting to start...
Step 2: api-doc-gen Waiting to start...
Step 3: embed-gen Waiting to start...

An error is a whisper —
here, it becomes a sentence.

[14:22:01] INFO Scanning codebase...
[14:22:02] ERROR GraphUpdater.run():89
[14:22:02] WARN Process terminated
Trace call chain Waiting...
Build worksheet Waiting...
Click play to trace

Describe what to build,
it knows where to begin.

$ /code-gen design.md
"Add incremental indexing —
only re-parse changed files."
Concept Extraction Waiting...
Broad Search Waiting...
Deep Research Waiting...
Implementation Plan Waiting...
Click play to generate

One index, shared with your whole team.

One person runs terrain index. Everyone else links the result — no redundant build, no copied artifacts. On a 3M-line monorepo, your teammates are ready in milliseconds.

indexed once ↓ ~200ms per teammate
on one machine
terrain index /path/to/repo
on every teammate's
terrain link /path/to/repo

And it stays fresh.

terrain index -i reads the git diff and re-parses only what changed. Commit your feature, the graph is up-to-date before your AI finishes reading the error.

↳ no cold rebuilds, no background daemon.

After install, try asking...

These are actual questions. The answers come back already structured — function names, file:line, call chains. No more "let me grep around."

"Where does refresh_access_token get called?"
→ find_callers
refresh_access_token auth/token_manager.c:187 Called by 3 functions session_heartbeat net/session.c:412 event_loop_tick core/loop.c:88 http_retry_handler net/http.c:245
"Trace how a WebSocket message reaches the event loop."
→ trace_call_chain
ws_on_message net/ws.c:312 dispatch_frame net/ws.c:278 read_ready_handler net/reader.c:145 event_loop_tick core/loop.c:88 ← entry point
"What handles JSON parsing here?"
→ find_api (semantic)
3 results — ranked by relevance 1. parse_json_value util/json.c:42 recursive descent, handles nested objects 2. decode_jwt_payload auth/jwt.c:98 base64 → JSON, uses parse_json_value 3. load_config cli/config.c:221
"Which functions touch the SESSION_STORE global?"
→ find_symbol_in_docs
SESSION_STORE — referenced by 5 functions · session_create net/session.c:203 (writes) · session_lookup net/session.c:256 (reads) · session_evict net/session.c:321 (writes) · heartbeat_sweep net/heart.c:77 (reads) · on_shutdown core/shutdown.c:44 (clears)

Two steps, one minute.

No daemon to babysit, no cloud account, no API key required for the base install. Just a CLI and an MCP server.

Install & init

Installs the Python engine, registers Terrain as an MCP server, and (optionally) asks for your LLM / embedding keys.

$ npx terrain-ai@latest --setup
↳ one command. no kube, no docker, no SaaS account.
then ↓

Point your AI at it

Add this block to Claude Code / Cursor / Windsurf MCP settings. That's it — your AI can now read the graph.

{
  "mcpServers": {
    "terrain-ai": {
      "command": "npx",
      "args": ["-y", "terrain-ai@latest", "--server"]
    }
  }
}
↳ paste into .claude/settings, .cursor/mcp.json, wherever.
Works with
Python C / C++ JS / TS Rust Go Java Scala C# PHP Lua
— now go index a real repo. →