# mcp-code-indexer

> mcp-code-indexer is an open-source MCP server for developer tools. Turns a TypeScript or React repo into a queryable code graph for AI agents and developers. It is available on CLI, API, Self-hosted and Web.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, Self-hosted, Web
- **Website:** https://www.npmjs.com/package/code-graph-indexer
- **Repository:** https://github.com/nishant-chaudhary5338/mcp-code-indexer
- **GitHub stars:** 2
- **License:** MIT
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

Code Graph Indexer reads a TypeScript, React or Next.js codebase with the TypeScript compiler and builds a graph of files, functions, components and the edges between them. Edges are only drawn when the compiler resolves them to a real indexed node, so impact questions get exact answers rather than text-search guesses.

The same engine is reachable in several ways: a command-line tool, an MCP server that Claude Code or Cursor can call over stdio, an HTTP and WebSocket API, and a 3D browser explorer with a chat panel that answers from the graph. A local semantic search option uses a small embedding model that runs on the machine, and falls back to lexical search when that model is not installed.

It suits developers who want an AI assistant to answer questions like what breaks if this function changes, without loading large parts of the repo into context. The HTTP API binds to localhost only and has no authentication, so it is meant for local use.

## Features

- **Compiler-resolved dependency edges:** Imports, calls, renders and references are resolved through ts-morph, so edges reflect the TypeScript resolver rather than pattern matching.
- **Blast radius queries:** Shows which nodes would be affected by changing a given function or file.
- **3D code explorer:** A browser view with folder drill-down, health coloring, hover tracing and a 2D fallback, updated live as files change.
- **MCP server with 14 tools:** Exposes graph queries such as who calls, who renders, find cycles and find orphans to MCP-compatible AI clients over stdio.
- **Monorepo-aware discovery:** Detects pnpm, turbo and lerna workspaces as well as standalone packages without target-specific configuration.
- **Local semantic search:** Optional on-device embeddings for searching nodes by meaning, with no API key and no data leaving the machine.

## Good for

- Asking an AI agent what would break before changing a shared utility
- Finding unused files, orphaned modules and circular imports in a React or Next.js codebase
- Giving Claude Code or Cursor a structured map of a monorepo instead of raw file reads
- Exploring an unfamiliar TypeScript project visually in the browser
- Generating a grounded chat answer about a codebase's component structure

## Tools

From the tool list in its README, going by the names, 8 of 14 tools read data; 6 names don't say. From the server's own tool labels and tool names; not verified by us.

- `index_repo`: Index a repository into the code graph.
- `get_graph` (name suggests: reads): Return the code graph.
- `get_node` (name suggests: reads): Return a single graph node.
- `who_renders`: Find components that render a given node.
- `who_calls`: Find callers of a function.
- `find_references` (name suggests: reads): Find references to a node.
- `blast_radius`: Show nodes affected by a change.
- `find_cycles` (name suggests: reads): Find circular dependencies.
- `find_orphans` (name suggests: reads): Find nodes with no incoming connections.
- `search_nodes` (name suggests: reads): Search nodes by name.
- `get_context_pack` (name suggests: reads): Build a context pack for a node.
- `build_embeddings`: Build local semantic embeddings.
- `semantic_search` (name suggests: reads): Search nodes by meaning.
- `open_explorer`: Start the 3D UI and return its URL.

## FAQ

### How do I run mcp-code-indexer without cloning the repository?

Running npx code-graph-indexer ui --root . starts the full explorer against the current directory.

### What does semantic search need?

It uses a local all-MiniLM-L6-v2 model through Transformers.js. It is an optional dependency, and if it is missing the semantic_search tool falls back to lexical search.

### Is the HTTP API safe to expose on a network?

No. The server binds to 127.0.0.1 only and its endpoints are unauthenticated and can trigger reindexing, so it should not be exposed off the host.

### Which languages does mcp-code-indexer index?

It is built for TypeScript, React and Next.js projects.

### Is mcp-code-indexer free?

Yes. mcp-code-indexer is open source, so you can use and self-host it for free.

### What are the best alternatives to mcp-code-indexer?

The closest alternatives to mcp-code-indexer are Codegraph, CodeGraphContext, synapse-mcp, Graphlens MCP and MCP Codebase Index.

## Where this comes from

- Description: written from the project's README.

## Alternatives

- [Codegraph](https://ai-powered.com/mcp/codegraph): Codegraph is an open-source MCP server for developer tools.
- [CodeGraphContext](https://ai-powered.com/mcp/codegraphcontext): CodeGraphContext is an open-source MCP server for developer tools.
- [synapse-mcp](https://ai-powered.com/mcp/synapse-mcp): synapse-mcp is a freemium MCP server for developer tools.
- [Graphlens MCP](https://ai-powered.com/mcp/graphlens-mcp): Graphlens MCP is an open-source MCP server for developer tools.
- [MCP Codebase Index](https://ai-powered.com/mcp/mcp-codebase-index): MCP Codebase Index is an open-source MCP server for developer tools.
- [Ast Impact Mapper MCP](https://ai-powered.com/mcp/ast-impact-mapper-mcp): Ast Impact Mapper MCP is an open-source MCP server for developer tools.
- [Ai Architect MCP Codebase](https://ai-powered.com/mcp/ai-architect-mcp-codebase): Ai Architect MCP Codebase is an open-source MCP server for developer tools.
- [Sense](https://ai-powered.com/mcp/sense-2): Sense is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/mcp-code-indexer
