Context7
ส่งคู่มือการใช้ไลบรารีและเฟรมเวิร์กรุ่นล่าสุดให้ AI อ่านก่อนตอบ ช่วยให้โค้ดที่ AI เขียนไม่ใช้คำสั่งเก่าที่เลิกใช้แล้ว
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
AST-based semantic code search; results ship with their call graph (calls + callers).
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
ต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json
{
"mcpServers": {
"semhood": {
"command": "uvx",
"args": [
"semhood"
]
}
}
}พิมพ์คำสั่งนี้ใน Terminal
claude mcp add semhood -- uvx semhoodวางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"semhood": {
"command": "uvx",
"args": [
"semhood"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"semhood": {
"type": "stdio",
"command": "uvx",
"args": [
"semhood"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 7 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub ahmeedgamil ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต
ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน
รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น
registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก
รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)
repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.1.0) เข้า registry 5 เดือนที่ผ่านมา
โปรแกรมที่รองรับ 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 รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ
Stop grepping. Find the exact code your AI agent needs by intent, not keywords. semhood is an AST-aware semantic code search engine that retrieves code by what it does, complete with call-graph context and optional LLM enrichment.
*Runs fully offline with zero API keys — or plug in cloud embeddings — Voyage's code-specialized models, or OpenAI's strong general-purpose (natural-language) embeddings — for higher-quality retrieval. Optional LLM enrichment adds a logic summary and developer queries to each chunk that you commit once and share — and every result ships with its call graph (what it calls + what calls it).*
Why semhood · Install · Quickstart · MCP Setup · Architecture · Config · Troubleshooting
┌──────────────┐ parse + embed ┌──────────────┐ LLM enrich ┌──────────────┐
│ source tree │ ───────────────────► │ code vector │ ──────────────► │ description │ │ │ │ + BM25 sparse│ │ + queries │ └──────────────┘ └──────────────┘ └──────────────┘
Search via CLI, HTTP, or MCP.
semhood indexes your codebase the way a developer thinks about it: every function, method, and class becomes a chunk, with its call graph, docstring, and signature attached. You search by intent (*"how do we retry transient payment failures?"*) and get back the few chunks that actually answer the question.
Two stages: structural (always, free, ~seconds) and enrichment (optional, LLM or code agent, drains a pending queue). The index is queryable after stage 1; stage 2 just makes natural-language matches sharper.
The package ships an MCP server so Claude Desktop, Cursor, Cline, Continue, Kiro, Zed, and any other MCP-aware client can call semhood as a tool — your AI agent gets search, find_symbol, and get_chunk_context next to its built-in read_file and grep.
Most code search embeds your raw source and hopes a natural-language query lands near it. semhood adds two things plain vector search and grep can't:
An LLM reads each function and class and writes two artifacts, each stored as its own search vector:
This is the part that makes retrieval click. When you search with a question, you're matching against questions the code was pre-labeled to answer — so the right chunk wins even when it shares *zero keywords* with your query. You generate the enrichment once, commit it to git, and your whole team — and every AI agent — retrieves better for free. → Portable enrichment
Why enrichment matters: some code has no words to search. Plain semantic search only works when the source *contains* language close to your question. Plenty of important code doesn't — terse names, raw math, business rules. Consider a function like:
def _calc(p, r, n):
return p * (1 + r) ** n
Ask *"how do we calculate compound interest?"* and plain vector search comes up empty — there's no "interest", no "compound", nothing in the source that means anything close to the question. Enrichment reads the code and generates:
{
"logic_summary": "Computes compound interest — final balance = principal × (1 + rate)^periods.", "developer_queries": [ "how do we calculate compound interest?", "where is the future-value / compounding formula?", "how is a balance grown over multiple periods?" ] }
Now your question matches a pre-written question that means the same thing, and _calc ranks first — despite sharing *zero words* with your query. The cryptic-but-critical functions are exactly the ones plain semantic search misses and enrichment rescues.
Each chunk knows what it calls and what calls it. So a result isn't just "here's the function" — it's the function *plus its neighborhood*. One get_chunk_context call returns the body, calls, and called_by together, so your AI agent gets the caller/callee context in the same response instead of opening files and tracing references by hand.
code, description, developer_queries) + BM25 sparse, all in one queryread_file + grep calls with one search--changed re-indexes only what git diff touched# Local-only (free, offline embeddings via sentence-transformers)
pip install "semhood[local]"
pip install "semhood[all]"
pip install "semhood[anthropic,local]"
Prefer an isolated CLI install? pipx keeps semhood and its deps out of your global environment — recommended for a command-line tool:
pipx install "semhood[local]"
Just want to try it without installing? With uv, run it straight from PyPI:
uvx --from "semhood[local]" semhood index .
Requires Python 3.11+. First index downloads the embedding model (~420 MB for the default
all-mpnet-base-v2) and caches it.
No config files, no API keys, no setup. semhood works offline with a local embedder by default. Just cd into any project and index it:
# 1. structural index — no LLM, free, no config needed
cd ~/code/your-project semhood index .
semhood search "how does the payment retry logic work?"
semhood enrich
semhood query "where is auth handled?"
The first command auto-starts a background daemon that loads the embedding model once and keeps it warm — so every later search (from any terminal or your editor) is instant. Each project gets its own index automatically under ~/.semhood/indexes/, keyed by repo root. One global config lives at ~/.semhood/config.yaml (created on first run); there is no per-project config file to manage.
| Command | What it does |
|---|---|
semhood index | Stage 1: parse + embed + upsert. No LLM. |
semhood index --changed | Incremental — only files in git diff HEAD~1. |
semhood index --reset | Rebuild from scratch (after changing the embedding model). |
semhood enrich | Stage 2: drain pending chunks through an LLM. |
semhood enrich --force | Re-enrich every chunk. |
semhood compact | Prune orphaned records from .semhood/enrichment.jsonl. |
semhood search "query" | Pure retrieval. --format json/paths/compact/table. |
semhood query "question" | Full RAG: retrieval + answer generation. |
semhood status | Per-state chunk counts + provider summary. |
semhood projects | List every indexed project in ~/.semhood/indexes/. |
semhood serve | Run the daemon in the foreground (it otherwise auto-starts). |
semhood stop | Stop the background daemon. |
semhood doctor | Daemon + config health check. |
All commands act on the current project (nearest git root of your cwd).
Override with
--root /path/to/repo. They're thin clients to the daemon — no
model loading, no
config.yamlflag.
The package ships an MCP server (semhood-mcp) that exposes eight tools — five for search, three for agent-driven enrichment:
| Tool | Use it for |
|---|---|
search | Semantic search over the index. |
search_many | Several searches in one call — results grouped per query. |
find_symbol | Exact-name lookup for a function/method/class. |
get_chunk_context | Full source + calls + called_by for a symbol. |
index_status | Sanity-check the index. |
list_pending_enrichments | Get a batch of chunks needing LLM enrichment. |
save_enrichment | Persist a summary the agent wrote. |
enrichment_progress | Loop sentinel — pending vs done. |
Register it once, globally — it then works in every project you open, with no per-project setup. This is the entire config — drop it into your editor's *user-level* MCP file:
{
"mcpServers": { "semhood": { "command": "semhood-mcp" } } }
Where that file lives, per editor (click to expand)
| Editor | Config file |
|---|---|
| Claude Desktop (macOS) | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Claude Desktop (Windows) | %APPDATA%\Claude\claude_desktop_config.json |
| Cursor | ~/.cursor/mcp.json (global) or .cursor/mcp.json (per-project) |
| Windsurf | ~/.codeium/windsurf/mcp_config.json |
| Cline (VS Code) | Cline panel → MCP Servers → *Configure* (edits cline_mcp_settings.json) |
| Continue | ~/.continue/config.yaml → under a mcpServers: block |
| Kiro | ~/.kiro/settings/mcp.json |
| Claude Code | claude mcp add semhood semhood-mcp |
A few clients use a slightly different shape — e.g. VS Code's native MCP uses a
top-level
"servers"key instead of"mcpServers". If yours differs, keep
ตัดมาแค่ช่วงต้น อ่านต่อใน repo