@楽曲作りまくりおじさん 楽曲作りまくりおじさん authored 6 days ago
.github Add MCP server with llama.cpp integration and docs 8 days ago
document docs: comprehensive overhaul of README and documentation files for Tauri 2 and Gemma 3 integration 6 days ago
scripts feat: integrate llama-server sidecar with Gemma 3 300M support 7 days ago
src fix: align all embedding dimensions to 384 for Gemma 3 300M consistency 6 days ago
src-tauri fix: align all embedding dimensions to 384 for Gemma 3 300M consistency 6 days ago
test fix: align all embedding dimensions to 384 for Gemma 3 300M consistency 6 days ago
.gitignore build: update dependencies and gitignore for Sidecar integration 7 days ago
README.md docs: comprehensive overhaul of README and documentation files for Tauri 2 and Gemma 3 integration 6 days ago
analyze_nesting.js feat: add rust support to nesting/line scripts and fix app.exe startup dll path 7 days ago
bun.lock chore: migrate to Tauri/Rust backend with SeaORM and add unit/integration tests 7 days ago
count_lines.js feat: add rust support to nesting/line scripts and fix app.exe startup dll path 7 days ago
generate-icon.js Add MCP server with llama.cpp integration and docs 8 days ago
jsconfig.json Add MCP server with llama.cpp integration and docs 8 days ago
launch.cmd chore: migrate to Tauri/Rust backend with SeaORM and add unit/integration tests 7 days ago
mcp.json.sample Add MCP server with llama.cpp integration and docs 8 days ago
package-lock.json Add MCP server with llama.cpp integration and docs 8 days ago
package.json chore: remove electron-related source files and dependencies 6 days ago
README.md

🦀 SQLite Vector MCP Server (Tauri 2 Edition)

究極のパフォーマンスとポータビリティを追求した、ローカル完結型ベクトル検索基盤

Tauri 2
Rust
Gemma 3

📝 イントロダクション

このプロジェクトは、Model Context Protocol (MCP) に準拠した、高性能なベクトル検索サーバーです。かつて Electron + Bun で構成されていた基盤を、Tauri 2 + Rust へと完全にフルスクラッチで移植しました。

単なる移植に留まらず、Gemma 3 300M Embedding モデルのフルサポートと、llama-serverSidecar 自動管理機能を標準装備。これにより、外部サーバーや複雑な環境構築に頼ることなく、ダブルクリック一つで高度なセマンティック検索環境があなたのローカルマシン上で完結します。


✨ 主要な特徴と技術的優位性

1. 🚀 超軽量・高反応な常駐型デザイン

バックエンドを Rust で構築したことで、Electron 時代と比較してメモリ使用量を劇的に削減しました。システムトレイにスマートに常駐し、バックグラウンドで静かに、かつ確実に MCP リクエストに応答します。

2. 🔍 プロ格のベクトル検索性能

sqlite-vec 拡張を Rust から直接制御。SQLite の堅牢なリレーショナル機能と、高速な近傍検索(MATCH 演算子)を融合させました。

3. 🤖 Sidecar 統合による「ゼロ設定」LLM

llama-server をアプリケーションに内蔵(Sidecar)。アプリの起動と共に、最適化された Embedding 生成エンジンが自動的にスピンアップします。

4. 🛠️ 型安全なデータ管理 (SeaORM & SQLite)

Rust の強力な型システムと SeaORM を採用。リレーショナルデータとベクトルデータの不整合を排除し、created_at / updated_at の自動更新トリガーなど、運用面での信頼性も追求しています。

5. 📅 万全のロギングと運用性

tauri-plugin-log による詳細なログ記録に加え、10MB×5世代の自動ローテーションを実装。デバッグ時にはプロジェクトルート、本番環境では OS 標準のログフォルダへと適切に振り分けます。


🏗️ システムアーキテクチャ

本システムは、高い分離性と連携性を両立した 3 レイヤー構造を採用しています。

graph TD
    subgraph "Frontend Layer (WebView2)"
        UI["User Interface (React/JS)"]
    end
    
    subgraph "Tauri Backend Layer (Rust / v2)"
        Tray["System Tray Manager"]
        Axum["MCP SSE Server (Axum)"]
        SeaORM["ORM Logic (SeaORM)"]
        LlamaClient["Llama API Client"]
        SidecarMgr["Sidecar Process Manager"]
    end
    
    subgraph "Sidecar Layer (Local Process)"
        llama["llama-server.exe"]
        Model["Gemma 3 300M GGUF"]
    end
    
    subgraph "Persistence Layer"
        DB[("SQLite + sqlite-vec")]
    end
    
    UI <-->|Tauri Commands| Tray
    Axum <--> SeaORM
    SeaORM <--> DB
    LlamaClient <-->|HTTP/JSON| llama
    SidecarMgr -->|Spawn/Lifecycle| llama
    llama -->|Memory Mapped| Model
    SidecarMgr -.->|DLL Path Solution| llama

🚀 クイックスタート

プリリクエスト

  • Rust: 1.75 以上
  • Bun (または Node.js): パッケージ管理用
  • Vulkan 1.3 互換ドライバ: GPU 加速を利用する場合

1. セットアップ

専用のスクリプトを使用して、必要なバイナリとモデルを自動的に収集します。

# llama-server バイナリのダウンロード (Windows 用)
pwsh -File scripts/setup-llama-server-vulkan.ps1

# Gemma 3 300M モデルのダウンロード
pwsh -File scripts/setup-model.ps1

2. 開発起動

bun install
bun tauri dev

起動後、システムトレイに 🦀 アイコンが表示されます。


🛠️ MCP ツール仕様

本サーバーは以下のツールを外部エージェント(Claude Desktop 等)に提供します。

ツール名 説明 主要引数
add_item_text 文書を追加(自動ベクトル化) content, path
search_text 自然言語による類似文書検索 content, limit
add_item ベクトルを指定して文書追加 content, vector, path
search_vector 純粋なベクトル検索 vector, limit
llm_generate 内蔵 LLM によるテキスト生成 prompt, n_predict

📘 詳細ドキュメント

より深い情報を知りたい場合は、以下のドキュメントを参照してください。


📜 ライセンス

ISC License.