codesight

Maps a codebase's routes, schema, env vars and import graph into compact context for coding assistants

By Kailesk Khumar (individual) TypeScript Local · stdio Developer toolsKnowledge and memory

71 popularity score ★ 1.4k ↓ 3.0k/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add codesight -- npx codesight --mcp
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "codesight": {
      "command": "npx",
      "args": [
        "codesight",
        "--mcp"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "codesight": {
      "command": "npx",
      "args": [
        "codesight",
        "--mcp"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "codesight": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "codesight",
        "--mcp"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.codesight]
command = "npx"
args = ["codesight", "--mcp"]
Gemini CLITerminal
gemini mcp add --scope user codesight npx -- codesight --mcp

What it does

codesight is a command-line tool that scans a project and builds a condensed map of it: HTTP, GraphQL, gRPC and WebSocket routes, database models from ORM definitions, UI components, environment variables, middleware, background jobs and the import graph. Started with `--mcp`, the same scanner runs as a local stdio MCP server, so an assistant can ask for one slice of that map (the routes under a prefix, a single model, the files a change would affect) instead of opening many files to work it out.

The server registers 14 tools in src/mcp-server.ts. The first call scans the directory it is given (the working directory by default) and keeps the result in memory; later calls for the same directory reuse it until `codesight_refresh` is called. Each scan also writes its context files into a `.codesight/` folder inside the scanned project, so even the read-style tools leave files behind. File collection stops at a depth of 10 folders unless `maxDepth` is set in the project's codesight config, and blast-radius lookups follow imports 3 levels deep by default.

The wiki and knowledge tools only read output made earlier by the CLI: `npx codesight --wiki` builds `.codesight/wiki/`, and `npx codesight --mode knowledge` builds a KNOWLEDGE.md map of a folder of Markdown notes such as ADRs or an Obsidian vault. Outside MCP, the CLI can also write CLAUDE.md, .cursorrules, AGENTS.md and similar files, show an HTML report, and regenerate on file changes or git commits.

What it needs

RuntimeNode.js 18+

Node.js 18 or later with npx. A project on disk to scan. TypeScript projects get AST parsing using the typescript package already in the project; other languages are read with pattern matching. The wiki and knowledge tools need `npx codesight --wiki` or `npx codesight --mode knowledge` run once in the project first. Codex users should raise `startup_timeout_sec` to 60 or install the package globally, as the first npx download can exceed Codex's 30-second default.

Limits

Wiki articles and the knowledge map are not generated over MCP: those tools return a message asking you to run the CLI first. Results are cached per session for one directory, so edits made after the first scan are not seen until `codesight_refresh` runs. Folders deeper than 10 levels are skipped unless `maxDepth` is raised in the config. Full AST precision applies to TypeScript only; other languages rely on regex detection, and the optional AST plugins for more languages are a separate opt-in (`--native-ast`). The server reports itself as version 1.10.0 during the handshake whatever package version is installed (src/mcp-server.ts).

Who it suits

Suits developers using Claude Code, Cursor or Codex on web back ends with routes, ORM models and environment files, who want the assistant to query project structure on demand and are happy for a `.codesight/` folder to appear in the repo. It runs entirely on your machine, needs no account or key, and only reads source apart from writing its own output folder. It adds little for projects without routes or schemas, and anyone who wants the assistant to edit code or run commands needs a different server: this one only describes the code.

Tools 14

codesight_scan
Run a full scan of a project and return the whole context map
codesight_get_summary
Short overview of the project's stack, routes, models and key files
codesight_get_routes
List detected routes, optionally filtered by prefix, tag or method
codesight_get_schema
Show database models, optionally narrowed to one model name
codesight_get_blast_radius
List files, routes and models affected by changing a given file (3 import levels by default)
codesight_get_env
List environment variables with whether they have defaults and where they are read
codesight_get_hot_files
Most-imported files in the project, 15 by default
codesight_refresh
Drop the cached scan and scan the project again
codesight_get_wiki_index
Return the catalog of a previously generated wiki
codesight_get_wiki_article
Return one generated wiki article by name, such as auth or database
codesight_lint_wiki
Check the generated wiki for orphan articles, missing links and stale content
codesight_get_events
List background queues, tasks, topics and event emitters found in the code
codesight_get_coverage
Show which routes and models have matching test files
codesight_get_knowledge
Return the KNOWLEDGE.md map built from Markdown notes by knowledge mode

Similar servers