Context7
ส่งคู่มือการใช้ไลบรารีและเฟรมเวิร์กรุ่นล่าสุดให้ AI อ่านก่อนตอบ ช่วยให้โค้ดที่ AI เขียนไม่ใช้คำสั่งเก่าที่เลิกใช้แล้ว
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
Vectorless, structure-first search over large Markdown libraries: section trees + zh/en BM25
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
ต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json
{
"mcpServers": {
"markindex": {
"command": "npx",
"args": [
"-y",
"markindex",
"mcp",
"--reindex-on-start"
]
}
}
}พิมพ์คำสั่งนี้ใน Terminal
claude mcp add markindex -- npx -y markindex mcp --reindex-on-startตัวนี้ต้องใส่ค่าในคำสั่งเปิดเอง ให้คัดลอกค่าตั้งแล้วเติมค่า
วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"markindex": {
"command": "npx",
"args": [
"-y",
"markindex",
"mcp",
"--reindex-on-start"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้ต้องใส่ค่าในคำสั่งเปิดเอง ให้คัดลอกค่าตั้งแล้วเติมค่า
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"markindex": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"markindex",
"mcp",
"--reindex-on-start"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 6 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub jackjin1997 ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต
ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน
รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น
registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก
รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)
repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.1.1) เข้า registry 4 วันที่ผ่านมา
โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Node.js ในเครื่องด้วย
ในหมวดเดียวกันมี 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 รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ
Vectorless, structure-first retrieval over large libraries of long Markdown documents — for agents.
MarkIndex parses every Markdown file into a tree of its own sections, stores the trees, the original lines and a mixed Chinese/English BM25 index in one SQLite file, and gives an agent five read-only tools to walk "library → folder → document → section" and read the original text with line numbers. No embeddings, no vector database, no chunking guesswork: the document's own structure is the index, and every piece of evidence can be cited back as [doc_path, L - ].
Inspired by VectifyAI/PageIndex, MarkIndex is an independent,
unofficial TypeScript implementation focused on Markdown. It is not affiliated with or endorsed by VectifyAI.
中文说明:README.zh-CN.md
retrieve() loop.# inside code fences, skipped heading levels, BOM / CRLF — every source line belongs to exactly one node, and oversized sections are split at block boundaries into chunk nodes.Intl.Segmenter word segmentation (Chinese, English and mixed text, identifiers like C++, ISO-27001, v2.1), plus a trigram substring index as a second pass.next_steps guidance and stay under a 95 000-character budget, paginating large outlines and sections.npm install markindex # library + CLI (Node.js >= 22.12)
npx markindex --help
From source:
git clone https://github.com/jackjin1997/markindex.git && cd markindex
npm install && npm run build node dist/cli.js --help # or npm link to get a markindex command
Optional, only for LLM features (summaries, retrieve(), agent-mode evaluation): install the AI SDK provider you want, e.g. npm install @ai-sdk/anthropic, and set its API key (ANTHROPIC_API_KEY, …). With npx and no local install, put the provider in the same temporary environment:
npx -p markindex -p @ai-sdk/anthropic markindex index ./docs --summary-model anthropic:claude-sonnet-5-5
# Build or incrementally update the index (stored in <root>/.markindex/index.db)
markindex index ./docs markindex index ./docs --summary-model anthropic:claude-sonnet-5-5 --estimate # cost estimate, no LLM calls markindex index ./docs --summary-model anthropic:claude-sonnet-5-5 # with node summaries markindex index ./docs --summary-model anthropic:claude-sonnet-5-5 --summary-rpm 50 --summary-tpm 40000 # rate-limited markindex index ./docs --json # machine-readable report markindex index ./docs --no-setext # converter output with --- page breaks markindex index ./docs --ignore 'drafts/' --ignore '*.tmp.md' # extra ignore patterns (repeatable)
markindex tree ./docs guides/setup.md --depth 3
markindex search ./docs "离职 补偿" markindex search ./docs "ISO-27001 audit" --folder policies --limit 5 --json
markindex mcp ./docs markindex mcp ./docs --reindex-on-start
markindex eval ./docs --questions questions.jsonl --mode bm25 --out report.json markindex eval ./docs --questions questions.jsonl --mode agent --model anthropic:claude-sonnet-5-5 --out report.json markindex eval ./docs --questions questions.jsonl --mode agent --model anthropic:claude-sonnet-5-5 --rpm 50 --tpm 40000
Rate limits. Calls are always bounded by concurrency (--concurrency for eval; 8 for summaries) and the AI SDK's retries, which already honor retry-after / retry-after-ms on 429 / 5xx responses (up to 60 s). To stay under a provider quota, add a client-side limit: --summary-rpm / --summary-tpm on index, --rpm / --tpm on eval (agent mode). rpm caps requests and tpm caps *estimated input* tokens in any sliding 60 s window; both are shared by all documents (index) or all questions (eval) of the run, and waiting callers are served in order. Input tokens are estimated from the prompt text (about 1 token per CJK character, otherwise 4 characters), so leave headroom below the real quota; output tokens and tool definitions are not counted. A single request larger than the tpm still goes through, alone. In the library, pass rateLimit: { requestsPerMinute, inputTokensPerMinute } to summarizeDocument / indexLibrary({ summary }) or retrieve(); reuse the same object to share one budget.
--summary-model / --model take : ; MarkIndex imports @ai-sdk/ dynamically, so only the provider you use needs to be installed. Every command accepts --db to use a different index file. Put the index on a local disk: the writer lock uses hard links and SQLite runs in WAL mode, neither of which works reliably on exFAT, SMB / NFS shares or other network volumes. If the documents live there, keep them in place and point --db at a local path (e.g. --db ~/.cache/markindex/docs.db).
Indexing is incremental: files are compared by content hash, only new or changed documents are rebuilt (one transaction per document), deleted files are removed, and summaries are cached by node content hash. Scanned files are .md and .markdown (not .mdx). Ignored are: paths matched by the library's own .gitignore files (at any level under the root; global git excludes and .git/info/exclude are not read), by an optional .markindexignore file at the root (same syntax, for rules you don't want in .gitignore) and by --ignore options (gitignore syntax, relative to the root, repeatable; ignore: string[] in the library API; also accepted by mcp --reindex-on-start; a leading ./ is dropped, a leading / anchors at the root as in gitignore, and absolute filesystem paths or ../ are rejected). The sources only add exclusions: a ! rule in .markindexignore or --ignore cannot re-include a path that a .gitignore excludes. A document that becomes ignored is removed from the index on the next run. Dot-directories such as .git and .markindex are skipped and symlinks are not followed. One writer at a time (a second index fails fast); readers such as the MCP server are never blocked. When the index was built by an older MarkIndex version or with different tree parameters, the next index run rebuilds every document (full rebuild: … in the output, rebuilt in the report); cached summaries are reused.
Page breaks from PDF / HTML converters. Converters often emit a bare --- line right after a page's last paragraph. CommonMark reads that as a setext heading, so the whole paragraph becomes a level-2 heading. index warns when it sees setext h2 headings whose text spans several lines or exceeds 120 characters (warning : … on stdout, warnings in the JSON report). For such libraries pass --no-setext (also on mcp --reindex-on-start; setext: false in the library API): --- then is a thematic break and === plain text. The setting is stored in the index: later runs without the flag (index, mcp --reindex-on-start, Library.index()) keep it; pass --setext (setext: true) to turn it back on. Changing it rebuilds the index.
import { openLibrary } from 'markindex'
// Index (or update) a folder, then open it read-only for agents. const writer = openLibrary({ root: './docs', readonly: false }) await writer.index() // { added, updated, removed, unchanged, skipped, summaryErrors, warnings } writer.close()
const lib = openLibrary({ root: './docs' }) const envelope = await lib.callTool('search_documents', { query: 'termination notice period' }) console.log(JSON.parse(envelope)) // { success: true, data: { results: [...] }, next_steps: {...} }
import { generateText, stepCountIs } from 'ai'
import { anthropic } from '@ai-sdk/anthropic' import { AGENT_INSTRUCTIONS, createAiSdkTools, openLibrary } from 'markindex'
const lib = openLibrary({ root: './docs' }) const { text } = await generateText({ model: anthropic('claude-sonnet-5-5'), system: AGENT_INSTRUCTIONS, // browse first, read structure, cite [doc_path, L - ] tools: createAiSdkTools(lib), stopWhen: stepCountIs(15), prompt: 'What notice period applies when an employee resigns?', })
retrieve() runs the same tools in a model loop and returns evidence only (original text re-read from the index by line range — never model-written text), plus usage and why it stopped:
import { anthropic } from '@ai-sdk/anthropic'
import { openLibrary, retrieve } from 'markindex'
const lib = openLibrary({ root: './docs' }) const { evidence, usage, stopReason } = await retrieve(lib, 'What notice period applies when an employee resigns?', { model: anthropic('claude-sonnet-5-5'), maxSteps: 12, maxInputTokens: 200_000, rateLimit: { requestsPerMinute: 50, inputTokensPerMinute: 40_000 }, // optional, client-side }) for (const e of evidence) console.log(${e.docPath} L${e.startLine}-${e.endLine}, e.titlePath.join(' > '))
Lower-level building blocks are exported too: parseMarkdown, buildTree, optimizeTree, openStore, indexLibrary, searchNodes, summarizeDocument, estimateSummaryCost, TOOL_CONTRACT, createMcpServer.
Build the index first (npx markindex index /path/to/docs), then register the server. MarkIndex is also listed in the official MCP Registry as io.github.jackjin1997/markindex, so registry-aware clients can install it from there (they start it as npx markindex mcp --reindex-on-start).
Claude Code
claude mcp add markindex -- npx markindex mcp /path/to/docs
Cursor (~/.cursor/mcp.json or .cursor/mcp.json in a project)
{
"mcpServers": { "markindex": { "command": "npx", "args": ["markindex", "mcp", "/path/to/docs"] } } }
The server sends AGENT_INSTRUCTIONS as its MCP instructions and marks all tools read-only.
| Tool | What it does |
|---|---|
browse_documents | List a folder: sub-folders and documents (path, title, description, tokens), paginated. The default discovery tool. |
get_document | One document's metadata, front matter, size and read_structure_first (true above 15 000 tokens). |
| get_document_structure | The section outline (node ids, titles, line ranges, tokens, summaries
ตัดมาแค่ช่วงต้น อ่านต่อใน repo