codemogger
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., "@codemoggersearch for the authentication middleware implementation"
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.
codemogger
Code indexing library for AI coding agents. Parses source code with tree-sitter, chunks it into semantic units (functions, structs, classes, impl blocks), embeds them locally, and stores everything in a single SQLite file with vector + full-text search.
No Docker, no server, no API keys. One .db file per codebase.
Why
Coding agents need to understand codebases. They need to find where things are defined, discover how concepts are implemented across files, and navigate unfamiliar code quickly. This requires both keyword search (precise identifier lookup) and semantic search (natural language queries when you don't know the exact names).
As AI coding tools become more composable - agents calling agents, MCP servers plugging into different hosts - this capability needs to exist as a library that runs locally. No external servers, no API keys, no Docker containers. Just a function call that returns results.
codemogger is that library. Embedded SQLite (via Turso) with FTS + vector search in a single .db file.
Related MCP server: Axon
Install
npm install -g codemoggerOr use npx to run without installing.
Quick start
# Index a project
codemogger index ./my-project
# Search
codemogger search "authentication middleware"Add to your coding agent's MCP config (Claude Code, OpenCode, etc.):
{
"mcpServers": {
"codemogger": {
"command": "npx",
"args": ["-y", "codemogger", "mcp"]
}
}
}The MCP server exposes three tools:
codemogger_search- semantic and keyword search over indexed codecodemogger_index- index a codebase for the first timecodemogger_reindex- update the index after modifying files
Add the local db to .gitignore:
# codemogger db
.codemogger/SDK
codemogger is also usable as a library. The SDK has no model dependency - you provide your own embedding function:
import { CodeIndex } from "codemogger"
import { pipeline } from "@huggingface/transformers"
// Load embedding model (runs locally, no API keys)
const extractor = await pipeline("feature-extraction", "Xenova/all-MiniLM-L6-v2", { dtype: "q8" })
const embedder = async (texts: string[]): Promise<number[][]> => {
const output = await extractor(texts, { pooling: "mean", normalize: true })
return output.tolist() as number[][]
}
const db = new CodeIndex({
dbPath: "./my-project.db",
embedder,
embeddingModel: "all-MiniLM-L6-v2",
})
await db.index("/path/to/project")
// Semantic: "what does this codebase do?"
const results = await db.search("authentication middleware", { mode: "semantic" })
// Keyword: precise identifier lookup
const results = await db.search("BTreeCursor", { mode: "keyword" })
await db.close()The MCP server and CLI ship with all-MiniLM-L6-v2 by default.
CLI
# Install globally
npm install -g codemogger
# Index a directory
codemogger index ./my-project
# Search
codemogger search "authentication middleware"
# List indexed codebases
codemogger listHow it works
Scan - walk directory, respect
.gitignore, detect language from extensionChunk - parse each file with tree-sitter (WASM), extract top-level definitions (functions, structs, classes, impl blocks). Items >150 lines are split into sub-items.
Embed - encode each chunk with the provided embedding model (runs locally, no API)
Store - write chunks + embeddings to SQLite with FTS index
Search - vector cosine similarity (semantic) or FTS with weighted fields (keyword)
Incremental: only changed files (by SHA-256 hash) are re-processed on subsequent runs.
Languages
Rust, C, C++, Go, Python, Zig, Java, Scala, JavaScript, TypeScript, TSX, PHP, Ruby.
Benchmarks
Benchmarked on 4 real-world codebases on an Apple M2 (8GB). Each project uses its own isolated database. Embeddings use vector8 (int8 quantized, 395 bytes/chunk vs 1,536 for float32). Embedding model: all-MiniLM-L6-v2 (q8 quantized, local CPU). Search times are p50 over 3 runs.
Performance
Project | Language | Files | Semantic | Keyword | ripgrep |
Rust | 748 | 35 ms | 1 ms | 25 ms | |
Zig | 9,255 | 137 ms | 2 ms | 166 ms | |
TypeScript | 39,298 | 242 ms | 4 ms | 1,500 ms | |
Go | 16,668 | 617 ms | 12 ms | 731 ms |
Keyword search is 25x-370x faster than ripgrep and returns precise definitions instead of thousands of file matches.
Indexing is a one-time cost dominated by embedding (~97% of time). Subsequent runs only re-embed changed files.
Search quality: semantic search vs ripgrep
The real advantage isn't speed - it's finding the right code when you don't know the exact keywords.
"write-ahead log replication and synchronization" (Turso)
codemogger (top 5) | ripgrep |
| 3 files matched |
| (keyword: "write-ahead") |
| |
| |
|
"SQL statement parsing and compilation" (Turso)
codemogger (top 5) | ripgrep |
| 139 files matched |
| (keyword: "statement") |
| |
| |
|
"HTTP request parsing and response writing" (Bun)
codemogger (top 5) | ripgrep |
| 0 files matched |
| (keyword: "HTTP") |
| |
| |
|
"scheduling pods to nodes based on resource requirements" (Kubernetes)
codemogger (top 5) | ripgrep |
| 429 files matched |
| (keyword: "scheduling") |
| |
| |
|
"container health check probes and restart policy" (Kubernetes)
codemogger (top 5) | ripgrep |
| 1,652 files matched |
| (keyword: "container") |
| |
| |
|
ripgrep matches thousands of files on common keywords. codemogger returns the 5 most relevant definitions.
Dependencies note
@tursodatabase/database is currently pinned to a pre-release version (0.5.0-pre.14). There is no stable 0.5.x release yet; once one is published this should be updated. The pre-release is stable enough for development use but may have breaking changes before it reaches a final release.
Architecture
Bun/TypeScript runtime
tree-sitter (WASM) for AST-aware chunking - 13 language grammars
all-MiniLM-L6-v2 for local embeddings (384 dimensions, q8 quantized)
Turso for storage - embedded SQLite with FTS + vector search extensions
Single DB file stores multiple codebases with per-codebase FTS tables and global vector search
License
MIT
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-qualityAmaintenanceLocal-first code indexer that provides deep code understanding for Claude and other LLMs with symbol/text search across 48+ languages, semantic search capabilities, and real-time index updates through the Model Context Protocol.Last updated54MIT
- 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
- Flicense-qualityDmaintenanceA minimalist indexing tool that provides AI agents with semantic search and structural AST parsing for deep codebase understanding. It enables autonomous agents to navigate large codebases predictably using vector embeddings and native language server capabilities like definition and reference tracking.Last updated
- Alicense-qualityAmaintenanceEnables local semantic search over documents (PDFs, code, etc.) using local embedding models, allowing AI agents and users to find information by meaning without API keys or cloud services.Last updated3MIT
Related MCP Connectors
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
Enterprise code intelligence for M&A, security audits, and tech debt. Hosted server with 200k free.
Appeared in Searches
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/glommer/codemogger'
If you have feedback or need assistance with the MCP directory API, please join our Discord server