GitHub
server ทางการของ GitHub ให้ AI อ่านและจัดการโค้ด issue และ pull request ในบัญชีของคุณได้ ใช้ผ่านคลาวด์ของ GitHub หรือรันในเครื่องด้วย Docker ก็ได้
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
Local long-term memory MCP server (SQLite) for AI coding agents — OpenCode, Claude Code, Cursor
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
ต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json
{
"mcpServers": {
"th-memory": {
"command": "npx",
"args": [
"-y",
"th-memory-mcp"
]
}
}
}พิมพ์คำสั่งนี้ใน Terminal
claude mcp add th-memory -- npx -y th-memory-mcpวางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"th-memory": {
"command": "npx",
"args": [
"-y",
"th-memory-mcp"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"th-memory": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"th-memory-mcp"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 8 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub worakorn-prince ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต
ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน
รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น
registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก
รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)
repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (2.4.3) เข้า registry เมื่อวาน
โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Node.js ในเครื่องด้วย
ในหมวดเดียวกันมี GitHub, Desktop Commander, Cloudflare MCP
server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว
อ่านการ์ด:↓ ดาวน์โหลดต่อสัปดาห์i★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi
server ทางการของ GitHub ให้ AI อ่านและจัดการโค้ด issue และ pull request ในบัญชีของคุณได้ ใช้ผ่านคลาวด์ของ GitHub หรือรันในเครื่องด้วย Docker ก็ได้
MCP server for terminal commands, file operations, and process management
ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ
better-sqlite3 native build, import.meta.url). Node.js 20 is EOL and unsupported. CI tests the minimum patched version of each supported line (22/24/26).npm install, npm run build, npm test. No external services, accounts, or API keys — everything lives in a single local SQLite file.node:sqlite on OpenCode Desktop/Node 22.5+ and falls back to bun:sqlite on the Bun-based CLI.MEMORY_DB_PATH with setx, macOS/Linux: export in your shell profile.Security: Use a patched Node.js release — check your runtime with
npx is-my-node-vulnerable.npm auditcovers npm dependencies only, not Node.js core CVEs.
Audit: Independently smoke-tested by AddonAudit on v2.4.1 — an automated test, not a security guarantee; the one high advisory it found was fixed in 2.4.2, and fresh installs from 2.4.3 onward report 0 critical/high advisories.
Fastest path: npm run quickstart (after cloning) builds, wires opencode.json/opencode.jsonc, deploys the plugin, and sets MEMORY_DB_PATH — the steps below are the manual equivalent. npm alternative: npm install -g th-memory-mcp (or npx th-memory-mcp) and point mcp.command to th-memory-mcp instead of dist/index.js (plugin still from this repo; not on GitHub Packages anymore).
# 1. Clone and build
git clone https://github.com/worakorn-prince/th-memory-mcp.git cd th-memory-mcp && npm install && npm run build
setx MEMORY_DB_PATH "$PWD/data/memory.db" # Windows (PowerShell)
~/.config/opencode/opencode.json (replace with the absolute clone path; ready-made block in opencode.example.json). MEMORY_DB_PATH must be the SAME file for server and plugin — a system/user-level env var covers both; environment below covers the server only. Example rules: AGENTS.memory.example.md (attachable at project level).{ "instructions": ["<REPO>/AGENTS.memory.example.md"],
"mcp": { "memory": { "type": "local", "command": ["node", " /dist/index.js"], "enabled": true, "environment": { "MEMORY_DB_PATH": " /data/memory.db" } } } }
src/plugin/learning-capture.ts → ~/.config/opencode/plugins/learning-capture/index.tsThe plugin works in both modes: OpenCode V2 calls the default export's id + setup(ctx) (domain hooks for prompt/tool/compaction/failure events), while V1 (1.18.29+) calls the same default export's server(), which returns the legacy hook object. One file, no runtime import of @opencode/plugin (types only), so it loads under both Node and Bun.
If startup reports Failed to load plugin ... Received protocol 'bun:' or the plugin is silently ignored on V2, you are on an older install layout. Re-deploy the current src/plugin/learning-capture.ts to ~/.config/opencode/plugins/learning-capture/index.ts; a legacy ~/.config/opencode/plugins/learning-capture.ts is renamed to .bak- by npm run quickstart (never deleted). It loads node:sqlite first and only falls back to bun:sqlite under Bun.
OpenCode loads the plugin learning-capture (dual-mode V1/V2, Node/Bun) — auto-captures prompt/tool/error into the DB, injects the profile on compaction — and the MCP server th-memory-mcp (Node stdio) exposing the 16 tools on that same SQLite DB; global rules (memory-protocol.md) teach the AI to use them.
api_key=, password:, token) filtered before storage.better-sqlite3 only (no extra native extensions).lesson records (situation → mistake → correction), not just flat facts.get_context blends FTS5 keyword search with dependency-free lexical fuzzy matching (hashed n-gram similarity, 512-dim FNV-1a) via RRF fusion, then assembles a token-budgeted context with optional memory-graph expansion.derived_from links).A standard MCP server: 16 tools anywhere MCP-over-stdio works; all harnesses share one SQLite file via MEMORY_DB_PATH. Auto-capture needs a hook runtime (built into OpenCode, bridged for Claude Code).
| Feature | OpenCode | Claude Code | Qwen Code | Codex | Cursor |
|---|---|---|---|---|---|
| 16 MCP tools | ✅ | ✅ | ✅ | ✅ | ✅ |
| Auto-capture (background) | ✅ plugin | ✅ hooks | ⚠️ adapter | ❌ manual | ❌ Rules |
| Profile injection | ✅ compaction | ✅ UserPromptSubmit | ❌ get_profile | ❌ get_profile | ❌ get_profile |
| Lexical fuzzy matching | ✅ (v2.0) | ✅ (v2.0) | ✅ (v2.0) | ✅ (v2.0) | ✅ (v2.0) |
UserPromptSubmit/PreCompact, distill on SessionEnd. Qwen Code (QWEN_SETUP.md) — MCP fully; hooks need a small Gemini-CLI adapter. Codex (CODEX_SETUP.md) · Cursor (CURSOR_SETUP.md) — manual tools.| Command | Description |
|---|---|
npm run build | compile TypeScript → dist/ |
npm start | run the MCP server (stdio) from dist/index.js |
npm run distill | interactions → profile sections + prune old data (RETENTION_DAYS, default 30) |
npm test | build + full suite (46 files, 148 tests: 147 pass, 1 skip) |
node test/ .test.mjs | run one suite: capture, distill, lifecycle, temporal, conflict, retrieval, graph, context, consolidation, benchmark, security |
node test/smoke.mjs | end-to-end smoke test over JSON-RPC (16 tools) |
| Tool | Description |
|---|---|
remember | upsert preference (category+key); re-save +0.1 confidence (cap 1.0) |
recall | search preferences + lessons (FTS5) + recent matching interactions — run before a new task |
get_profile | profile sections + top preferences + 5 most recent lessons |
save_lesson | record a lesson from a correction (situation / mistake / correction) |
search_history | search past prompts by keyword (200-char snippets) |
forget | delete one row (preference/lesson/interaction) by id (+type avoids cross-table id clash) |
memory_stats | counts by kind, DB size, oldest/newest interaction, profile sections |
get_recent_interactions | recent raw interactions (filter by kind) — Smart Distill feedstock |
export_memory | export to JSON under data/exports/ only (filename auto-sanitized) |
get_context | task-relevant memories via hybrid retrieval (+ graph expansion), token-budgeted |
consolidate | cluster similar memories via embedding similarity; optionally create derived memories linked via derived_from |
link_memory | typed link between two memories: supports/contradicts/supersedes/derived_from/related_to/caused_by/depends_on |
merge_memory | merge a duplicate into canonical memory (source superseded; provenance in metadata.merged_from) |
update_memory | update fields in place, or create a superseding memory when content changes (supersede=false edits in place) |
import_memory | import from JSON (validates type, dedupes, never overwrites blindly); dry-run by default, apply=true to insert |
extract_memories | scan recent interactions for memory-intent phrases, propose candidates (deterministic, no LLM); dry-run by default, apply=true to create (source=captured) |
th-memory)| Binary | Entry | Purpose |
|---|---|---|
th-memory-mcp | dist/index.js | MCP server (stdio) — the 16 tools above |
th-memory | dist/cli.js | zero-dep local CLI (same DB via MEMORY_DB_PATH) |
Usage: th-memory [--db ] [--json] [--plain] [options] — per-command help via th-memory --help. highlight/recall --highlight: matches underlined (ESC[4m) on a color TTY, else [mem]…[/mem] markers (piped, --plain, --json).
| Flag | Effect |
|---|---|
--db | use this SQLite file (sets MEMORY_DB_PATH) |
--json | print JSON {ok,data} instead of plain text |
--plain / --no-color | disable colors |
-h, --help / -V, --version | show help / print version |
| Command | Usage | |||
|---|---|---|---|---|
remember | remember --category --key --value — save a preference (--value - reads from stdin) | |||
recall | recall [--limit ] [--highlight] — search memory | |||
forget | forget [--type ] — delete by id (t: `memory\ | preference\ | lesson\ | interaction`) |
| export | `export [--include-int
ตัดมาแค่ช่วงต้น อ่านต่อใน repo