Spec Driven Development
MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
Save up to 80% tokens when AI reads code via AST-aware structural reading
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
ต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json
{
"mcpServers": {
"token-pilot": {
"command": "npx",
"args": [
"-y",
"token-pilot"
]
}
}
}พิมพ์คำสั่งนี้ใน Terminal
claude mcp add token-pilot -- npx -y token-pilotวางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"token-pilot": {
"command": "npx",
"args": [
"-y",
"token-pilot"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"token-pilot": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"token-pilot"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 6 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub Digital-Threads ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต
ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน
รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น
registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก
รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)
repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (2.0.0) เข้า registry วันนี้
โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Node.js ในเครื่องด้วย
ในหมวดเดียวกันมี Spec Driven Development, Remote Desktop Commander, Reelsaw
server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว
อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi
MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.
Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.
Drive a self-hosted Reelsaw: turn long videos into vertical clips, edit, re-render and export them.
ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ
Token-efficient AI coding, enforced. Cuts context consumption in AI coding assistants by up to 90% without changing the way you work.
Why it matters more now: as frontier models move up in price, the tokens you *don't* spend reading code are worth more, not less. The savings are in tokens; the value is in tokens × price. Token Pilot keeps the expensive main thread lean so the premium model spends its budget on reasoning, not on re-reading files.
Three layers, each useful on its own, stronger together:
smart_read, read_symbol, read_for_edit, …). Ask for an outline or load one function by name instead of the whole file.Read on large files, recursive Grep, unbounded git diff) and redirect to token-efficient alternatives.tp-* subagents** — Claude Code delegates with MCP-first behaviour and tight response budgets.Traditional: Read("user-service.ts") → 500 lines → ~3000 tokens
Token Pilot: smart_read("user-service.ts") → 15-line outline → ~200 tokens read_symbol("UserService.updateUser") → 45 lines → ~350 tokens After edit: read_diff("user-service.ts") → ~20 tokens
Files under 200 lines are returned in full — zero overhead for small files.
Measured on public open-source repos. Files ≥50 lines only:
| Repo | Files | Raw Tokens | Outline Tokens | Savings |
|---|---|---|---|---|
| token-pilot (TS) | 55 | 102,086 | 8,992 | 91% |
| express (JS) | 6 | 14,421 | 193 | 99% |
| fastify (JS) | 23 | 50,000 | 3,161 | 94% |
| flask (Python) | 20 | 78,236 | 7,418 | 91% |
| Total | 104 | 244,743 | 19,764 | 92% |
smart_readoutline savings only. Real sessions additionally benefit from session cache,read_symbol, andread_for_edit. Reproduce:npx tsx scripts/benchmark.ts.
npx -y token-pilot init
Creates (or merges into) .mcp.json with token-pilot + context-mode, then prompts to install tp-* subagents. Restart your AI assistant to activate.
Grep/Bash/Read calls; redirect to efficient alternatives → hooks & modestp-* subagents** (Claude Code only) — MCP-first delegates with haiku/sonnet model tiers and budget enforcement → agents referencetools/list to save ~2 k tokens per session → profiles & config| Client | MCP tools | PreToolUse hooks | tp-* subagents |
|---|---|---|---|
| Claude Code | ✅ | ✅ | ✅ |
| Codex CLI | ✅ | ✅ | ❌ |
| Cursor | ✅ | ❌ | ❌ |
| Gemini CLI | ✅ | ❌ | ❌ |
| Cline (VS Code) | ✅ | ❌ | ❌ |
| Antigravity | ✅ | ❌ | ❌ |
Hooks are written for Claude Code (the plugin's own hooks/hooks.json, or ~/.claude/settings.json for an npm install) and for Codex CLI (npx token-pilot install-hook --client=codex, then /hooks inside Codex to trust them). The other clients get the MCP tools; their hook systems exist but token-pilot does not write to them yet.
On Claude Code 2.1.275 and later the plugin runs its hooks inside Claude Code as a mod — no process per tool call, a big Read comes back as an outline instead of a refusal, and the session guidance lives in the system prompt. Older versions keep the command hooks → Claude Code mods
Manual config snippets for each client → installation guide
TOKEN_PILOT_MODE controls how aggressively Token Pilot redirects heavy native tool calls:
| Value | Behaviour |
|---|---|
advisory | Allow all — hooks pass through, advisory notes only |
deny *(default)* | Block heavy Grep/Bash patterns; intercept large Read calls |
strict | Deny + auto-cap MCP output (smart_read ≤ 2 000 tokens, find_usages → list mode, smart_log → 20 commits) |
TOKEN_PILOT_MODE=strict npx token-pilot
→ Full hook & mode docs
Token Pilot owns input tokens — the stuff Claude reads from files, git, search. The other half of a session (what Claude *writes* back, how it executes code, how it remembers state across days) is owned by separate tools. They compose cleanly:
| Tool | Owns | Typical savings |
|---|---|---|
| Token Pilot | code reads, git, search | 60-90% input |
| [caveman](https://github.com/JuliusBrussee/caveman) | Claude's response prose (terse-speak skill) | ~75% output |
| [ast-index](https://github.com/defendend/Claude-ast-index-search) | the structural indexer Token Pilot rides on | foundation |
| [context-mode](https://github.com/mksglu/claude-context-mode) | sandboxed shell / python / js execution | 90%+ on big stdout |
A session that pairs token-pilot + caveman typically hits ~85-90% total reduction — each cuts a different half, no overlap. Install what you need; none of them assume the others are present.
→ full ecosystem map
Rules of thumb: read code → smart_read/read_symbol; execute code with big output → context-mode execute; bash-only agent → ast-index CLI. Never copy the whole stack into CLAUDE.md — Token Pilot's doctor warns when CLAUDE.md exceeds 60 lines.
TypeScript, JavaScript, Python, Go, Rust, Java, Kotlin, C#, C/C++, PHP, Ruby. Non-code (JSON/YAML/Markdown/TOML) gets structural summaries. Regex fallback handles most other languages.
Claude Code (plugin — recommended):
# Install on a new machine:
claude plugin marketplace add https://github.com/Digital-Threads/token-pilot claude plugin install token-pilot@token-pilot
claude plugin update token-pilot
Other clients (Cursor, Codex, Cline, …):
# Install on a new machine:
npx -y token-pilot init
npm i -g token-pilot@latest npx token-pilot install-hook npx token-pilot install-agents --scope=user --force
The May 2026 Claude Code update changed a few things that affect how token-pilot is invoked. Nothing breaks on older versions — these are quality-of-life notes for the newer ones.
plugin: prefix.** claude --agent tp-debugger "fix the stack trace" now works the same as --agent token-pilot:tp-debugger. The Task tool dispatcher resolves the short name automatically.find_usages / outline / read_symbol on a large repo triggers an index build. Default per-MCP-tool timeout (60 s) is enough for ~50k-file repos; bigger ones benefit from MCP_TOOL_TIMEOUT=120000 in ~/.claude/settings.json. Subsequent calls hit the cache and return in ~50 ms.claude agents or --bg with --mcp-config /path/to/other.json swaps the MCP set for that session. If token-pilot is not in the override config, MCP tools (smart_read, find_usages, …) are unavailable in that worker even though the hooks (Read / Edit / Bash / Grep / Task) still fire — hooks are project-level, MCP tools are session-level. Add token-pilot to the override config or skip --mcp-config.These fields come from reverse-engineering @anthropic-ai/claude-code@2.1.87 source (see the May 2026 Habr write-up). They work today but are not in the official Claude Code docs, so use at your own risk.
memory: project)Every relevant tp-\* agent (onboard, debugger, pr-reviewer, history-explorer, audit-scanner) now ships with memory: project in its frontmatter. Claude Code persists the agent's working notes in the project so the agent gets faster on repeat invocations — tp-onboard remembers your layout, tp-pr-reviewer remembers your flagged patterns, etc. v0.35.0+.
requiredMcpServers)Every tp-\* agent declares requiredMcpServers: ["token-pilot"]. Claude Code refuses to load the agent when the MCP server isn't configured, so a stale install never produces a "tools not found" loop. v0.35.0+.
once: true)The plugin ships a SessionStart hook flagged once: true — Claude Code runs it once per project then auto-removes the entry. It surfaces friendly hints when install-agents or install-ast-index hasn't been run yet. v0.35.0+.
async: true)PostToolUse hooks (Bash, Task) are marked async: true so they no longer add wall-clock to the hot path — telemetry writes fire in the background.
If you want full auto-approval for safe commands, the YOLO classifier reads natural-language environment descriptions:
{
"autoMode": { "allow": ["Bash(git status)", "Bash(npm test)", "Read", "Grep"], "soft_deny": ["Bash(git push *)", "Bash(rm *)", "Write(.env)"], "environmentDescription": "This is a development laptop. Read-only ops are safe; deny anything touching credentials or production." } }
token-pilot's enforcement still runs on top (raw Read on large files is denied first, regardless of autoMode).
Bash(npm *) # wildcard after "npm "
Bash(git commit *) # specific subcommand Read(*.ts) # extension Read(src/**/*.ts) # recursive + extension Write(src/**) # recursive all files mcptoken-pilot # all token-pilot MCP tools mcptoken-pilot__smart_read # one specific MCP tool
* matches inside word boundaries (shell-glob); ** is recursive. The if field on hooks uses the same syntax.
Set TOKEN_PILOT_HOOK_REWRITE=1 to swap the "deny + suggest" Read hook behaviour for an updatedInput rewrite — Claude Code's undocumented field that silently bounds the Read to its first 200 lines instead of bouncing the call. The structural summary still rides along in additionalContext. Default OFF because the field is undocumented and may change.
Every subagent completion already lands a task-telemetry row via the SubagentStop hook (that's how stats --tasks knows what you dispatched). With TOKEN_PILOT_SUBAGENT_FEEDBACK=1 the same hook also returns additionalContext — when a token-pilot workflow fan-out is at ≥90 % of its token ceiling, each completing agent gets a wind-down note so a hundred-agent /workflow run stops before blowing the budget.
Requires Claude Code 2.1.163+. Returning additionalContext from SubagentStop is only honoured there; older Claude Code labels it a hook error. Default OFF for that reason — enable only once claude --version reports 2.1.163 or later.
These notes are about behaviour you'll see
ตัดมาแค่ช่วงต้น อ่านต่อใน repo