Codemogger
A 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 ext
What is Codemogger?
Codemogger is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to 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 findin...
A 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 ext
This server falls under the Search & Data Extraction category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A local code indexing and search library that enables AI age
Use Cases
Maintainer
Works with
Installation
NPM
npx -y codemoggerManual Installation
npx -y codemoggerConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Codemogger
Codemogger is a local code indexing and search library that uses tree-sitter for language-aware parsing and SQLite for fast storage, enabling AI agents to perform both semantic and keyword searches across large codebases without uploading code to external services. It supports Rust, C, C++, Go, Python, Java, TypeScript, JavaScript, PHP, Ruby, and more. When used as an MCP server it exposes `codemogger_search`, `codemogger_index`, and `codemogger_reindex` tools directly to Claude and other MCP-compatible clients.
Prerequisites
- Node.js 18 or later and npx installed
- npm (for optional global install)
- Claude Desktop or another MCP-compatible client
- A codebase directory you want to index (no external API keys required)
Install codemogger
Install codemogger globally via npm for use as a CLI tool and MCP server, or use npx to run it without installing.
# Global install
npm install -g codemogger
# Or run directly with npx (no install needed)
npx codemogger --helpIndex a codebase
Point codemogger at a project directory. It parses all supported source files with tree-sitter and stores the index in a local SQLite database inside `.codemogger/`.
codemogger index ./my-projectSearch the index from the CLI
Test that the index works with a search query before connecting to Claude.
# Semantic search (natural language)
codemogger search "authentication middleware"
# Keyword / identifier search
codemogger search "BTreeCursor"
# List all indexed projects
codemogger listAdd codemogger to your .gitignore
The index database is stored under `.codemogger/`. Add this directory to `.gitignore` so index files are not committed.
echo '.codemogger/' >> .gitignoreConfigure Claude Desktop
Add the codemogger MCP server to Claude Desktop's configuration. Pass `mcp` as the subcommand to run it in MCP server mode.
{
"mcpServers": {
"codemogger": {
"command": "npx",
"args": ["-y", "codemogger", "mcp"]
}
}
}Reindex after code changes
When files change, ask Claude to reindex or run the CLI command. Codemogger only reprocesses modified files for efficiency.
codemogger reindex ./my-projectCodemogger Examples
Client configuration
Claude Desktop config for codemogger running in MCP server mode. No API keys or environment variables are required.
{
"mcpServers": {
"codemogger": {
"command": "npx",
"args": ["-y", "codemogger", "mcp"]
}
}
}Prompts to try
Example prompts for searching and navigating a codebase through Claude with codemogger.
- "Index the project at /home/user/my-app and then search for the database connection logic"
- "Find all functions related to JWT token validation in this codebase"
- "Where is BTreeCursor defined in the indexed code?"
- "Search for error handling patterns in the authentication module"
- "Reindex the project and then find all usages of the UserRepository class"Troubleshooting Codemogger
Index command fails with tree-sitter parse errors
Ensure the files you are indexing use one of the supported languages: Rust, C, C++, Go, Python, Zig, Java, Scala, JavaScript, TypeScript, TSX, PHP, Ruby. Files with unrecognised extensions are silently skipped. Check Node.js version is 18+ (`node --version`).
Search returns no results after indexing
Confirm the index completed without errors (`codemogger list` should show your project). Run a keyword search for a known identifier first to verify the index is populated before testing semantic search.
MCP server not appearing in Claude after config change
Fully quit and restart Claude Desktop (not just close the window). On macOS use Cmd+Q. Verify the JSON in claude_desktop_config.json is valid with a JSON linter — a single trailing comma will prevent the server from loading.
Frequently Asked Questions about Codemogger
What is Codemogger?
Codemogger is a Model Context Protocol (MCP) server that 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 ext It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Codemogger?
Install via npm with the command: npx -y codemogger. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).
Which AI clients work with Codemogger?
Codemogger works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Codemogger free to use?
Yes, Codemogger is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
Codemogger Alternatives — Similar Search & Data Extraction Servers
Looking for alternatives to Codemogger? Here are other popular search & data extraction servers you can use with Claude, Cursor, and VS Code.
TrendRadar
★ 58.0kA real-time hotspot monitoring and news aggregation assistant that provides AI-powered analysis of trending topics across multiple platforms via the Model Context Protocol. It enables users to track news and receive automated notifications through va
Scrapling
★ 52.7k🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!
PDF Math Translate
★ 33.9k[EMNLP 2025 Demo] PDF scientific paper translation with preserved formats - 基于 AI 完整保留排版的 PDF 文档全文双语翻译,支持 Google/DeepL/Ollama/OpenAI 等服务,提供 CLI/GUI/MCP/Docker/Zotero
GPT Researcher
★ 27.2kAn autonomous agent that conducts deep research on any data using any LLM providers
Agent Reach
★ 20.1kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
Xiaohongshu
★ 13.7kMCP for xiaohongshu.com
Browse More Search & Data Extraction MCP Servers
Explore all search & data extraction servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Codemogger in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Codemogger?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.