qs-rag
Click on "Deploy 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., "@qs-ragwhat did we decide about the pricing page last quarter?"
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.
qs-rag
ローカルの知識ベースを自然文でセマンティック検索する MCP サーバー。
Markdown ノートや過去の作業ログを「見出し単位」で索引し、grep / 全文探索の代わりに意味で当てにいく。
Model Context Protocol (MCP) server for semantic search over a local knowledge base. Fully local, zero API cost.
実際のインサイドセールス業務で日次運用しているツール。AI エージェント(Claude Code)が過去の方針・フォーマット・経緯を思い出すための「外部記憶」として使っている。
なぜ作ったか
エージェントに数百件の Markdown メモや過去セッションログを参照させたいが、grep はキーワード一致しか拾えず「あれ何だっけ」系の曖昧な問いに弱い。かといってクラウドのベクトル DB を挟むとコストと秘匿性の問題が出る。
→ 埋め込み・ストア・検索を全部ローカルに閉じた RAG を MCP として実装した。
Related MCP server: rag-mcp
設計のポイント
完全ローカル / API コストゼロ — 埋め込みは Ollama (
snowflake-arctic-embed2・1024次元・多言語)。外部送信なしネイティブビルド不要のストア —
node:sqliteにベクトルを置き、メモリ上のブルートフォース cos 類似で検索。件数規模的にこれで十分速く、依存を増やさない2段階の差分インデックス —
mtimeで粗くふるい、変化したものだけsha256で確定判定。検索のたびに 30 秒スロットルで自動更新するので索引が陳腐化しないProgressive Disclosure — まず
search_knowledgeで当たりを付け、get_detailで本文+同一ファイル内の隣接チャンクを開く。エージェントが文脈を横に広げられる埋め込み層を 1 ファイルに隔離 — 別モデル / 別エンジンへの差し替えは
src/embed.jsだけ変えれば済む
MCP ツール
ツール | 役割 |
| 自然文クエリで意味検索。まずこれで当たりを付ける |
| チャンク本文+同一ファイル内の隣接チャンク一覧 |
| 即時フル差分 reindex |
domain でソース種別(個人ノート / 同期ドキュメント / 過去セッションログ)を絞り込める。
cc-log は Claude Code の ~/.claude/projects/-Users-kazuki/*.jsonl に加え、
Codex の ~/.codex/sessions/YYYY/MM/DD/*.jsonl も同じ索引へ統合する。
Codex側は response_item.payload の user / assistant 本文だけを抽出し、
システム指示・推論・ツール出力・起動時のAGENTS wrapperは除外する。
検索時の差分reindexにより、Codexの新規・更新セッションも自動反映される。
スタック
Node.js (ESM) / @modelcontextprotocol/sdk / Ollama / node:sqlite
セットアップ
npm install
# Ollama を起動し、埋め込みモデルを pull
ollama pull snowflake-arctic-embed2
node bin/reindex.js # 初回フルインデックス
node bin/search.js "クエリ" # ターミナルから直接検索MCP ホスト(Claude Code 等)には stdio サーバーとして登録する。
索引対象の指定
既定では ~/notes(Markdown)と ~/.claude/projects・~/.codex/sessions(エージェントのセッションログ)を索引する。差し替えは環境変数で行う。
環境変数 | 既定値 | 用途 |
| (なし) | 索引対象を JSON 配列で直接指定 |
| (なし) | 同じ JSON を書いたファイルのパス |
|
| インデックス DB の置き場所 |
|
| Ollama のエンドポイント |
|
| 埋め込みモデル |
// RAG_SOURCES の例。root は ~ 展開に対応する
[
{ "root": "~/notes", "kind": "md", "domain": "knowledge", "excludeDirs": ["_archive"] },
{ "root": "~/work/docs", "kind": "md", "domain": "context" },
{ "root": "~/.claude/projects", "kind": "jsonl", "domain": "cc-log", "recursive": true }
]kind は md(Markdown を見出し単位でチャンク化)か jsonl(セッションログを turn 単位で取り込み)。domain は検索時の絞り込み・除外の単位になる。
個人で開発した MCP サーバー群の 1 つ。設計の出発点として yuya-mcp の RAG パートを参考にした。
This server cannot be deployed
Maintenance
Related MCP Connectors
Local ML: speech to text (SRT/VTT), text embeddings, reranking, similarity, entities, zero-shot.
141Universal persistent memory and knowledge retrieval layer for AI agents and LLMs.
Semantic nearest-neighbour search over your datasets, plus indices and projections.
Personal memory layer: files, notes, messages, tasks and email, semantically indexed.
Related MCP Servers
- AlicenseAqualityAmaintenancePrivacy-first local document search using semantic search. Runs entirely on your machine with no cloud services, supporting PDF, DOCX, TXT, and Markdown files.95,221 npm412MIT
- FlicenseAqualityDmaintenanceEnables indexing local documents (PDF, Markdown, text, code) into a knowledge base and querying them via semantic search using local embeddings, all running privately on your machine.4-
- FlicenseNot gradedqualityDmaintenanceEnables semantic search over personal files using natural language, with optional AI summarization, all running locally.-
- AlicenseAqualityDmaintenanceEnables semantic search and question answering over a knowledge base using hybrid retrieval and grounded answers, all running offline with no API keys.4MIT