Headless Codebase Indexer
Provides structural indexing and AST parsing for JavaScript codebases, enabling AI agents to perform precise searches for code definitions and references.
Integrates with OpenAI's API to generate vector embeddings for semantic search, allowing agents to search codebases by intent and natural language.
Provides structural indexing and AST parsing for TypeScript codebases, enabling AI agents to perform precise searches for code definitions and references.
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., "@Headless Codebase IndexerFind all references to the processOrder function across the codebase"
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.
Headless Codebase Indexer (MCP Server)
A minimalist, server-side codebase indexing tool built to give autonomous AI agents and language models the deep code-understanding capabilities typically reserved for visual IDEs like Cursor.
Why I built this: When transitioning manual IDE workflows into fully autonomous, server-hosted processes, I hit a wall: unsupervised agents running in the cloud lack structural context. They try to grep their way through massive codebases and end up hallucinating or blowing out their context windows.
Instead of deploying massive, heavy infrastructure, I wrote this lightweight tool to bridge that gap. It headlessly exposes both semantic meaning and strict AST structures via the Model Context Protocol (MCP), giving my automated agents the guardrails they need to navigate codebases securely and predictably.
⚙️ Core Architecture
🧠 Semantic Search: Fast vector embeddings via ChromaDB so agents can search by intent ("find authentication logic") rather than exact strings.
🏗️ Structural Search: Native AST / LSP parsing. Enables exact definitions, references, and full file token structures for TypeScript/JavaScript.
⏱️ Zero-Block Indexing: Background file ingestion so the event loop never freezes while your agents work.
🔄 Live Cache Validation: A built-in watcher (
chokidar) instantly invalidates the AST cache when files change on disk.🔌 Cloud / Local Ready: Runs locally via StdIO for desktop clients (Claude), or securely over HTTP (SSE) behind Bearer token auth for remote pipelines.
Getting Started
You will need the following dependencies:
Node.js (v18+)
An API Key: Set
OPENAI_API_KEY,GEMINI_API_KEY, orVOYAGE_API_KEYas an environment variable.ChromaDB: A local vector database to store the code embeddings.
To start ChromaDB via Docker:
docker run -p 8000:8000 chromadb/chromaLocal Setup (e.g., Claude Desktop)
Since this is an MCP server, it is typically launched by your AI client rather than run manually.
To connect it to Claude Desktop, open your configuration file (~/Library/Application Support/Claude/claude_desktop_config.json on Mac or %APPDATA%\Claude\claude_desktop_config.json on Windows) and add this configuration:
{
"mcpServers": {
"codebase-indexer": {
"command": "npx",
"args": [
"-y",
"codebase-indexer-mcp",
"<ABSOLUTE_PATH_TO_CODEBASE>"
],
"env": {
"OPENAI_API_KEY": "sk-your-openai-key-here"
}
}
}
}Note: Replace OPENAI_API_KEY with GEMINI_API_KEY or VOYAGE_API_KEY if you are using a different provider.
Cloud Setup (SSE / HTTP)
To host the indexer for remote agents, you can run it over HTTP by providing a PORT environment variable:
PORT=3000 API_KEY=your-secret-token npx codebase-indexer-mcp <ABSOLUTE_PATH_TO_CODEBASE>Remote agents can then connect securely using the Bearer token (your-secret-token) at http://localhost:3000/sse.
Related MCP server: codemogger
🛠️ Use Cases
Deterministic Refactoring I pass the agent a high-level task. It uses
semantic_searchto map the neighborhood (e.g., finding the "billing provider"), and then strictly enforcesget_referencesto track every upstream caller. It ensures cross-file edits are safe before opening a PR.Automated Code Reviews in CI/CD A pipeline agent semantically verifies new pull requests against our existing architectural patterns. It leverages structural lookups to definitively prove that upstream dependencies weren't silently broken.
Auditing Technical Debt Instead of manually tracing legacy code, I deploy a background worker. It pulls the
get_file_structureto outline massive legacy files, and traces deprecated API usage through exact AST definitions without ever running out of context.
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
- Alicense-qualityCmaintenanceA graph-powered code intelligence engine that indexes codebases into a structural knowledge graph to provide AI agents with deep context on function calls, types, and execution flows. It offers local, zero-dependency tools for hybrid search, impact analysis, and dead code detection across Python, JavaScript, and TypeScript projects.Last updated724MIT
- Alicense-qualityCmaintenanceA local code indexing and search library that enables AI agents to perform semantic and keyword searches across codebases using tree-sitter and SQLite. It provides tools for indexing projects and finding precise code definitions without requiring external APIs, Docker, or server infrastructure.Last updated1,430332MIT
- Alicense-qualityBmaintenanceIndexes codebases and lets AI agents retrieve precise code snippets (functions, classes, routes) instead of reading entire files, reducing token usage and improving accuracy.Last updated397MIT
- Alicense-qualityAmaintenanceIndexes local code repositories into a queryable graph database to provide context for AI agents, enabling code understanding and relationship analysis via natural language queries.Last updated4,026MIT
Related MCP Connectors
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Universal memory for AI agents and tools. Save, organize and search context anywhere.
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
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/y1hanh/codebase-indexer-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server