> For the complete documentation index, see [llms.txt](https://getsquish.gitbook.io/squish/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://getsquish.gitbook.io/squish/th/getting-started/quickstart-mcp.md).

# เริ่มต้นเร็ว: MCP

**ให้ AI เข้าถึงวิดีโอแบบสุ่มได้** เซิร์ฟเวอร์ Squish MCP เป็นเซิร์ฟเวอร์ stdio แบบบางที่ใช้เอ็นจินเดียวกับ CLI และเปิดให้ใช้เครื่องมือหนึ่งตัว — **`squish_video`** — ซึ่งแปลงวิดีโอในเครื่องเป็นแผ่นภาพตัวอย่างที่มีเวลาประทับ แล้วเอเจนต์จะอ่านด้วยวิชัน เอ็นจินเดียวกัน เอาต์พุตเหมือน CLI: ทุกอย่างทำงานบนเครื่องที่เอเจนต์รันอยู่; ไม่มีการอัปโหลดเลย และทุกระดับความหนาแน่นใช้ฟรี

## ข้อกำหนด

Node ≥ 20 และ `ffmpeg` + `ffprobe` อยู่ใน PATH (macOS `brew install ffmpeg` · Ubuntu `sudo apt-get install ffmpeg`). ตัวเซิร์ฟเวอร์เองรันตรงจาก npm ผ่าน `npx` — ไม่ต้องติดตั้ง

## ลงทะเบียนเซิร์ฟเวอร์

บล็อกคอนฟิกหนึ่งชุดใช้ลงทะเบียนเซิร์ฟเวอร์กับไคลเอนต์ MCP แบบ stdio ได้ทุกตัว:

```json
{
  "mcpServers": {
    "squish": { "command": "npx", "args": ["-y", "@getsquish/squish", "mcp"] }
  }
}
```

{% tabs %}
{% tab title="Claude Code" %}
คำสั่งเดียว:

```bash
claude mcp add squish -- npx -y @getsquish/squish mcp
```

หรือคอมมิตบล็อกคอนฟิกด้านบนเป็น `.mcp.json` ที่โฟลเดอร์รากของโปรเจกต์ เพื่อแชร์เซิร์ฟเวอร์นี้กับทุกคนที่ทำงานใน repo
{% endtab %}

{% tab title="Claude Desktop" %}
การตั้งค่า → นักพัฒนา → **แก้ไขคอนฟิก** จะเปิด `claude_desktop_config.json`. เพิ่มบล็อกด้านบน บันทึก แล้วรีสตาร์ต Claude Desktop
{% endtab %}

{% tab title="Cursor" %}
เพิ่มบล็อกด้านบนลงใน `.cursor/mcp.json` ในโปรเจกต์ของคุณ (หรือ `~/.cursor/mcp.json` สำหรับทุกโปรเจกต์) — เอเจนต์จะประมวลผลคลิปในเครื่องด้วยตัวเอง
{% endtab %}
{% endtabs %}

ไคลเอนต์ MCP แบบ stdio อื่น ๆ ใช้ได้เหมือนกัน — บล็อกคอนฟิกเหมือนกันทุกประการ

## ตรวจสอบว่าใช้งานได้

ถามเอเจนต์ว่า:

> มีอะไรเกิดขึ้นใน /path/to/clip.mov? ใช้ squish\_video.

เอเจนต์ควรเรียก `squish_video`, รับกลับมาเป็นพาธไฟล์ของชีตพร้อม timecode ของทุกเฟรม อ่านชีตเหล่านั้นด้วยวิชัน แล้วตอบโดยอ้างอิง timecode ที่ประทับไว้ในแต่ละช่อง

## เครื่องมือ

เครื่องมือหนึ่งตัว, **`squish_video`** — `{ video_path, density?, start?, end?, out_dir? }` → สัญญาการเรียกของ CLI **บวกกับ** `timecodes[][]` (หนึ่งอันต่อหนึ่งเฟรม ต่อหนึ่งชีต; `m:ss`, ระดับเสี้ยววินาที `m:ss.d` เมื่อช่วงสั้น), ที่ประทับ `"contract": "squish-mcp-v0"`:

```json
{
  "input": "/abs/path/clip.mov",
  "duration": 20.275,
  "frames": 9,
  "sheets": 1,
  "files": ["/abs/path/out/clip.sheet-1.jpg"],
  "warnings": [],
  "timecodes": [["0:01","0:03","0:05","0:07","0:10","0:12","0:14","0:16","0:19"]],
  "contract": "squish-mcp-v0"
}
```

ข้อผิดพลาดจะแสดงเป็นข้อผิดพลาดของเครื่องมือ MCP ไม่ใช่การแครช ตัว `สัญญา` ฟิลด์นี้เป็นตัวบอกเวอร์ชัน — แยกวิเคราะห์มันเพื่อใช้ตรวจจับการเปลี่ยนแปลงที่ทำให้ใช้งานร่วมกันไม่ได้

## นำทางต่อไป

`start` / `end` รับเป็นวินาทีหรือ timecode ของชีต แล้วจำกัดการทำงานให้อยู่ในช่วง — timecode จะคงเป็นแบบอ้างอิงกับวิดีโอต้นฉบับเสมอ ดังนั้นเอเจนต์จึงเจาะลึกได้ซ้ำ ๆ: ภาพรวม → เลือกช่วงบนชีต → เรียก `squish_video` อีกครั้งโดย `start`/`end` ตั้งค่าเป็น timecode ที่เห็น → ชีตที่หนาแน่นขึ้นของช่วงที่แคบลง ดู [ลูปการนำทาง](/squish/th/the-primitive/the-navigation-loop.md).

## ถัดไป

* [ลูปการนำทาง](/squish/th/the-primitive/the-navigation-loop.md) — ภาพรวม → ซูม → อ้างอิง
* [เอกสารอ้างอิง MCP](/squish/th/reference/mcp.md) — สคีมาเครื่องมือและสัญญาผลลัพธ์ฉบับเต็ม
* [เริ่มใช้งาน CLI](/squish/th/getting-started/quickstart-cli.md) — เอ็นจินเดียวกันจากเชลล์ สำหรับสคริปต์และเอเจนต์ที่ใช้เชลล์ได้


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://getsquish.gitbook.io/squish/th/getting-started/quickstart-mcp.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
