Context7
ส่งคู่มือการใช้ไลบรารีและเฟรมเวิร์กรุ่นล่าสุดให้ AI อ่านก่อนตอบ ช่วยให้โค้ดที่ AI เขียนไม่ใช้คำสั่งเก่าที่เลิกใช้แล้ว
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
Minimal RAG-over-a-corpus MCP retrieval: search_knowledge returns cited chunks. Local embeddings.
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
ต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json
{
"mcpServers": {
"rag": {
"command": "uvx",
"args": [
"jaimenbell-rag-mcp"
]
}
}
}พิมพ์คำสั่งนี้ใน Terminal
claude mcp add rag -- uvx jaimenbell-rag-mcpวางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"rag": {
"command": "uvx",
"args": [
"jaimenbell-rag-mcp"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"rag": {
"type": "stdio",
"command": "uvx",
"args": [
"jaimenbell-rag-mcp"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 7 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub jaimenbell ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต
ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน
รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น
registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก
รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)
repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.1.0) เข้า registry 4 เดือนที่ผ่านมา
โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Python (uv) ในเครื่องด้วย
ในหมวดเดียวกันมี Context7, Codebase Memory, Exa
server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว
อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi
ส่งคู่มือการใช้ไลบรารีและเฟรมเวิร์กรุ่นล่าสุดให้ AI อ่านก่อนตอบ ช่วยให้โค้ดที่ AI เขียนไม่ใช้คำสั่งเก่าที่เลิกใช้แล้ว
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
Connect AI agents to Exa for web search, content fetching, and multi-step research.
ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ
A minimal, honest RAG-over-a-corpus MCP retrieval tool. One tool,
search_knowledge(query, k, doc_class=None), that embeds a query, vector-searches a local
corpus, and returns passages with citations (source + heading + chunk index) so answers
are traceable.
Built to slot into the mcp-factory manifest model. Fully local + $0 (no paid embedding API).
source + heading + chunk_index... traversal) are refused.k is clamped to [1, 20]; empty queries are rejected.requirements.txt).| Layer | Choice |
|---|---|
| Embeddings | local ONNX all-MiniLM-L6-v2 (384-dim, CPU, $0) -- default. bge-large-en-v1.5 (1024-dim, 512-token context) available opt-in via RAG_MCP_EMBEDDER=bge; see CUTOVER.md. |
| Vector store | ChromaDB embedded PersistentClient (zero-infra) |
| Server | mcp Python SDK 2.x, stdio transport, protocol revision 2026-07-28 |
Pinned to mcp==2.0.0, the first SDK release implementing MCP protocol revision 2026-07-28. The server serves both eras on the same stdio connection -- the client's first frame picks:
| Client opens with | Negotiated revision | Notes |
|---|---|---|
a per-request _meta envelope (or a server/discover probe) | 2026-07-28 | stateless per-request envelope; no initialize |
the classic initialize handshake | 2025-11-25 | handshake era caps here -- expected, not a downgrade |
2026-07-28 is not reachable via the `initialize` handshake; it is a "modern" revision reached through server/discover or an inline _meta version stamp. Era selection is automatic and per-connection -- there is no server-side flag.
tests/test_protocol_version.py asserts both paths end-to-end, so a dependency rollback that silently drops the server to an older revision fails CI instead of passing quietly.
python -m venv .venv && .venv/Scripts/python -m pip install -r requirements.txt
python -m rag_mcp.cli ingest path/to/docs --db ./store.chroma
python -m rag_mcp.cli ingest path/to/docs --db ./store.chroma --full
python -m rag_mcp.cli query "your question" --db ./store.chroma --corpus path/to/docs -k 5
python -m rag_mcp.cli query "your question" --db ./store.chroma --corpus path/to/docs --doc-class note
python run_server.py # operational entrypoint (referenced by mcp.yaml) python -m rag_mcp # same server, via the packaged console entry point rag-mcp # after pip install jaimenbell-rag-mcp -- console script
Ingest is incremental by default. A manifest inside the store dir records a SHA-256 of each file's decoded text; a run re-embeds only what actually changed, and prunes what upsert alone never could (chunks of deleted/renamed notes, and trailing chunks of notes that got shorter).
Measured on a live 2808-file / 26.6 MiB corpus (bge, CPU):
| Run | Cost |
|---|---|
| tick with no changes | ~0.7s (walk + read + hash everything) |
| full re-embed | ~2h33m (50,109 chunks at ~5.5 chunks/sec) |
That is what makes a frequent schedule affordable: reingest.bat is meant to run every 15 minutes instead of once daily at 03:00, which had left a note written at 03:05 invisible to search_knowledge for nearly 24 hours.
The manifest is only trusted when the run identity matches -- embedder, embedding dimension, collection and chunking parameters. Change any of them and every file is re-embedded, so an embedder swap can never be silently half-applied. A missing, corrupt, or mismatched manifest, or a manifest against an empty store, all degrade to a full rebuild; nothing degrades to a wrong skip.
The manifest's skip is a whole-file hash, so it cannot see the duplication that actually hurts retrieval: a daily snapshot series (fleet-health-2026-07-23.md and friends) repeats yesterday's paragraphs verbatim inside a file whose hash still changed. Measured on the live vault, one ## RED Bots status line took five distinct values across fifteen consecutive files and crowded a top-10 with byte-identical copies of itself, burying the document that explained it at rank 16.
Ingest therefore also de-duplicates at chunk level, but only within a dated series and only against the *immediately preceding* snapshot. The first occurrence is always embedded and keeps its own date as its source; later verbatim repeats are not embedded, and instead extend the survivor's repeat_dates metadata, which search_knowledge returns as snapshot_date / also_unchanged_on / snapshots_covered. So "what did this say on date X" is still answerable -- that is why the series is de-duplicated rather than excluded. A value that changes and later returns is kept, because it is a new fact rather than a repeat.
Scope is narrow and stated with the rule in rag_mcp/snapshots.py: filename ending in -YYYY-MM-DD, at least 3 such files sharing a directory and stem, byte-identical under an identical heading. On the live corpus that is 316 of 2,814 files and collapses 842 of 50,428 chunks (17.5% of series chunks, 1.67% corpus-wide) while touching zero ordinary notes. Disable with --no-snapshot-dedupe.
--full rebuilds in place (ignores the manifest, keeps the store); --clean deletes the store first. Both still WRITE a manifest, so the next run is cheap. reingest-clean.bat (weekly) remains a belt-and-braces reset.
Register via mcp.yaml (validated against mcp-factory's Manifest loader). The tool is search_knowledge(query, k, doc_class=None); it reads the store configured by the RAG_MCP_* env vars.
Every chunk's metadata carries a doc_class, set at ingest time. It is "handoff" when the doc's YAML frontmatter has type: handoff or a tags entry of handoff (case-insensitive), or -- since a doc's frontmatter is optional and the session mirrors this exists to flag often carry none -- when the file sits directly under a handoff_mirror_dir (default context/, configurable via ingest()'s handoff_mirror_dir=/handoff_mirror_basenames= params or the CLI's --handoff-mirror-dir/--handoff-mirror-basename flags) and is named handoff.md / active.md / resume.md, or matches an anchored "handoff" filename token (e.g. handoff-2026-09-03.md, morning-dispatch-handoff.md) -- never a bare substring, so a title that merely mentions the word (handoff-skill-redesign-spec.md) stays "note". Everything else defaults to "note". Pass doc_class to scope a query to one class, e.g. to keep an agent's own session/handoff bookkeeping out of a knowledge lookup:
from rag_mcp.search import search_knowledge
search_knowledge( "what did we decide about X", k=5, store=store, corpus_root=root, doc_class="note", )
doc_class is a validated, case-sensitive enum -- "note" or "handoff" (see rag_mcp.search.ALLOWED_DOC_CLASSES) -- or omitted for no filter. A value outside that set (wrong case, a typo, any other type) returns a structured invalid_doc_class error, same shape as invalid_query. A syntactically valid doc_class that simply has no matches in the current store still fails soft to an empty, ok: true result.
An incremental ingest run backfills doc_class (and any other metadata-schema change) onto already-embedded, content-unchanged chunks WITHOUT re-embedding them -- see ingest.CURRENT_METADATA_VERSION. A store that predates this feature entirely gets the correct doc_class on every chunk after exactly one incremental run, not a full --clean rebuild.
python -m pytest # 272 passed
This count is the total collected, CI-enforced against the live pytest summary (scripts/check_readme_counts.py, wired into .github/workflows/ci.yml). One test is platform-conditional -- WINDOWS_ONLY in tests/test_reindex_handle_release.py only runs on Windows -- so Linux CI reports 271 passed, 1 skipped for the same 272-test suite; the gate compares passed-plus-skipped against this claim, not passed alone, so that expected skip does not read as drift.
rag_mcp/
chunking.py heading-scoped, overlapping markdown chunks store.py VectorStore (Chroma) + Embedder protocol (MiniLM default + BgeEmbedder opt-in + offline HashEmbedder) ingest.py idempotent ingest pipeline with source/heading/chunk-index metadata; incremental by default manifest.py per-file content hashes -> skip unchanged files, prune stale chunks search.py search_knowledge: cited, auth-scoped, fail-soft, bounded server.py MCP stdio server exposing search_knowledge config.py env-driven Config cli.py ingest + query CLI main.py console entrypoint (python -m rag_mcp / rag-mcp script); fails loud on missing config run_server.py operational MCP entrypoint (referenced by mcp.yaml) mcp.yaml manifest (mcp-factory model)
Maintained by Jaimen Bell. For production MCP integrations, custom servers, or agent-reliability work, see jaimenbell.dev.
Building your own MCP server? The MCP Starter Kit has templates, a build playbook, and packaging war-stories from shipping this one.
mcp-name: io.github.jaimenbell/rag-mcp