
glommer/codemogger
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
Codemogger는 AI 코딩 에이전트를 위한 코드 인덱싱 라이브러리이자 MCP 서버입니다
개요
AI 코딩 에이전트를 위한 코드 인덱싱 라이브러리입니다. 트리 시터로 소스 코드를 파싱하고, 그것을 의미 단위(함수, 구조체, 클래스, 임플 블록)로 나누고, 로컬에 임베드한 뒤 벡터 + 전체 텍스트 검색이 가능한 단일 SQLite 파일에 저장합니다. 도커도, 서버도, API 키도 없고요. 코드베이스당 .db 파일 하나만 있으면 됩니다. 코딩 에이전트는 코드베이스를 이해해야 합니다. 정의된 위치를 찾고, 개념이 파일 간에 어떻게 구현되는지 발견하며, 낯선 코드를 빠르게 탐색해야 합니다. 이를 위해서는 키워드 검색(정확한 식별자 조회)과 의미 검색(정확한 이름을 모를 때의 자연어 쿼리)이 모두 필요합니다. AI 코딩 도구가 점점 더 조합 가능해짐에 따라(에이전트가 에이전트를 호출하고, MCP 서버가 서로 다른 호스트에 연결됨) 이 기능은 로컬에서 실행되는 라이브러리로 존재해야 합니다. 외부 서버도, API 키도, 도커 컨테이너도 없습니다. 결과를 반환하는 함수 호출만 있으면 됩니다. CodeMogger가 바로 그 라이브러리입니다.
개요(AI 번역)
AI 코딩 에이전트를 위한 코드 인덱싱 라이브러리입니다. 트리 시터로 소스 코드를 파싱하고, 그것을 의미 단위(함수, 구조체, 클래스, 임플 블록)로 나누고, 로컬에 임베드한 뒤 벡터 + 전체 텍스트 검색이 가능한 단일 SQLite 파일에 저장합니다.
도커도, 서버도, API 키도 없습니다. 코드베이스당 .db 파일 하나만 있으면 됩니다.
왜
코딩 에이전트는 코드베이스를 이해해야 합니다. 정의된 위치를 찾고, 개념이 파일 간에 어떻게 구현되는지 발견하며, 낯선 코드를 빠르게 탐색해야 합니다. 이를 위해서는 키워드 검색(정확한 식별자 조회)과 의미 검색(정확한 이름을 모를 때의 자연어 쿼리)이 모두 필요합니다.
AI 코딩 도구가 점점 더 조합 가능해짐에 따라(에이전트가 에이전트를 호출하고, MCP 서버가 서로 다른 호스트에 연결됨) 이 기능은 로컬에서 실행되는 라이브러리로 존재해야 합니다. 외부 서버도, API 키도, 도커 컨테이너도 없습니다. 결과를 반환하는 함수 호출만 있으면 됩니다.
codemogger가 바로 그 라이브러리입니다. FTS + 벡터 검색이 포함된 임베디드 SQLite(Turso를 통해)가 하나의 .db 파일 안에 포함되어 있습니다.
설치
또는 npx를 사용해 설치 없이 실행하세요.
퀵 스타트
코딩 에이전트의 MCP 설정(Claude Code, OpenCode 등)에 추가하세요:
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
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.
Install
npm install -g codemogger
Or 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 => {
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
설치
npx -y codemogger mcp설정
{
"mcpServers": {
"codemogger": {
"command": "npx",
"args": ["-y", "codemogger", "mcp"]
}
}
}