Codemoggerのロゴ

Codemogger

コミュニティ
glommer

Codemogger is a code indexing library and MCP server for AI coding agents

公開者glommer
リポジトリcodemogger
言語TypeScript
フォーク
28
スター
344
利用可能なツール
0
通信方式stdio
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    Codemoggerは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには344件のスターと28件のフォークがあります。

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

bash
npm install -g codemogger

Or use npx to run without installing.

Quick start

bash
# Index a project
codemogger index ./my-project

# Search
codemogger search "authentication middleware"

Add to your coding agent's MCP config (Claude Code, OpenCode, etc.):

json
{
  "mcpServers": {
    "codemogger": {
      "command": "npx",
      "args": ["-y", "codemogger", "mcp"]
    }
  }
}

The MCP server exposes three tools:

  • codemogger_search - semantic and keyword search over indexed code
  • codemogger_index - index a codebase for the first time
  • codemogger_reindex - update the index after modifying files

Add the local db to .gitignore:

gitignore
# codemogger db
.codemogger/

SDK

codemogger is also usable as a library. The SDK has no model dependency - you provide your own embedding function:

typescript
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

bash
# Install globally
npm install -g codemogger

# Index a directory
codemogger index ./my-project

# Search
codemogger search "authentication middleware"

# List indexed codebases
codemogger list

How it works

  1. Scan - walk directory, respect .gitignore, detect language from extension
  2. Chunk - parse each file with tree-sitter (WASM), extract top-level definitions (functions, structs, classes, impl blocks). Items >150 lines are split into sub-items.
  3. Embed - encode each chunk with the provided embedding model (runs locally, no API)
  4. Store - write chunks + embeddings to SQLite with FTS index
  5. 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

ProjectLanguageFilesSemanticKeywordripgrep
TursoRust74835 ms1 ms25 ms
BunZig9,255137 ms2 ms166 ms
TypeScriptTypeScript39,298242 ms4 ms1,500 ms
KubernetesGo16,668617 ms12 ms731 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
impl LogicalLog - core/mvcc/persistent_storage/logical_log.rs3 files matched
enum CommitState - core/mvcc/database/mod.rs(keyword: "write-ahead")
function new - core/mvcc/database/checkpoint_state_machine.rs
struct LogicalLog - core/mvcc/persistent_storage/logical_log.rs
function checkpoint_shutdown - core/storage/pager.rs

"SQL statement parsing and compilation" (Turso)

codemogger (top 5)ripgrep
function parse_and_build - core/translate/logical.rs139 files matched
macro compile_sql - core/incremental/compiler.rs(keyword: "statement")
function parse_from_clause_opt - parser/src/parser.rs
function parse_from_clause_table - core/translate/planner.rs
function parse_table - core/translate/planner.rs

"HTTP request parsing and response writing" (Bun)

codemogger (top 5)ripgrep
function consumeRequestLine - packages/bun-uws/src/HttpParser.h0 files matched
declaration ConsumeRequestLineResult - packages/bun-uws/src/HttpParser.h(keyword: "HTTP")
function llhttp__after_headers_complete - src/bun.js/bindings/node/http/llhttp/http.c
function llhttp_message_needs_eof - src/bun.js/bindings/node/http/llhttp/http.c
function shortRead - packages/bun-uws/src/HttpParser.h

"scheduling pods to nodes based on resource requirements" (Kubernetes)

codemogger (top 5)ripgrep
type Scheduling - staging/src/k8s.io/api/node/v1beta1/types.go429 files matched
type Scheduling - staging/src/k8s.io/api/node/v1/types.go(keyword: "scheduling")
type SchedulingApplyConfiguration - staging/.../node/v1/scheduling.go
function runPodAndGetNodeName - test/e2e/scheduling/predicates.go
type createPodsOp - test/integration/scheduler_perf/scheduler_perf.go

"container health check probes and restart policy" (Kubernetes)

codemogger (top 5)ripgrep
type ContainerFailures - test/utils/conditions.go1,652 files matched
variable _ - test/e2e/common/node/container_probe.go(keyword: "container")
function checkContainerStateTransition - pkg/kubelet/status/status_manager.go
function TestDoProbe_TerminatedContainerWithRestartPolicyNever - pkg/kubelet/prober/worker_test.go
function proveHealthCheckNodePortDeallocated - pkg/registry/core/service/storage/storage_test.go

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

CodemoggerのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Codemoggerに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Codemoggerをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. CodemoggerのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "codemogger": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてCodemoggerのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. CodemoggerのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Codemoggerを使ってこのタスクを手伝ってもらえますか?
Codemogger
はい、読みました。
Codemoggerで調べた結果をお伝えします。

よくある質問

Codemogger MCPサーバーは何に使いますか?

Codemoggerは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでCodemogger MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでCodemoggerを利用できます。

TypingMindでCodemogger MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Codemoggerを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Codemogger MCPをTypingMindに接続するにはどうすればよいですか?

CodemoggerはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでCodemogger MCPのどのようなツールを利用できますか?

CodemoggerはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Codemogger MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Codemoggerで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇