API / MCP
REST API + MCP สำหรับต่อ AI, สคริปต์ และ automation เข้าเซิร์ฟ
ภาพรวม
หน้า API / MCP อยู่ในเมนู ระบบ → API / MCP ของแต่ละเซิร์ฟ (/server-detail/<id>/api) เจ้าของเซิร์ฟสร้าง key ได้สูงสุด 10 key ต่อเซิร์ฟ แต่ละ key คือบัตรผ่านให้โปรแกรมภายนอกเข้ามาทำงานกับเซิร์ฟแทนเรา ตามสิทธิ์ที่เรากำหนดไว้
ต่อ AI agent เข้าเซิร์ฟ
สคริปต์ / bot / automation
External dashboard
คุมสิทธิ์ได้รายตัว
- MCP endpoint
https://api.mcsv.me/api/mcp· JSON-RPC / Streamable HTTP สำหรับ AI app ที่รองรับ MCP- REST API
https://api.mcsv.me/api/v1· HTTP ธรรมดา สำหรับ curl, สคริปต์ และ bot- การยืนยันตัวตน
- ใช้ header
Authorization: Bearer mcsv_...หรือX-API-Keyเหมือนกันทั้ง 2 ช่องทาง · แอปที่ตั้ง header เองไม่ได้ (ChatGPT, Claude บนเว็บ) ใช้ OAuth แทน ดูหัวข้อถัดไป
สร้าง key + กำหนดสิทธิ์
เข้าเมนู API / MCP
กดสร้าง key แล้วตั้งชื่อ
เลือกสิทธิ์
copy token
mcsv_ และแสดงครั้งเดียวตอนสร้างเท่านั้น copy เก็บไว้ให้ดีก่อนปิดหน้าต่างสิทธิ์แก้ย้อนหลังได้ตลอดจากปุ่ม "สิทธิ์" ของ key แต่ละตัว มีผลทันทีโดยไม่ต้องแจก token ใหม่ · ถ้าแก้สิทธิ์แล้ว AI ยังยืนยันว่าทำไม่ได้ นั่นเป็นเพราะฝั่งแอปจำคำตอบเก่าไว้ ให้พิมพ์บอกให้ลองเรียกใหม่อีกครั้ง หรือ reload การเชื่อมต่อ MCP ในแอปนั้น
ต่อ AI ผ่าน MCP
MCP (Model Context Protocol) คือโปรโตคอลที่เปิดให้ AI app เรียก tools ของเซิร์ฟเราได้โดยตรง ต่อครั้งเดียว AI จะเห็นรายชื่อ tool ตามสิทธิ์ของ key แล้วเลือกใช้เองว่างานไหนต้องเรียกอะไร เอา token ที่ copy มาแทนที่ <TOKEN> ในตัวอย่างข้างล่างได้เลย
Cursor · สร้างไฟล์ .cursor/mcp.json ในโปรเจกต์:
{
"mcpServers": {
"mcsv-myserver": {
"type": "http",
"url": "https://api.mcsv.me/api/mcp",
"headers": { "Authorization": "Bearer <TOKEN>" }
}
}
}Claude Code · สั่งผ่าน CLI บรรทัดเดียว:
claude mcp add --scope project --transport http mcsv-myserver \
https://api.mcsv.me/api/mcp \
--header "Authorization: Bearer <TOKEN>"VSCode Copilot · สร้างไฟล์ .vscode/mcp.json:
{
"servers": {
"mcsv-myserver": {
"type": "http",
"url": "https://api.mcsv.me/api/mcp",
"headers": { "Authorization": "Bearer <TOKEN>" }
}
}
}Windsurf · แก้ไฟล์ ~/.codeium/windsurf/mcp_config.json โดยใช้ field serverUrl แทน url:
{
"mcpServers": {
"mcsv-myserver": {
"serverUrl": "https://api.mcsv.me/api/mcp",
"headers": { "Authorization": "Bearer <TOKEN>" }
}
}
}app อื่น ๆ ที่รองรับ Streamable HTTP MCP ก็ใช้ค่าเดียวกันหมด: URL https://api.mcsv.me/api/mcp· header Authorization: Bearer <TOKEN> · transport แบบ HTTP
ต่อเองแบบ raw JSON-RPC · ถ้าเขียน client เอง (n8n, สคริปต์, MCP client ที่ตั้งค่าเองทั้งหมด) endpoint รับ 3 method หลัก: initialize, tools/list, tools/call(รองรับ ping ด้วย) · ตัวอย่างเรียก tool ตรง ๆ:
curl -X POST https://api.mcsv.me/api/mcp \
-H "Authorization: Bearer <TOKEN>" -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
"params":{"name":"server_overview","arguments":{}}}'เกิน rate limit จะได้ error code -32029 พร้อม data.retry_after_seconds
ต่อสำเร็จแล้วลองสั่ง AI ว่า "ดูสถานะเซิร์ฟหน่อย" (จะเรียก server_overview) หรือ "อ่าน log ล่าสุด" ถ้าตอบกลับมาพร้อมข้อมูลจริงของเซิร์ฟ แปลว่าใช้งานได้แล้ว
ต่อ ChatGPT / Claude ด้วย OAuth
ChatGPT กับ Claude บนเว็บไม่มีช่องให้กรอก header เอง จึงใช้ key แบบ mcsv_ ไม่ได้ ทั้งคู่ใช้วิธีมาตรฐานชื่อ OAuth แทน คือเด้งมาที่หน้าเว็บของเราให้เจ้าของเซิร์ฟกดอนุญาตเอง แล้วแอปจะได้ token ของตัวเองไปใช้ ไม่มีการก๊อปรหัสอะไรไปวาง
เปิดหน้าเพิ่ม connector ในแอป
วาง URL ของ MCP
https://api.mcsv.me/api/mcp ในช่อง Server URL แบบเป๊ะ ๆ ห้ามมี / ปิดท้ายเลือกวิธียืนยันตัวตนเป็น OAuth
กดอนุญาตบนหน้าของเรา
mcsv.me/oauth/authorize ให้เข้าสู่ระบบ เลือกเซิร์ฟที่จะให้เข้าถึง เลือกสิทธิ์ (เต็ม / อ่านอย่างเดียว / กำหนดเอง) แล้วกดอนุญาต จากนั้นแอปจะเชื่อมต่อได้เลยการเชื่อมต่อ OAuth ไม่นับรวมโควตา 10 key ต่อเซิร์ฟ · หน้าอนุญาตมีสวิตช์ ปลดล็อกทั้งหมด ให้เลือกเปิดได้ถ้าไว้ใจแอปนั้นจริง ๆ (ค่าเริ่มต้นปิดไว้) เปิดแล้วแอปสั่งคำสั่งเสี่ยงและแตะไฟล์รหัสลับได้ แต่ไฟล์ระบบสำคัญ (server.jar, start.sh, eula.txt) ยังถูกบล็อกไว้เสมอ · เปลี่ยนทีหลังได้ที่การ์ด แอปที่เชื่อมต่อ มีผลทันทีกับการเรียกครั้งถัดไป · ถ้าเปิดแล้ว AI ในแอปยังบอกว่าทำไม่ได้ ให้พิมพ์บอกให้ลองใหม่ หรือ reload การเชื่อมต่อ MCP ในแอปนั้น
ติดตั้ง Skill ให้ AI
เรามีไฟล์ skill สรุปวิธีใช้ API / MCP ทั้งระบบ (endpoint, สิทธิ์, rate limit, ข้อห้าม, รายชื่อ tool ครบ 59 ตัว) ให้ AI อ่านครั้งเดียวแล้วเรียกใช้ถูกทันที ไม่ต้องลองผิดลองถูก
วิธีเร็วสุด (แนะนำ) · คำสั่งเดียว เลือก AI ให้อัตโนมัติ รองรับ Claude Code, Cursor, Codex, Windsurf และอีก 20+ ตัว:
npx skills add https://mcsv.meหรือติดตั้งเองตาม app ที่ใช้:
Claude Code · วางในเทอร์มินัล ติดตั้งระดับเครื่อง ใช้ได้ทุกโปรเจกต์:
mkdir -p ~/.claude/skills/mcsv && \
curl -fsSL https://mcsv.me/skills/mcsv/SKILL.md -o ~/.claude/skills/mcsv/SKILL.mdCursor · รันในโฟลเดอร์โปรเจกต์ จะได้ rule .cursor/rules/mcsv.mdc:
mkdir -p .cursor/rules && \
curl -fsSL https://mcsv.me/skills/mcsv/mcsv.mdc -o .cursor/rules/mcsv.mdcAI อื่น ๆ · Codex, Windsurf, Cline ฯลฯ ต่อท้าย AGENTS.md ในโปรเจกต์ หรือ copy เนื้อหาใส่ system prompt:
curl -fsSL https://mcsv.me/skills/mcsv/SKILL.md >> AGENTS.mdMCSV_API_KEY ให้ AI) เปิดดูเนื้อหาไฟล์ได้ที่ mcsv.me/skills/mcsv/SKILL.mdใช้ REST API
ถ้าไม่ได้ต่อ AI แต่อยากยิงเองจากสคริปต์หรือ bot ใช้ REST API ได้เลย base URL คือhttps://api.mcsv.me/api/v1 ทุก endpoint ใช้ header เดียวกับ MCP
ดูภาพรวม API · GET /api/v1ตอบ endpoint ทั้งหมด กติกา path ของ file tools และลิงก์คู่มือ (ไม่ต้องใช้ token)
เช็คว่า key ใช้ได้ + ดูสิทธิ์ · GET /api/v1/me:
curl -H "Authorization: Bearer <TOKEN>" https://api.mcsv.me/api/v1/meตอบกลับพร้อมข้อมูลเซิร์ฟ (id, ชื่อ, เกม, เวอร์ชัน, สถานะ), ข้อมูล key (permission_mode, allowed_tool_count, total_tools, guard_bypass) และ rate limit ปัจจุบัน
ดูรายชื่อ tool ทั้งหมด · GET /api/v1/toolsตอบกลับพร้อม input schema ของแต่ละตัว และ field allowed บอกว่า key นี้เรียกตัวไหนได้บ้าง
เรียก tool ใดก็ได้ · POST /api/v1/tools/{name}โดย body คือ arguments ของ tool นั้น เช่นอ่านไฟล์:
curl -X POST https://api.mcsv.me/api/v1/tools/files_read \
-H "Authorization: Bearer <TOKEN>" -H "Content-Type: application/json" \
-d '{"path":"/server.properties"}'Endpoint ลัด · งานที่ใช้บ่อยมี alias สั้น ๆ ให้:
- GET /api/v1/server · สถานะ + สเปคของเซิร์ฟ
- POST /api/v1/power · สั่งเปิด/ปิด body
{"action":"restart"} - POST /api/v1/command · ส่งคำสั่งคอนโซล body
{"command":"say hi"} - GET /api/v1/logs?lines=200 · อ่าน log ล่าสุดตามจำนวนบรรทัด
รูปแบบ response:
- สำเร็จ ·
{"ok":true,"result":{...}} - พลาด ·
{"ok":false,"error":"..."}พร้อม HTTP status: 400 tool ทำงานไม่สำเร็จ (arguments ผิด, path ไม่มีจริง, คำสั่งถูกบล็อค) · ข้อความ error บอกวิธีแก้และบางกรณีแนบรายชื่อไฟล์จริงมาให้ · 401 key ผิดหรือถูก revoke · 403 key ไม่มีสิทธิ์ tool นั้น · 404 ไม่รู้จัก tool · 409 เซิร์ฟกำลังติดตั้งอยู่ · 429 เกิน rate limit
error ไม่ได้มีแค่ข้อความ · เวลาพลาดเรื่อง path หรือของที่หาไม่เจอ response จะแนบ field ช่วยแก้มาให้ด้วย ใช้เขียนสคริปต์ให้ retry เองได้เลย:
- listed_directory + entries · รายชื่อไฟล์จริงในโฟลเดอร์แม่ของ path ที่หาไม่เจอ
- next_steps · ขั้นตอนที่ควรทำต่อ เช่น ชื่อไฟล์ที่ใกล้เคียงกับที่ส่งมา
- retryable · true = ปัญหาชั่วคราว ยิงซ้ำได้ · false = ต้องแก้ request ก่อน
- tip / file / query · เฉพาะ tool กลุ่ม log · บอกวิธีค้นต่อพร้อม echo คำขอเดิมกลับมา
files_fetch_url)POST /api/v1/tools/backups_create · สคริปต์แจ้งเตือนตอนดิสก์ใกล้เต็มกติกา path ของ file tools (อ่านก่อนให้ AI แตะไฟล์)
เกือบทุกปัญหาที่ AI ทำงานกับไฟล์แล้วพลาด มาจากเข้าใจ path ผิด กติกามีแค่ไม่กี่ข้อ และ API จะช่วยแก้ให้เองเวลาพลาด
- path เริ่มจาก root ของเซิร์ฟ ·
/คือโฟลเดอร์บนสุดของเซิร์ฟ เช่น/server.properties,/plugins/Essentials/config.yml· ถ้าใส่/home/container/...มา ระบบตัดให้อัตโนมัติ (path เดียวกัน) - ตัวพิมพ์เล็กใหญ่ต้องตรงเป๊ะ ·
/plugins/geyser-spigotกับ/plugins/Geyser-Spigotคนละอันกัน ไม่รู้ชื่อจริงให้files_listดูก่อน อย่าเดา - พิมพ์ผิดแล้วระบบช่วยเดาให้ · หาไฟล์ไม่เจอ API จะส่งรายชื่อไฟล์จริงในโฟลเดอร์นั้นกลับไปพร้อมชื่อที่ใกล้เคียง AI แก้ path ได้ในรอบเดียวโดยไม่ต้องลองสุ่ม
- แก้ไฟล์เดิมใช้ files_edit ไม่ใช่ files_write ·
files_editแก้เฉพาะจุดโดยยึดข้อความเดิม (old_stringต้องคัดลอกจากfiles_readตรงตัวและห้ามซ้ำในไฟล์) ส่วนอื่นของไฟล์ไม่ถูกแตะ ประหยัดกว่าและเนื้อหาหายไม่ได้ · แก้server.propertiesใช้server_properties_patchง่ายกว่า - files_write ทับทั้งไฟล์ · เหมาะกับสร้างไฟล์ใหม่หรือเขียนใหม่ทั้งไฟล์จริง ๆ เท่านั้น ถ้าจะใช้กับไฟล์เดิมต้อง
files_readก่อน แล้วส่งเนื้อหาฉบับเต็มที่แก้แล้วกลับไป - เขียน/ลบพลาด ย้อนกลับได้ · ทุกครั้งที่
files_write/files_edit/files_deleteทำงาน ระบบสำรองไฟล์เดิมไว้ให้อัตโนมัติ (เก็บ 30 วัน) ดูจุดสำรองด้วยfiles_undo_listแล้วย้อนด้วยfiles_undo· ข้อยกเว้น: โฟลเดอร์และไฟล์ binary ที่ลบไปแล้วกู้ไม่ได้ - เขียนไฟล์ใหม่ผิดที่ = ระบบเตือนก่อน · ถ้าโฟลเดอร์ปลายทางไม่มีจริง หรือมีไฟล์ชื่อคล้ายกันอยู่แล้ว (ต่างแค่ตัวพิมพ์) จะถูกปฏิเสธพร้อมบอกชื่อจริง ยืนยันสร้างใหม่จริง ๆ ด้วย
force_new: true - รูปแบบ argument ต่างกันตาม tool · อ่าน/เขียนไฟล์เดี่ยวใช้
path· ลบ/บีบอัด/เปลี่ยนชื่อใช้root+ ชื่อไฟล์ในfiles/renames· copy ใช้location· ดู schema จริงที่GET /api/v1/toolsเสมอ
console_tail (เห็นเฉพาะ log ปัจจุบัน) · ใช้กลุ่ม Log ย้อนหลังแทน:logs_list ดูไฟล์ทั้งหมด · logs_read อ่านได้ทั้ง .log.gz ที่หมุนไปแล้วและ crash report · logs_search ค้นคำ/regex ข้ามไฟล์ · logs_startup สรุปว่าปลั๊กอินตัวไหนโหลดผ่าน/ไม่ผ่านตอนบูตล่าสุด (มีไฟล์ .jar อยู่ ไม่ได้แปลว่าโหลดสำเร็จ · plugins_list ส่ง with_state: true ก็เช็คได้)site_pages_list,site_page_read, site_page_edit, site_page_write, site_page_delete,site_set_enabled) แก้หน้าเว็บสาธารณะที่ <ซับโดเมน>.mcsv.me ได้จากภายนอกเลย · path พวกนี้เป็นคนละชุดกับไฟล์ในเซิร์ฟ (/, /rules, /style.css) วิธีเขียนหน้าดูที่ เว็บไซต์เซิร์ฟ· แก้หน้าเดิมให้ใช้ site_page_edit (แก้เฉพาะจุดด้วย old_string/new_stringส่วนอื่นของหน้าไม่ถูกแตะ) ส่วน site_page_write ไว้สร้างหน้าใหม่หรือรื้อทั้งหน้าfiles_read_many (สูงสุด 25 ไฟล์/ครั้ง) ประหยัด rate limit กว่ายิงทีละไฟล์มาก · ไฟล์ binary เช่น .jar ใช้ files_read_base64 / files_upload_base64 (สูงสุด ~14MB) หรือให้เซิร์ฟโหลดเองจาก URL ด้วย files_fetch_url (ถึง 64MB)Tool reference (ครบทุกตัว · 61 tools · 15 กลุ่ม)
กดที่ชื่อ tool เพื่อดู arguments ที่ต้องส่ง พร้อมตัวอย่าง request / response จริง · argument ที่มี * คือจำเป็นต้องส่ง · ตัวที่ติดป้าย read-only คือ tool ที่อ่านข้อมูลอย่างเดียว ไม่แก้อะไรบนเซิร์ฟ (ชุดสิทธิ์ "อ่านอย่างเดียว" เปิด 27 ตัวนี้ให้อัตโนมัติ)
POST /api/v1/tools/{name}) · ฝั่ง MCP ใช้ tool ชื่อเดียวกัน arguments ชุดเดียวกัน AI จะอ่าน schema เองอัตโนมัติ · response ฝั่ง REST ห่อใน {"ok":true,"result":…}ส่วน MCP ได้ result ตรง ๆserver_overviewread-onlyสรุปสถานะ + สเปค + runtime
สรุปสถานะ server แบบรวดเดียว: server_info + runtime resources (state/cpu/mem/disk) ใน call เดียว — ใช้แทนการเรียก server_info + server_resources แยกกัน
ไม่ต้องส่ง arguments (body ว่างได้)
curl -X POST https://api.mcsv.me/api/v1/tools/server_overview \
-H "Authorization: Bearer <TOKEN>"{
"ok": true,
"result": {
"info": {
"id": "a1b2c3d4-0000-4000-8000-1234567890ab",
"name": "My Survival",
"game": "minecraft-bedrock",
"game_version": "latest",
"server_type": "bedrock",
"java_version": null,
"status": "active",
"port": 15188,
"ports": [
15188,
20471,
27805,
39445,
47832
],
"pelican_identifier": "ab12cd34",
"plan_id": "plan-uuid",
"billing_cycle": "monthly",
"expires_at": "2026-07-31T13:56:28.098043Z",
"auto_renew": true,
"custom_subdomain": "my-server",
"node_id": "node-uuid",
"created_at": "2026-04-10T21:45:25.918436Z"
},
"runtime": {
"current_state": "running",
"is_suspended": false,
"resources": {
"memory_bytes": 620482560,
"cpu_absolute": 1.956,
"disk_bytes": 1058903046,
"network_rx_bytes": 1151507,
"network_tx_bytes": 2140374,
"uptime": 165518451
}
}
}
}server_inforead-onlyข้อมูลเซิร์ฟ (ชื่อ/เวอร์ชัน/แพลน)
ข้อมูล server: name, game, version, type, port, plan, status, expires_at, RAM/CPU/Disk specs
ไม่ต้องส่ง arguments (body ว่างได้)
curl -X POST https://api.mcsv.me/api/v1/tools/server_info \
-H "Authorization: Bearer <TOKEN>"{
"ok": true,
"result": {
"id": "a1b2c3d4-0000-4000-8000-1234567890ab",
"name": "My Survival",
"game": "minecraft-bedrock",
"game_version": "latest",
"server_type": "bedrock",
"java_version": null,
"status": "active",
"port": 15188,
"ports": [
15188,
20471,
27805,
39445,
47832
],
"pelican_identifier": "ab12cd34",
"plan_id": "plan-uuid",
"billing_cycle": "monthly",
"expires_at": "2026-07-31T13:56:28.098043Z",
"auto_renew": true,
"custom_subdomain": "my-server",
"node_id": "node-uuid",
"created_at": "2026-04-10T21:45:25.918436Z"
}
}server_resourcesread-onlyCPU/RAM/Disk แบบ realtime
Pelican runtime stats: current_state, CPU/RAM/Disk usage, uptime
ไม่ต้องส่ง arguments (body ว่างได้)
curl -X POST https://api.mcsv.me/api/v1/tools/server_resources \
-H "Authorization: Bearer <TOKEN>"{
"ok": true,
"result": {
"current_state": "running",
"is_suspended": false,
"resources": {
"memory_bytes": 620482560,
"cpu_absolute": 1.956,
"disk_bytes": 1058903046,
"network_rx_bytes": 1151507,
"network_tx_bytes": 2140374,
"uptime": 165518451
}
}
}activity_log_recentread-onlyประวัติกิจกรรมล่าสุด
ลิสต์ activity log ล่าสุดของ server (power/file/backup events)
| argument | type | คำอธิบาย |
|---|---|---|
limit | integer | - |
curl -X POST https://api.mcsv.me/api/v1/tools/activity_log_recent \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"limit":20}'{
"ok": true,
"result": {
"logs": [
{
"id": "4eaac9fb-b8dd-4fac-bd96-c7cc20d5e532",
"action": "mcp.server_resources",
"actor_type": "user",
"actor_id": "user-uuid",
"metadata": {
"via": "mcp",
"server_id": "a1b2c3d4-0000-4000-8000-1234567890ab",
"server_name": "My Survival"
},
"created_at": "2026-07-12T16:17:46.344592Z"
},
{
"id": "0c5f1280-2d8e-4786-95ff-470f13b22ec6",
"action": "mcp.server_info",
"actor_type": "user",
"actor_id": "user-uuid",
"metadata": {
"via": "mcp",
"server_id": "a1b2c3d4-0000-4000-8000-1234567890ab",
"server_name": "My Survival"
},
"created_at": "2026-07-12T16:17:46.296204Z"
}
],
"count": 3
}
}players_onlineread-onlyผู้เล่นออนไลน์ตอนนี้
ใครออนไลน์อยู่ **ตอนนี้** — ถาม server สดรอบเดียว คืน online_count, max_players, players (รายชื่อ) · เหมาะกับ "ตอนนี้มีกี่คน ใครอยู่บ้าง" (ย้อนหลังใช้ players_sessions) · **เช็ค `names_available` เสมอ**: false = ได้จำนวนแต่รายชื่อไม่ครบ/ว่าง (Bedrock ไม่ส่งชื่อมากับ ping · Java ที่คนเกิน SLP sample ~12 และปิด enable-query) แล้วอ่าน `note` ว่าทำไม — ห้ามตีความว่า players ว่าง = ไม่มีคน ให้ดู online_count · `names_source`: slp | query | tracker | rcon | none
ไม่ต้องส่ง arguments (body ว่างได้)
curl -X POST https://api.mcsv.me/api/v1/tools/players_online \
-H "Authorization: Bearer <TOKEN>"{
"ok": true,
"result": {
"platform": "java",
"server_online": true,
"online_count": 3,
"max_players": 20,
"players": [
"steve",
"alex",
"notch"
],
"names_available": true,
"names_source": "slp",
"checked_at": "2026-08-26T09:14:02Z"
}
}players_sessionsread-onlyไทม์ไลน์เข้าออกผู้เล่น
ไทม์ไลน์เข้าออกของผู้เล่นย้อนหลัง (join/leave sessions) · แต่ละ session มี name, joined_at, left_at (null = ยังออนไลน์อยู่), reason · เหมาะกับถาม "ใครเข้าออกตอนไหน เล่นไปนานเท่าไร" · ข้อมูล best-effort จาก console tracker
| argument | type | คำอธิบาย |
|---|---|---|
hours | integer | ช่วงเวลาย้อนหลังเป็นชั่วโมง (1-168) |
curl -X POST https://api.mcsv.me/api/v1/tools/players_sessions \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"hours":24}'{
"ok": true,
"result": {
"hours": 24,
"now": "2026-07-20T16:40:00Z",
"sessions": [
{
"name": "Steve",
"joined_at": "2026-07-20T15:02:11Z",
"left_at": null,
"reason": null
},
{
"name": "Alex",
"joined_at": "2026-07-20T13:10:45Z",
"left_at": "2026-07-20T14:55:02Z",
"reason": "quit"
}
],
"count": 2
}
}domain_inforead-onlyข้อมูลโดเมน/IP/พอร์ต
ดูข้อมูล domain ของ server (custom_subdomain, primary port, node hostname, dedicated IP)
ไม่ต้องส่ง arguments (body ว่างได้)
curl -X POST https://api.mcsv.me/api/v1/tools/domain_info \
-H "Authorization: Bearer <TOKEN>"{
"ok": true,
"result": {
"custom_subdomain": "my-server",
"full_domain": "my-server.mcsv.me",
"node_hostname": "sv6.mcsv.me",
"primary_port": 15188,
"all_ports": [
15188,
20471,
27805,
39445,
47832
],
"dedicated_ip": null,
"connect_address": "my-server.mcsv.me"
}
}files_listread-onlyดูรายชื่อไฟล์
List files+folders ใน directory · path เริ่มจาก root ของ server volume = `/` (ไม่ใช่ /home/container) · คืน name, size, is_file, mime, modified_at (สูงสุด 500 รายการ เกินนั้น truncated:true) · ชื่อจากผลลัพธ์นี้คือ ground truth — ใช้ก่อนอ้าง path อื่นเสมอ ห้ามเดาชื่อไฟล์/โฟลเดอร์ (case-sensitive)
| argument | type | คำอธิบาย |
|---|---|---|
directory | string | path จาก server root เช่น `/`, `/plugins`, `/config` (ไม่ใส่ = `/`) |
curl -X POST https://api.mcsv.me/api/v1/tools/files_list \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"directory":"/"}'{
"ok": true,
"result": {
"directory": "/",
"files": [
{
"name": "behavior_packs",
"size": 4096,
"is_file": false,
"is_symlink": false,
"mime": "inode/directory",
"mode": "775",
"modified_at": "2026-07-10T21:57:12+07:00"
},
{
"name": "config",
"size": 4096,
"is_file": false,
"is_symlink": false,
"mime": "inode/directory",
"mode": "775",
"modified_at": "2026-06-25T02:30:24+07:00"
},
{
"name": "data",
"size": 4096,
"is_file": false,
"is_symlink": false,
"mime": "inode/directory",
"mode": "775",
"modified_at": "2026-07-10T21:57:12+07:00"
},
{
"name": "definitions",
"size": 4096,
"is_file": false,
"is_symlink": false,
"mime": "inode/directory",
"mode": "775",
"modified_at": "2026-06-25T02:30:23+07:00"
}
],
"total": 25,
"shown": 25,
"truncated": false
}
}files_readread-onlyอ่านไฟล์ text
อ่านไฟล์ text (max 200k chars ถ้าเกินจะ truncate) · path เต็มจาก server root, case-sensitive เช่น `/server.properties`, `/plugins/Essentials/config.yml` · ถ้าไม่พบ จะแนบ listing ของโฟลเดอร์แม่ + ชื่อใกล้เคียงกลับมาให้แก้ path ได้เลย · ไฟล์ binary (.jar/.png/.dat) ใช้ files_read_base64
| argument | type | คำอธิบาย |
|---|---|---|
path* | string | path เต็มจาก root เช่น `/server.properties` |
curl -X POST https://api.mcsv.me/api/v1/tools/files_read \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"path":"/server.properties"}'{
"ok": true,
"result": {
"path": "server.properties",
"content": "server-name=Dedicated Server\ngamemode=survival\nforce-gamemode=false\ndifficulty=easy\nallow-cheats=false\nmax-players=10\nonline-mode=true\nallow-list=false\nserver-port=15188\nserver-portv6=19133\ntransport=raknet\nenable-lan-vi…",
"bytes": 1181,
"truncated": false
}
}files_read_manyread-onlyอ่านหลายไฟล์รวดเดียว
อ่านหลายไฟล์ในครั้งเดียว (สูงสุด 25 ไฟล์, รวม ~400k chars) — ใช้แทนการเรียก files_read ทีละไฟล์ เพื่อลด round-trip/rate-limit. คืน array ของ {path, content, bytes, truncated} หรือ {path, error}
| argument | type | คำอธิบาย |
|---|---|---|
paths* | array | paths เต็มจาก server root (case-sensitive) เช่น ["/server.properties", "/spigot.yml", "/config/paper-global.yml"] |
curl -X POST https://api.mcsv.me/api/v1/tools/files_read_many \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"paths":["/server.properties","/spigot.yml"]}'{
"ok": true,
"result": {
"files": [
{
"path": "server.properties",
"content": "server-name=Dedicated Server\ngamemode=survival\nforce-gamemode=false\ndifficulty=easy\nallow-cheats=false\nmax-players=10\non…",
"bytes": 1181,
"truncated": false
},
{
"path": "permissions.json",
"content": "[]\n",
"bytes": 3,
"truncated": false
}
],
"count": 2,
"ok": 2
}
}files_read_base64read-onlyดาวน์โหลดไฟล์ binary (base64)
ดาวน์โหลดไฟล์ (binary) จาก server เป็น base64 · ใช้กับไฟล์ที่ไม่ใช่ text (เช่น .jar, .png, world files) · cap 16MB raw — ใหญ่กว่านี้ใช้ files_download_url แทน
| argument | type | คำอธิบาย |
|---|---|---|
path* | string | - |
curl -X POST https://api.mcsv.me/api/v1/tools/files_read_base64 \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"path":"/server-icon.png"}'{
"ok": true,
"result": {
"success": true,
"path": "permissions.json",
"bytes": 3,
"content_base64": "W10K"
}
}files_download_urlขอลิงก์ดาวน์โหลดไฟล์
ขอ signed URL สำหรับดาวน์โหลดไฟล์ตรงจาก node (TTL สั้น ใช้ครั้งเดียว) · หมายเหตุ: จัดเป็น tool กลุ่ม files_read แต่**ไม่นับเป็น read-only** — key แบบอ่านอย่างเดียวเรียกไม่ได้ (ดาวน์โหลด = พาไฟล์ออกนอกระบบ) · เหมาะกับไฟล์ใหญ่เกิน cap ของ files_read_base64 (16MB) · file = path เต็มจาก root
| argument | type | คำอธิบาย |
|---|---|---|
file* | string | path เต็มจาก root เช่น `/backups/world.zip` |
curl -X POST https://api.mcsv.me/api/v1/tools/files_download_url \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"file":"/world/level.dat"}'{
"ok": true,
"result": {
"url": "https://sv6.mcsv.me:8443/download/file?token=eyJ…"
}
}files_undo_listread-onlyดูจุดสำรองไฟล์
ดูจุดสำรองที่ย้อนกลับได้ (ไฟล์ที่ระบบสำรองไว้ก่อน API/MCP เขียนหรือลบ) — ใส่ path เพื่อกรองเฉพาะไฟล์นั้น
| argument | type | คำอธิบาย |
|---|---|---|
path | string | กรองเฉพาะ path นี้ (ไม่ใส่ = ทุกไฟล์ล่าสุด) |
curl -X POST https://api.mcsv.me/api/v1/tools/files_undo_list \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"path":"/plugins/Skript/scripts/shop.sk"}'{
"ok": true,
"result": {
"snapshots": [
{
"id": "6f1c…",
"path": "/plugins/Skript/scripts/shop.sk",
"bytes": 15347,
"tool": "files_edit",
"undoable": true,
"created_at": "2026-07-29T09:12:03Z"
}
],
"count": 1
}
}files_writeเขียน/สร้างไฟล์
เขียนทับ**ทั้งไฟล์** (ไม่ใช่ append/patch) · **แก้ไฟล์เดิมให้ใช้ files_edit แทน** (ส่งเฉพาะจุดที่แก้ ส่วนอื่นหายไม่ได้) — ตัวนี้เหมาะกับสร้างไฟล์ใหม่/เขียนใหม่ทั้งไฟล์จริง ๆ · ถ้าจะใช้กับไฟล์เดิม ต้อง files_read ก่อนเสมอ แล้วส่ง content ฉบับเต็มที่แก้แล้ว · สร้างไฟล์ใหม่: ถ้าโฟลเดอร์แม่ยังไม่มี หรือมีไฟล์ชื่อคล้าย (ต่าง case) อยู่แล้ว จะถูกปฏิเสธพร้อมคำแนะนำ — ยืนยันสร้างจริงด้วย force_new:true · content เป็น UTF-8 text เท่านั้น (binary ใช้ files_upload_base64) · แก้ server.properties ใช้ server_properties_patch สะดวกกว่า
| argument | type | คำอธิบาย |
|---|---|---|
path* | string | path เต็มจาก root, case-sensitive เช่น `/config/paper-global.yml` |
content* | string | เนื้อหาไฟล์ทั้งไฟล์ (จะทับของเดิมทั้งหมด) |
force_new | boolean | ยืนยันสร้างไฟล์ใหม่ใน path ที่โฟลเดอร์แม่ยังไม่มี/ชื่อคล้ายของเดิม (สร้าง parent dirs ให้อัตโนมัติ) |
curl -X POST https://api.mcsv.me/api/v1/tools/files_write \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"path":"/config/motd.txt","content":"Welcome to my server!"}'{
"ok": true,
"result": {
"success": true,
"path": "/config/motd.txt",
"bytes": 42
}
}files_editแก้ไฟล์เฉพาะจุด
แก้ไฟล์**เฉพาะจุด**ด้วยการยึดข้อความเดิม (anchor) — ส่วนอื่นของไฟล์ไม่ถูกแตะ · **ใช้ตัวนี้เป็นค่าเริ่มต้นเมื่อแก้ไฟล์ที่มีอยู่แล้ว** แทน files_write เพราะไม่ต้องส่งไฟล์ทั้งไฟล์กลับมา (ถูกกว่า เร็วกว่า และเนื้อหาส่วนที่ไม่ได้แก้หายไม่ได้) · old_string ต้องคัดลอกจาก files_read ตรงตัว (ตรงทั้งช่องว่าง/ย่อหน้า/ตัวพิมพ์) และต้องไม่ซ้ำในไฟล์ ไม่งั้นถูกปฏิเสธพร้อมบอกบรรทัดใกล้เคียง · ทุก edit ต้องผ่านหมดถึงจะเขียน · ไฟล์ก่อนแก้ถูกสำรองไว้ ย้อนกลับได้ด้วย files_undo
| argument | type | คำอธิบาย |
|---|---|---|
path* | string | path เต็มจาก root, case-sensitive เช่น `/plugins/Skript/scripts/shop.sk` |
edits* | array | รายการแก้ไข ทำตามลำดับ (สูงสุด 20) |
curl -X POST https://api.mcsv.me/api/v1/tools/files_edit \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"path":"/plugins/Skript/scripts/shop.sk","edits":[{"old_string":"options:\n webhook: none","new_string":"options:\n webhook: https://discord.com/api/webhooks/…"}]}'{
"ok": true,
"result": {
"success": true,
"path": "/plugins/Skript/scripts/shop.sk",
"edits_applied": 1,
"bytes_before": 15347,
"bytes_after": 15402,
"snapshot_id": "6f1c…",
"undo_hint": "ย้อนกลับได้ด้วย files_undo path=\"/plugins/Skript/scripts/shop.sk\""
}
}files_undoย้อนไฟล์กลับ
ย้อนไฟล์กลับเป็นก่อนการเขียนครั้งล่าสุดผ่าน API/MCP (ระบบสำรองไฟล์ก่อนเขียน/ก่อนลบให้อัตโนมัติ เก็บ 30 วัน ไฟล์ละ 10 เวอร์ชัน) · ใช้เมื่อเขียนพลาด/เนื้อหาหาย ไม่ต้องกู้ backup ทั้งเซิร์ฟ · ไม่ระบุ snapshot_id = จุดล่าสุดของ path นั้น
| argument | type | คำอธิบาย |
|---|---|---|
path | string | path ของไฟล์ที่จะย้อนกลับ |
snapshot_id | string | id ของจุดสำรองเจาะจง (จาก files_undo_list) |
curl -X POST https://api.mcsv.me/api/v1/tools/files_undo \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"path":"/plugins/Skript/scripts/shop.sk"}'{
"ok": true,
"result": {
"success": true,
"path": "/plugins/Skript/scripts/shop.sk",
"action": "restored",
"restored_from": "2026-07-29T09:12:03Z"
}
}files_deleteลบไฟล์/โฟลเดอร์
ลบไฟล์/โฟลเดอร์ · files = ชื่อ relative จาก root เช่น root=`/plugins` files=["OldPlugin.jar"] (หรือ root=`/` + path เต็มใน files ก็ได้) · ไฟล์ text ถูกสำรองก่อนลบอัตโนมัติ (10 ไฟล์แรก) กู้คืนได้ด้วย files_undo ภายใน 30 วัน · โฟลเดอร์และไฟล์ binary ลบถาวร (ดูรายชื่อใน no_undo_for ของผลลัพธ์)
| argument | type | คำอธิบาย |
|---|---|---|
root | string | โฟลเดอร์ฐาน เช่น `/plugins` |
files* | array | ชื่อไฟล์/โฟลเดอร์ relative จาก root |
curl -X POST https://api.mcsv.me/api/v1/tools/files_delete \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"root":"/","files":["old-world.zip"]}'{
"ok": true,
"result": {
"success": true,
"deleted": 1,
"root": "/"
}
}files_mkdirสร้างโฟลเดอร์
สร้างโฟลเดอร์ใหม่ · name = ชื่อโฟลเดอร์เดี่ยว (ห้ามมี `/`) สร้างซ้อนหลายชั้นให้เรียกหลายครั้ง หรือใช้ files_write ที่สร้าง parent ให้อัตโนมัติ
| argument | type | คำอธิบาย |
|---|---|---|
root | string | โฟลเดอร์แม่ เช่น `/plugins` |
name* | string | ชื่อโฟลเดอร์ใหม่ (ชื่อเดี่ยว ไม่ใช่ path) |
curl -X POST https://api.mcsv.me/api/v1/tools/files_mkdir \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"root":"/","name":"backups"}'{
"ok": true,
"result": {
"success": true,
"root": "/",
"name": "backups"
}
}files_renameย้าย/เปลี่ยนชื่อไฟล์
เปลี่ยนชื่อ/ย้ายไฟล์หรือโฟลเดอร์ (หลายรายการต่อครั้งได้) · from/to เป็น path relative จาก root · ย้ายข้ามโฟลเดอร์ได้ เช่น from=`old.jar` to=`backup/old.jar`
| argument | type | คำอธิบาย |
|---|---|---|
root | string | - |
renames* | array | - |
curl -X POST https://api.mcsv.me/api/v1/tools/files_rename \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"root":"/","renames":[{"from":"world-old","to":"world"}]}'{
"ok": true,
"result": {
"success": true,
"count": 1,
"root": "/"
}
}files_copyคัดลอกไฟล์
Copy **ไฟล์เดี่ยว** (โฟลเดอร์ copy ไม่ได้ — ใช้ files_compress + files_decompress แทน) · location = path เต็มของไฟล์ต้นทางจาก root · สำเนาชื่อ `<stem> copy[ N].<ext>` ในโฟลเดอร์เดียวกัน — ผลลัพธ์คืน `copied_to` เป็น path จริงของสำเนา (เปลี่ยนชื่อ/ย้ายต่อด้วย files_rename)
| argument | type | คำอธิบาย |
|---|---|---|
location* | string | path เต็มของไฟล์ต้นทาง |
curl -X POST https://api.mcsv.me/api/v1/tools/files_copy \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"location":"/server.properties"}'{
"ok": true,
"result": {
"success": true,
"location": "/server.properties",
"copied_to": "/server copy.properties",
"note": "สำเนาอยู่โฟลเดอร์เดียวกับต้นฉบับ ชื่อ `<ชื่อเดิม> copy[ N]` · ย้าย/เปลี่ยนชื่อต่อด้วย files_rename"
}
}files_compressบีบอัดเป็น .zip
บีบอัดไฟล์/โฟลเดอร์เป็น .zip เขียนลงเซิร์ฟเวอร์ · files = ชื่อ relative จาก root · ตั้งชื่อ zip ผ่าน name ได้ ไม่งั้น auto จากชื่อ root+timestamp
| argument | type | คำอธิบาย |
|---|---|---|
root | string | - |
files* | array | ชื่อไฟล์/โฟลเดอร์ relative จาก root |
name | string | ชื่อไฟล์ .zip ปลายทาง (optional) |
curl -X POST https://api.mcsv.me/api/v1/tools/files_compress \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"root":"/","files":["world"]}'{
"ok": true,
"result": {
"success": true,
"path": "/world-20260729-101500.zip"
}
}files_decompressแตกไฟล์ archive
แตก archive (tar/tar.gz/zip) · file = ชื่อ archive relative จาก root · แตกลงในโฟลเดอร์ root นั้น
| argument | type | คำอธิบาย |
|---|---|---|
root | string | โฟลเดอร์ที่ archive อยู่ + ปลายทางที่จะแตก |
file* | string | ชื่อ archive relative จาก root เช่น `world-backup.zip` |
curl -X POST https://api.mcsv.me/api/v1/tools/files_decompress \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"root":"/","file":"world-backup.zip"}'{
"ok": true,
"result": {
"success": true,
"root": "/",
"file": "world-backup.zip"
}
}files_upload_base64อัพโหลดไฟล์ binary (base64)
อัพโหลดไฟล์ (binary) ไปยัง server · content เป็น base64 (เหมาะกับ .jar, .zip, รูป, schema) · **cap ~14MB ดิบ** (ข้อจำกัด request body 20MB) — ใหญ่กว่านี้ใช้ files_fetch_url (ได้ถึง 64MB) · สร้าง parent dirs อัตโนมัติ · text ธรรมดาใช้ files_write
| argument | type | คำอธิบาย |
|---|---|---|
path* | string | path ปลายทางเต็มจาก root เช่น `/plugins/WorldEdit.jar` |
content_base64* | string | เนื้อไฟล์เข้ารหัส base64 (มาตรฐาน RFC 4648) |
curl -X POST https://api.mcsv.me/api/v1/tools/files_upload_base64 \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"path":"/plugins/MyPlugin.jar","content_base64":"UEsDBBQAAAAI…"}'{
"ok": true,
"result": {
"success": true,
"path": "/plugins/MyPlugin.jar",
"bytes": 245760
}
}files_fetch_urlดึงไฟล์จาก URL เข้าเซิร์ฟ
ดาวน์โหลดไฟล์จาก URL ภายนอก (plugin/mod/world จาก GitHub release, Modrinth, Spigot, jsDelivr ฯลฯ) เข้า server · MCSV API ดึงไฟล์ผ่าน server-side แล้วเขียนลง Wings · เฉพาะ http/https · บล็อก private IP · cap 64MB
| argument | type | คำอธิบาย |
|---|---|---|
url* | string | http/https URL · เช่น https://github.com/.../release.jar |
directory | string | ปลายทาง (default `/`) เช่น `/plugins/` |
filename | string | ชื่อไฟล์ปลายทาง (optional) ถ้าไม่ระบุใช้ชื่อจาก URL |
curl -X POST https://api.mcsv.me/api/v1/tools/files_fetch_url \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"url":"https://cdn.modrinth.com/data/…/EssentialsX-2.20.1.jar","directory":"/plugins/"}'{
"ok": true,
"result": {
"success": true,
"url": "https://cdn.modrinth.com/…/EssentialsX-2.20.1.jar",
"path": "/plugins/EssentialsX-2.20.1.jar",
"size": 1048576
}
}console_tailread-onlyอ่าน log ล่าสุด
อ่าน N บรรทัดล่าสุดของ log ล่าสุดใน /logs (ปกติ latest.log · ถ้าไม่มีจะเลือกไฟล์ .log ที่ใหม่สุด) · ผลลัพธ์ตัดที่ ~100k ตัวอักษร (truncated:true) · log ใหญ่มากจะอ่าน 256KB ท้ายไฟล์ผ่าน node ให้แทน · คืน `content` เป็นข้อความรวม ไม่ใช่ array · เห็นเฉพาะ log ปัจจุบัน — log เก่าที่หมุนแล้ว (.log.gz) ใช้ logs_list/logs_read/logs_search/logs_startup
| argument | type | คำอธิบาย |
|---|---|---|
lines | integer | - |
curl -X POST https://api.mcsv.me/api/v1/tools/console_tail \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"lines":100}'{
"ok": true,
"result": {
"file": "/logs/latest.log",
"lines_requested": 100,
"lines_returned": 2,
"content": "[12:00:01] Server started.\n[12:00:05] Player Steve joined the game",
"truncated": false
}
}console_sendส่งคำสั่ง console
ส่งคำสั่งเข้า server console (เช่น `say hello`, `tps`, `whitelist add Steve`) · ไม่ต้องมี `/` นำหน้า · คำสั่งที่ถูก block ผ่าน API (Security Guard): ปิด/รีสตาร์ทเซิร์ฟ (stop/end/restart/shutdown → ใช้ power_action), reload (reload/rl/plugman), สิทธิ์ผู้เล่น (op/deop/lp/luckperms/pex/GroupManager), แบน (ban/ban-ip/tempban/pardon/unban), whitelist off/reload, save-off — รวมถึงตอนซ่อนไว้ใน execute … run / sudo / newline / prefix แบบ bukkit:stop · คำสั่งที่โดนบล็อกต้องให้เจ้าของเซิร์ฟรันเองที่หน้า Console
| argument | type | คำอธิบาย |
|---|---|---|
command* | string | คำสั่ง console ไม่ต้องมี `/` นำหน้า |
curl -X POST https://api.mcsv.me/api/v1/tools/console_send \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"command":"say Server restarting in 5 minutes!"}'{
"ok": true,
"result": {
"success": true,
"command": "say Server restarting in 5 minutes!"
}
}logs_listread-onlyลิสต์ไฟล์ log ทั้งหมด
ลิสต์ไฟล์ log ทั้งหมดใน /logs + /crash-reports (รวม .log.gz ที่หมุนแล้ว) เรียงใหม่→เก่า · ใช้ก่อน logs_read/logs_search เพื่อรู้ว่ามีไฟล์อะไรช่วงเวลาไหน
ไม่ต้องส่ง arguments (body ว่างได้)
curl -X POST https://api.mcsv.me/api/v1/tools/logs_list \
-H "Authorization: Bearer <TOKEN>"{
"ok": true,
"result": {
"files": [
{
"file": "logs/latest.log",
"size": 40465,
"modified_at": "2026-08-02T00:40:00+07:00",
"compressed": false
},
{
"file": "logs/2026-08-01-3.log.gz",
"size": 93243,
"modified_at": "2026-08-02T00:00:00+07:00",
"compressed": true
}
],
"count": 2,
"note": "เรียงใหม่→เก่า · .log.gz อ่านผ่าน logs_read ได้เลย (ระบบแตกไฟล์ให้อัตโนมัติ) · หา boot ล่าสุดใช้ logs_startup"
}
}logs_readread-onlyอ่านไฟล์ log/gz/crash report
อ่านไฟล์ log ที่ระบุ — รองรับ .log.gz (แตกให้ฝั่งเซิร์ฟเวอร์ อ่านย้อนหลังได้ทั้งไฟล์) และ crash report (.txt) · filter = กรองเฉพาะบรรทัดที่มีคำนี้ (case-insensitive, แนบเลขบรรทัด) · from=head ใช้อ่านช่วง startup ต้นไฟล์ · log สดใช้ console_tail
| argument | type | คำอธิบาย |
|---|---|---|
file* | string | ชื่อไฟล์จาก logs_list เช่น `latest.log`, `logs/2026-08-01-3.log.gz`, `crash-reports/crash-....txt` |
lines | integer | - |
from | string | - |
filter | string | กรองบรรทัดที่มีคำนี้ (ไม่บังคับ) |
curl -X POST https://api.mcsv.me/api/v1/tools/logs_read \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"file":"logs/2026-08-01-3.log.gz","filter":"ERROR","lines":50}'{
"ok": true,
"result": {
"file": "logs/2026-08-01-3.log.gz",
"mode": "gz",
"total_lines": 1721,
"lines_returned": 1,
"matched_lines": 1,
"content": "624: [21:12:09] [Server thread/ERROR]: ItemsAdder) [Pack] ERROR: please remove the resource-pack setting from server.properties file.",
"truncated": false
}
}logs_searchread-onlyค้นคำข้ามไฟล์ log
ค้นคำ/regex ข้ามหลายไฟล์ log (ใหม่→เก่า รวม .log.gz + crash-reports) คืนบรรทัดที่เจอพร้อมชื่อไฟล์+เลขบรรทัด · ใช้ตามหา error/เหตุการณ์ที่ไม่อยู่ใน latest.log แล้ว เช่น 'ทำไม plugin X หยุดทำงาน' 'ใครโดน ban เมื่อไหร่'
| argument | type | คำอธิบาย |
|---|---|---|
query* | string | คำค้น (case-insensitive) |
regex | boolean | - |
max_files | integer | - |
max_matches | integer | - |
context | integer | แนบ N บรรทัดถัดจากบรรทัดที่เจอ (ดู stack trace) |
curl -X POST https://api.mcsv.me/api/v1/tools/logs_search \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"query":"plugin is disabled","max_files":3}'{
"ok": true,
"result": {
"query": "plugin is disabled",
"matches": [
{
"file": "logs/latest.log",
"line": 375,
"content": "375: org.bukkit.command.CommandException: Cannot execute command 'ia' in plugin ItemsAdder v4.0.17 - plugin is disabled."
}
],
"match_count": 1,
"files_scanned": [
{
"file": "logs/latest.log",
"matches": 1,
"partial": false
}
],
"files_total": 12,
"truncated": false,
"next_steps": "เจอบรรทัดที่สนใจ → อ่าน context เต็มด้วย logs_read (ระบุ file + filter)"
}
}logs_startupread-onlyวิเคราะห์ boot + สถานะ plugin
หา boot ล่าสุด (ไล่ย้อน rotated logs ให้เอง) แล้วสรุปแบบ structured: plugin ไหน enable สำเร็จ / โดน disable ระหว่างบูต / enable ไม่ผ่าน พร้อม error ที่เกี่ยว + ERROR ทั้งหมดช่วง startup · ใช้เป็น tool แรกเมื่อ 'plugin ไม่โหลด/หายไป/ใช้คำสั่งไม่ได้' หรือเซิร์ฟเปิดแล้วพฤติกรรมแปลก — ไฟล์ jar อยู่ในโฟลเดอร์ ≠ plugin ทำงานอยู่
ไม่ต้องส่ง arguments (body ว่างได้)
curl -X POST https://api.mcsv.me/api/v1/tools/logs_startup \
-H "Authorization: Bearer <TOKEN>"{
"ok": true,
"result": {
"boot_file": "logs/2026-08-01-3.log.gz",
"boot_line": 595,
"boot_completed": true,
"partial_scan": false,
"report": {
"plugins_seen": 52,
"enabled": [
{
"name": "GSit",
"version": "3.5.1"
}
],
"disabled_during_boot": [
{
"name": "ItemsAdder",
"version": "4.0.17",
"reason": "enable แล้วโดน disable ระหว่างบูต (ดู error_lines)",
"error_lines": [
"[21:12:09] [Server thread/ERROR]: ItemsAdder) [Pack] ERROR: please remove the resource-pack setting from server.properties file."
]
}
],
"failed": [],
"could_not_load": [],
"errors": [
"..."
],
"warnings_count": 14
},
"next_steps": "ดู log ดิบช่วง startup: logs_read(file=\"logs/2026-08-01-3.log.gz\", from=\"head\")"
}
}power_actionstart / stop / restart / kill
Start/stop/restart/kill server
| argument | type | คำอธิบาย |
|---|---|---|
action* | string | - |
curl -X POST https://api.mcsv.me/api/v1/tools/power_action \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"action":"restart"}'{
"ok": true,
"result": {
"success": true,
"action": "restart"
}
}backups_listread-onlyดูรายการ backup
ลิสต์ backup ของ server (ซ่อน admin hidden backups)
ไม่ต้องส่ง arguments (body ว่างได้)
curl -X POST https://api.mcsv.me/api/v1/tools/backups_list \
-H "Authorization: Bearer <TOKEN>"{
"ok": true,
"result": {
"backups": [
{
"uuid": "b497a1c0-1bee-4340-bec6-35361174cdfa",
"name": "post-transfer-20260612-073309",
"bytes": 233886104,
"created_at": "2026-06-12T07:33:09+00:00",
"completed_at": "2026-06-12T07:33:09+00:00",
"is_successful": true,
"is_locked": false
}
],
"count": 10
}
}backups_createสร้าง backup
สร้าง backup ใหม่ (full server tar.gz). name เป็น optional label
| argument | type | คำอธิบาย |
|---|---|---|
name | string | - |
curl -X POST https://api.mcsv.me/api/v1/tools/backups_create \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"name":"before-update"}'{
"ok": true,
"result": {
"success": true,
"uuid": "0b9f7a3c-5e21-4d6a-9c7f-2f8e4a1b6d90",
"name": "before-update"
}
}backups_restoreกู้คืน backup
Restore backup. truncate=true จะลบไฟล์ปัจจุบันก่อน restore (เสี่ยง)
| argument | type | คำอธิบาย |
|---|---|---|
uuid* | string | - |
truncate | boolean | - |
curl -X POST https://api.mcsv.me/api/v1/tools/backups_restore \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"uuid":"0b9f7a3c-5e21-4d6a-9c7f-2f8e4a1b6d90","truncate":false}'{
"ok": true,
"result": {
"success": true,
"uuid": "0b9f7a3c-5e21-4d6a-9c7f-2f8e4a1b6d90"
}
}backups_deleteลบ backup
ลบ backup ตาม uuid
| argument | type | คำอธิบาย |
|---|---|---|
uuid* | string | - |
curl -X POST https://api.mcsv.me/api/v1/tools/backups_delete \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"uuid":"0b9f7a3c-5e21-4d6a-9c7f-2f8e4a1b6d90"}'{
"ok": true,
"result": {
"success": true,
"uuid": "0b9f7a3c-5e21-4d6a-9c7f-2f8e4a1b6d90"
}
}server_renameเปลี่ยนชื่อเซิร์ฟ
เปลี่ยนชื่อ server ใน DB (ไม่ใช่ MOTD)
| argument | type | คำอธิบาย |
|---|---|---|
name* | string | - |
curl -X POST https://api.mcsv.me/api/v1/tools/server_rename \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"name":"My Survival"}'{
"ok": true,
"result": {
"success": true,
"name": "My Survival"
}
}eula_acceptยอมรับ EULA
เขียน eula.txt = true (จำเป็นก่อน start Java MC ครั้งแรก)
ไม่ต้องส่ง arguments (body ว่างได้)
curl -X POST https://api.mcsv.me/api/v1/tools/eula_accept \
-H "Authorization: Bearer <TOKEN>"{
"ok": true,
"result": {
"success": true
}
}server_properties_patchแก้ server.properties
Patch key=value ใน server.properties (preserve order, ไม่ทำลาย comment)
| argument | type | คำอธิบาย |
|---|---|---|
updates* | object | { "motd": "hi", "max-players": "100" } |
curl -X POST https://api.mcsv.me/api/v1/tools/server_properties_patch \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"updates":{"motd":"Welcome to MCSV","max-players":"50"}}'{
"ok": true,
"result": {
"success": true,
"updated": 2,
"keys": [
"motd",
"max-players"
],
"hint": "restart server เพื่อให้ค่าใหม่มีผล"
}
}plugins_listread-onlyดูรายชื่อปลั๊กอิน/mod
ลิสต์ .jar/.zip ในโฟลเดอร์หลักตามชนิดเซิร์ฟ: /mods สำหรับ forge/fabric/neoforge/quilt · /plugins สำหรับที่เหลือ · เซิร์ฟ hybrid (mohist/arclight/magma) มีทั้งสองโฟลเดอร์ — ตัวนี้คืนแค่ /plugins ให้ files_list("/mods") ดูอีกฝั่งเอง · with_state:true = เทียบกับ boot ล่าสุดว่าแต่ละตัว enable จริงมั้ย (ช้ากว่าเพราะต้องอ่าน log — มีไฟล์ ≠ โหลดสำเร็จ)
| argument | type | คำอธิบาย |
|---|---|---|
with_state | boolean | แนบสถานะจาก startup log (enabled/disabled_during_boot/failed) |
curl -X POST https://api.mcsv.me/api/v1/tools/plugins_list \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"with_state":true}'{
"ok": true,
"result": {
"directory": "/plugins",
"plugins": [
{
"name": "EssentialsX-2.20.1.jar",
"size": 1048576,
"modified_at": "2026-07-29T19:54:00+07:00",
"state": "enabled"
},
{
"name": "ItemsAdder_4.0.17.jar",
"size": 4163916,
"modified_at": "2026-07-29T19:54:00+07:00",
"state": "disabled_during_boot"
}
],
"count": 2,
"state_source": {
"boot_file": "logs/2026-08-01-3.log.gz",
"note": "state จาก boot ล่าสุด · รายละเอียด error ใช้ logs_startup"
}
}
}security_scanread-onlyสแกนมัลแวร์ใน jar
สแกนมัลแวร์ด้วย engine เดียวกับ sweep รายชั่วโมงและ alert บนหน้าเว็บ — ครอบคลุม .jar ใน /plugins /mods (jar infector ตระกูล ServerLibs/LibAPI, SpigotRCE, ProjectX, xmrig miner), payload ที่ถูกวางใน /libraries, ร่องรอย dropper ในไฟล์ .yml, ELF ที่ซ่อนในโฟลเดอร์จุด และ heuristic class fanout · คืน verdict (INFECTED/SUSPICIOUS/CLEAN/UNKNOWN) + รายการไฟล์ที่ติด + `open_findings` (alert ที่ยังไม่ถูกแก้ รวมหลักฐาน C2 ฝั่งเครือข่ายที่ไม่มีไฟล์ให้สแกน) · ⚠️ verdict UNKNOWN = สแกนไม่สำเร็จ ห้ามตีความว่าสะอาด · ยังตรวจแบบ signature เป็นหลัก ไม่ใช่การรับประกันว่าสะอาด 100%
ไม่ต้องส่ง arguments (body ว่างได้)
curl -X POST https://api.mcsv.me/api/v1/tools/security_scan \
-H "Authorization: Bearer <TOKEN>"{
"ok": true,
"result": {
"verdict": "INFECTED",
"engine": "scan-server-volume",
"infected_count": 2,
"infected": [
{
"file": "libraries/org/bstats/bstats.jar",
"family": "โค้ดที่ปลอมตัวเป็นระบบเก็บสถิติ bStats (มัลแวร์ตระกูล SpigotRCE)",
"category": "jar_infector",
"severity": "critical",
"confidence": 99,
"markers": [
"jar_infector:spigotrce",
"spigotrce:dropped_payload"
],
"sha256": "9f2c…"
},
{
"file": "plugins/BetterRTP/lang/en.yml",
"family": "ร่องรอยของตัวติดตั้งมัลแวร์ที่ค้างในไฟล์ config/lang (jar ตัวจริงอาจถูกลบไปแล้ว)",
"category": "dropper_artifact",
"severity": "high",
"confidence": 90,
"markers": [
"dropper_residue:fake_modrinth_slug",
"modrinth.com/plugin/thebetterrtp"
],
"sha256": null
}
],
"suspicious_count": 0,
"suspicious": [],
"open_findings_count": 2,
"open_findings": [],
"advice": "มัลแวร์ตระกูล SpigotRCE … ต้อง stop เซิร์ฟก่อน แล้วลบให้ครบทั้ง 3 ที่",
"disclaimer": "ตรวจด้วย engine เดียวกับ sweep รายชั่วโมงและ alert บนหน้าเว็บ (scan-server-volume) … ยังเป็นการตรวจแบบ signature เป็นหลัก = ไม่ใช่การรับประกันว่าสะอาด 100%"
}
}search_modsread-onlyค้นหา plugin/mod (Modrinth)
ค้น plugin/mod จาก Modrinth + Hangar (PaperMC) · ผล Modrinth 3 อันดับแรกแนบ `download_url` (direct .jar ที่ตรง loader/game_version ที่กรอง) — ส่งต่อให้ files_fetch_url ติดตั้งได้ทันที ไม่ต้องเดา URL · ควรกรองด้วย loader (paper/fabric/forge/...) + game_version เสมอเพื่อได้ไฟล์ที่เข้ากันได้
| argument | type | คำอธิบาย |
|---|---|---|
query* | string | ชื่อ/คำค้น plugin หรือ mod |
loader | string | ตัวกรอง loader: paper, spigot, fabric, forge, neoforge, bukkit, velocity, ... (optional) |
game_version | string | ตัวกรองเวอร์ชัน Minecraft เช่น `1.21.1` (optional) |
curl -X POST https://api.mcsv.me/api/v1/tools/search_mods \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"query":"essentials","loader":"paper","game_version":"1.21.1"}'{
"ok": true,
"result": {
"query": "sodium",
"modrinth": [],
"hangar": [
{
"source": "hangar",
"title": "GoogleGeminiAIGod",
"slug": "GoogleGeminiAIGod",
"description": "Toil at the whim of your ai master! Take photos, build monuments, burn to death, and other fun stuff",
"downloads": 22,
"url": "https://hangar.papermc.io/ConnorBP/GoogleGeminiAIGod"
}
],
"hint": "ดาวน์โหลด .jar ไปติดตั้งด้วย files_fetch_url (เปิดหน้า project หา URL ดาวน์โหลดของเวอร์ชันที่ตรง loader/เวอร์ชันเกม)"
}
}databases_listread-onlyดูรายการ database
ลิสต์ MySQL/MariaDB databases ของ server (โชว์ user/password/host/port/connection string)
ไม่ต้องส่ง arguments (body ว่างได้)
curl -X POST https://api.mcsv.me/api/v1/tools/databases_list \
-H "Authorization: Bearer <TOKEN>"{
"ok": true,
"result": {
"databases": [
{
"id": 148,
"name": "s2053_test",
"username": "u2053_Ab12Cd34",
"host": "db6.mcsv.me",
"port": 3306,
"password": "p4ssw0rd_Example123",
"connection_string": "mysql://u2053_Ab12Cd34:[email protected]:3306/s2053_test"
}
],
"count": 1
}
}databases_createสร้าง database
สร้าง MySQL/MariaDB database ใหม่ · name a-z/0-9/_ · 1-48 chars · จะคืน connection string + password
| argument | type | คำอธิบาย |
|---|---|---|
name* | string | - |
curl -X POST https://api.mcsv.me/api/v1/tools/databases_create \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"name":"shop"}'{
"ok": true,
"result": {
"success": true,
"id": 152,
"name": "s2053_shop",
"username": "u2053_Ab12Cd34",
"host": "db6.mcsv.me",
"port": 3306,
"password": "p4ssw0rd_Example123",
"connection_string": "mysql://u2053_Ab12Cd34:[email protected]:3306/s2053_shop"
}
}databases_deleteลบ database
ลบ database ตาม id (จาก databases_list)
| argument | type | คำอธิบาย |
|---|---|---|
database_id* | string | - |
curl -X POST https://api.mcsv.me/api/v1/tools/databases_delete \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"database_id":"152"}'{
"ok": true,
"result": {
"success": true,
"database_id": "152"
}
}schedules_listread-onlyดูตารางเวลา
ลิสต์ cron schedules ของ server (auto restart, periodic commands, etc.)
ไม่ต้องส่ง arguments (body ว่างได้)
curl -X POST https://api.mcsv.me/api/v1/tools/schedules_list \
-H "Authorization: Bearer <TOKEN>"{
"ok": true,
"result": {
"schedules": [
{
"id": "b34e970b-8c9e-40ac-a18a-4d1aaa392d74",
"name": "Auto restart ทุกวัน ตอนตี 4",
"action_type": "power",
"action_data": {
"signal": "restart"
},
"cron_expression": "*/1 * * * *",
"timezone": "Asia/Bangkok",
"is_active": false,
"last_run_at": "2026-05-10T04:16:00.001516Z",
"next_run_at": null
}
],
"count": 1
}
}schedules_createสร้าง schedule
สร้าง schedule ใหม่ · action_type=`command` (action_data.command=string) | `power` (action_data.signal=start/stop/restart/kill) · cron_expression=5-field cron · timezone default `Asia/Bangkok`
| argument | type | คำอธิบาย |
|---|---|---|
name* | string | - |
action_type* | string | - |
action_data* | object | - |
cron_expression* | string | เช่น `0 6 * * *` (every 6am) |
timezone | string | - |
is_active | boolean | - |
curl -X POST https://api.mcsv.me/api/v1/tools/schedules_create \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"name":"restart ทุกเช้า","action_type":"power","action_data":{"signal":"restart"},"cron_expression":"0 6 * * *","timezone":"Asia/Bangkok"}'{
"ok": true,
"result": {
"success": true,
"schedule_id": "f3d2c1b0-1111-4222-8333-444455556666",
"name": "restart ทุกเช้า",
"cron_expression": "0 6 * * *",
"next_run_at": "2026-07-13T06:00:00+07:00"
}
}schedules_deleteลบ schedule
ลบ schedule ตาม id
| argument | type | คำอธิบาย |
|---|---|---|
schedule_id* | string | - |
curl -X POST https://api.mcsv.me/api/v1/tools/schedules_delete \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"schedule_id":"f3d2c1b0-1111-4222-8333-444455556666"}'{
"ok": true,
"result": {
"success": true,
"schedule_id": "f3d2c1b0-1111-4222-8333-444455556666"
}
}schedules_toggleเปิด/ปิด schedule
เปิด/ปิด schedule · `is_active`=true เปิด · false ปิด (ไม่รัน cron แต่ยังเก็บ config)
| argument | type | คำอธิบาย |
|---|---|---|
schedule_id* | string | - |
is_active* | boolean | - |
curl -X POST https://api.mcsv.me/api/v1/tools/schedules_toggle \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"schedule_id":"f3d2c1b0-1111-4222-8333-444455556666","is_active":false}'{
"ok": true,
"result": {
"success": true,
"schedule_id": "f3d2c1b0-1111-4222-8333-444455556666",
"is_active": false,
"next_run_at": null
}
}webhooks_listread-onlyดูรายการ webhook
ลิสต์ Discord/JSON webhooks ของ server (events ที่ subscribe ไว้)
ไม่ต้องส่ง arguments (body ว่างได้)
curl -X POST https://api.mcsv.me/api/v1/tools/webhooks_list \
-H "Authorization: Bearer <TOKEN>"{
"ok": true,
"result": {
"webhooks": [
{
"id": "c029c4a1-2e5c-4121-812c-be6a036ed47a",
"name": "TEST",
"url_masked": "https://discord.com/api/webhooks/14•••••",
"format": "discord",
"events": {
"server.kill": true,
"file.deleted": true,
"member.added": true,
"…": true
},
"is_active": false,
"created_at": "2026-05-25T09:11:48.738080Z"
}
],
"count": 1
}
}webhooks_createสร้าง webhook
สร้าง webhook (สูงสุด 5 ตัว/เซิร์ฟ · URL ต้อง https และเป็น host สาธารณะ) · format=`discord` (Discord webhook URL) | `json` (generic POST) · events=object map { "server.started": true, ... } · valid events: server.started/stopped/restart/kill/crashed, backup.created/restored, plugin.installed/uninstalled, file.uploaded/deleted/modified, member.added/removed, database.created/deleted, server.renewed/expiring
| argument | type | คำอธิบาย |
|---|---|---|
name* | string | - |
url* | string | ต้องขึ้นต้น https:// |
format | string | - |
events* | object | - |
embed_style | object | - |
curl -X POST https://api.mcsv.me/api/v1/tools/webhooks_create \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"name":"Discord แจ้งเตือน","url":"https://discord.com/api/webhooks/…","format":"discord","events":{"server.started":true,"server.stopped":true,"backup.created":true}}'{
"ok": true,
"result": {
"success": true,
"webhook_id": "c029c4a1-2e5c-4121-812c-be6a036ed47a",
"name": "Discord แจ้งเตือน"
}
}webhooks_deleteลบ webhook
ลบ webhook ตาม id
| argument | type | คำอธิบาย |
|---|---|---|
webhook_id* | string | - |
curl -X POST https://api.mcsv.me/api/v1/tools/webhooks_delete \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"webhook_id":"c029c4a1-2e5c-4121-812c-be6a036ed47a"}'{
"ok": true,
"result": {
"success": true,
"webhook_id": "c029c4a1-2e5c-4121-812c-be6a036ed47a"
}
}webhooks_testทดสอบยิง webhook
ส่ง test event ไปยัง webhook (ดูว่า URL+format ใช้งานได้)
| argument | type | คำอธิบาย |
|---|---|---|
webhook_id* | string | - |
curl -X POST https://api.mcsv.me/api/v1/tools/webhooks_test \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"webhook_id":"c029c4a1-2e5c-4121-812c-be6a036ed47a"}'{
"ok": true,
"result": {
"success": true,
"webhook_id": "c029c4a1-2e5c-4121-812c-be6a036ed47a",
"message": "test sent"
}
}members_listread-onlyดูรายชื่อทีม
ลิสต์ team members ของ server · แต่ละรายการมี `id` (= member_id ที่ members_remove ต้องใช้ — ไม่ใช่ user_id/email), user_id, email, permissions
ไม่ต้องส่ง arguments (body ว่างได้)
curl -X POST https://api.mcsv.me/api/v1/tools/members_list \
-H "Authorization: Bearer <TOKEN>"{
"ok": true,
"result": {
"members": [
{
"id": "c3d4e5f6-0000-4000-8000-fedcbafedcba",
"user_id": "b2c3d4e5-0000-4000-8000-abcdefabcdef",
"email": "[email protected]",
"display_name": "Friend",
"permissions": {
"power": true,
"use_ai": true,
"files_read": true,
"files_write": true,
"console_read": true,
"console_write": true,
"settings_edit": true,
"settings_view": true,
"databases_read": true,
"manage_members": false,
"players_manage": true,
"plugins_manage": true,
"databases_admin": true,
"databases_write": true
},
"created_at": "2026-04-17T23:46:48.550468Z"
}
],
"count": 1
}
}members_removeลบสมาชิกทีม
ลบสมาชิกออกจาก server (revoke access)
| argument | type | คำอธิบาย |
|---|---|---|
member_id* | string | - |
curl -X POST https://api.mcsv.me/api/v1/tools/members_remove \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"member_id":"c3d4e5f6-0000-4000-8000-fedcbafedcba"}'{
"ok": true,
"result": {
"success": true,
"member_id": "c3d4e5f6-0000-4000-8000-fedcbafedcba"
}
}site_pages_listread-onlyดูรายการหน้าเว็บ
ลิสต์หน้า/ไฟล์ทั้งหมดของเว็บเซิร์ฟ (https://<subdomain>.mcsv.me) พร้อมสถานะเว็บเปิด/ปิด · แต่ละรายการมี path, kind (html|tsx), published, use_tailwind, compile_error, ขนาด · ใช้ตัวนี้ก่อนเสมอเพื่อรู้ว่ามีหน้าอะไรอยู่ ห้ามเดา path
ไม่ต้องส่ง arguments (body ว่างได้)
curl -X POST https://api.mcsv.me/api/v1/tools/site_pages_list \
-H "Authorization: Bearer <TOKEN>"{
"ok": true,
"result": {
"site_enabled": true,
"site_url": "https://myserver.mcsv.me",
"pages": [
{
"path": "/",
"kind": "tsx",
"title": null,
"published": true,
"use_tailwind": false,
"compile_error": null,
"size": 4855
},
{
"path": "/style.css",
"kind": "html",
"title": null,
"published": true,
"use_tailwind": false,
"compile_error": null,
"size": 812
}
],
"count": 2,
"note": "อ่านโค้ดหน้าไหนใช้ site_page_read · แก้/สร้างใช้ site_page_write (ต้องอ่านก่อนถ้าหน้ามีอยู่แล้ว) · ยังไม่ตั้ง subdomain = เว็บยังไม่มี URL ให้ผู้ใช้ไปตั้งที่เมนู 'โดเมน'"
}
}site_page_readread-onlyอ่านโค้ดหน้าเว็บ
อ่านโค้ดของหน้าเว็บหนึ่งหน้า (source เต็ม) · path เหมือนที่เห็นใน site_pages_list เช่น `/`, `/rules`, `/style.css` · **ต้องอ่านก่อนทุกครั้งที่จะแก้หน้าที่มีอยู่แล้ว** — site_page_edit ต้องใช้ old_string ที่คัดลอกจากผลของ tool นี้ตรงตัว และ site_page_write เขียนทับทั้งหน้า
| argument | type | คำอธิบาย |
|---|---|---|
path* | string | path ของหน้า เช่น `/` `/rules` `/style.css` |
curl -X POST https://api.mcsv.me/api/v1/tools/site_page_read \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"path":"/"}'{
"ok": true,
"result": {
"path": "/",
"kind": "html",
"title": null,
"published": true,
"use_tailwind": false,
"compile_error": null,
"source": "<h1>{{ name }}</h1>\n<p>{{ players }}/{{ max_players }} กำลังเล่น · {{ address }}</p>"
}
}site_page_writeเขียน/สร้างหน้าเว็บ
สร้างหน้าใหม่ หรือเขียนทับหน้าเดิม **ทั้งหน้า** · **แก้หน้าที่มีอยู่แล้วให้ใช้ `site_page_edit` แทนเสมอ** (แก้เฉพาะจุด ส่วนอื่นของหน้าไม่ถูกแตะ) — ใช้ตัวนี้กับของเดิมเฉพาะตอนรื้อทั้งหน้าจริง ๆ และต้อง site_page_read ก่อนแล้วส่ง source ฉบับเต็ม · kind=`html` เขียน HTML/CSS/JS ตรง ๆ · kind=`tsx` เขียน React แล้วระบบคอมไพล์ให้ (ต้อง export default function · import ได้เฉพาะ react, react-dom/client, mcsv, styled-components, framer-motion, axios, lodash, clsx, dayjs, canvas-confetti, marked) · path ที่มีนามสกุล (.css/.js) = ไฟล์ที่หน้าอื่นอ้างได้ · ใส่ข้อมูลเซิร์ฟสดด้วยตัวแปร {{ players }} {{ max_players }} {{ address }} {{ name }} {{ status }} {{ version }} {{ motd }} {{ icon }} {{ host }} {{ port }} {{ game }} {{ type }} {{ online }} หรือ useServer() ฝั่ง React — ห้ามพิมพ์ค่าตายตัว · โค้ดเดิมถูกเก็บเป็นเวอร์ชันก่อนทับเสมอ (ย้อนได้จากแผงควบคุม) · สูงสุด 50 หน้า/เซิร์ฟ และ 512KB/หน้า · คอมไพล์ไม่ผ่านยังบันทึกได้ แต่หน้าที่คนนอกเปิดจะขึ้นหน้าแจ้ง error จนกว่าจะแก้ (ดู compile_error ในผลลัพธ์)
| argument | type | คำอธิบาย |
|---|---|---|
path* | string | path ของหน้า เช่น `/` `/rules` `/style.css` (a-z 0-9 - _ . / เท่านั้น) |
source* | string | โค้ดทั้งหน้า |
kind | string | ชนิดหน้า (ไม่ส่ง = คงของเดิม, หน้าใหม่ = html) |
title | string | ชื่อหน้า (title tag) — optional |
published | boolean | เผยแพร่ให้คนนอกเห็นมั้ย (ไม่ส่ง = คงของเดิม, หน้าใหม่ = true) |
use_tailwind | boolean | โหลด Tailwind ให้หน้านี้ (ไม่ส่ง = คงของเดิม) |
curl -X POST https://api.mcsv.me/api/v1/tools/site_page_write \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"path":"/rules","kind":"html","source":"<h1>กติกาเซิร์ฟ {{ name }}</h1>\n<p>ผู้เล่นตอนนี้ {{ players }}/{{ max_players }}</p>"}'{
"ok": true,
"result": {
"ok": true,
"path": "/rules",
"kind": "html",
"created": true,
"bytes": 96,
"use_tailwind": false,
"published": true,
"url": "https://myserver.mcsv.me/rules",
"compile_error": null,
"next_steps": "บันทึกแล้ว ผู้ใช้ดูได้ทันทีถ้าเว็บเปิดอยู่ (site_pages_list บอกสถานะเปิด/ปิด)",
"previous_version_saved": false
}
}site_page_editแก้หน้าเว็บเฉพาะจุด
แก้หน้าเว็บ **เฉพาะจุด** ด้วยการยึดข้อความเดิม (anchor) — **นี่คือวิธีหลักในการแก้หน้าที่มีอยู่แล้ว** ส่วนที่ไม่ได้ระบุไม่ถูกแตะเลย จึงหายไม่ได้ (ต่างจาก site_page_write ที่ต้องพิมพ์ทั้งหน้ากลับมา) · old_string ต้องคัดลอกจากผลของ site_page_read ตรงตัว (ตรงทั้งช่องว่าง ย่อหน้า ตัวพิมพ์) และต้องไม่ซ้ำในหน้า ไม่งั้นถูกปฏิเสธพร้อมบอกบรรทัดใกล้เคียงให้แก้ · ทุก edit ในชุดต้องผ่านหมดถึงจะบันทึก (ไม่มีบันทึกครึ่ง ๆ) · ของเดิมถูกเก็บเป็นเวอร์ชันก่อนแก้เสมอ · บันทึกแล้วระบบตรวจให้ทันที (คอมไพล์ TSX, syntax ของ `<script>`/CSS, ตัวแปร {{ }} ที่ไม่มีจริง, ไฟล์ที่อ้างแล้วยังไม่มี) แล้วคืนมาใน `problems` — มี error ต้องแก้ต่อทันที
| argument | type | คำอธิบาย |
|---|---|---|
path* | string | path ของหน้า เช่น `/` `/rules` `/style.css` (ต้องมีหน้านี้อยู่แล้ว) |
edits* | array | รายการแก้ไข ทำตามลำดับ |
title | string | เปลี่ยนชื่อหน้า (title tag) ไปด้วย — optional |
published | boolean | เปลี่ยนสถานะเผยแพร่ไปด้วย — optional |
use_tailwind | boolean | เปิด/ปิด Tailwind ของหน้านี้ไปด้วย — optional |
curl -X POST https://api.mcsv.me/api/v1/tools/site_page_edit \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"path":"/","edits":[{"old_string":"<h1>{{ name }}</h1>","new_string":"<h1>ยินดีต้อนรับสู่ {{ name }}</h1>"}]}'{
"ok": true,
"result": {
"ok": true,
"path": "/",
"kind": "html",
"edits_applied": 1,
"edits": [
{
"edit": 1,
"replaced": 1
}
],
"bytes_before": 812,
"bytes_after": 836,
"use_tailwind": false,
"published": true,
"site_enabled": true,
"url": "https://myserver.mcsv.me",
"auto_formatted": false,
"previous_version_saved": true,
"compile_error": null,
"problems": [
{
"severity": "warning",
"at": "/style.css",
"message": "หน้านี้อ้างไฟล์ `/style.css` แต่ยังไม่มีไฟล์นั้นในเว็บ — สร้างด้วย site_page_write (path เดียวกันเป๊ะ) ไม่งั้นสไตล์/สคริปต์จะไม่โหลด"
}
],
"next_steps": "บันทึกแล้ว แต่มีข้อควรแก้ 1 ข้อใน problems — จัดการให้จบก่อนสรุปกับผู้ใช้ว่าเสร็จ"
}
}site_page_deleteลบหน้าเว็บ
ลบหน้า/ไฟล์ของเว็บเซิร์ฟ · โค้ดถูกเก็บเข้าประวัติเวอร์ชันก่อนลบ (กู้จากแผงควบคุมได้) แต่ URL จะหายทันที — ยืนยันกับเจ้าของก่อนลบเสมอ
| argument | type | คำอธิบาย |
|---|---|---|
path* | string | path ของหน้าที่จะลบ |
curl -X POST https://api.mcsv.me/api/v1/tools/site_page_delete \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"path":"/old-page"}'{
"ok": true,
"result": {
"ok": true,
"deleted": "/old-page",
"note": "โค้ดของหน้านี้ถูกเก็บไว้ในประวัติเวอร์ชันแล้ว กู้กลับได้จากหน้าเว็บไซต์ในแผงควบคุม"
}
}site_set_enabledเปิด/ปิดเว็บ
เปิด/ปิดเว็บเซิร์ฟทั้งเว็บ · ปิดแล้วผู้เยี่ยมชมเห็นหน้า 404 ทุก path (หน้ายังอยู่ครบ) · เปิดแต่เซิร์ฟยังไม่ได้ตั้ง subdomain = ยังไม่มี URL ให้เข้า ต้องให้เจ้าของไปตั้งที่เมนูโดเมนก่อน
| argument | type | คำอธิบาย |
|---|---|---|
enabled* | boolean | true = เปิดเว็บ, false = ปิด |
curl -X POST https://api.mcsv.me/api/v1/tools/site_set_enabled \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"enabled":true}'{
"ok": true,
"result": {
"ok": true,
"site_enabled": true,
"site_url": "https://myserver.mcsv.me",
"note": "เว็บเปิดแล้ว หน้าที่ published อยู่จะเห็นได้ทันที"
}
}web_fetchread-onlyอ่านหน้าเว็บภายนอก
ดึงเนื้อหาหน้าเว็บ (เช่น doc/wiki/GitHub README) แล้วคืนเป็น plain text · http/https เท่านั้น · บล็อก private IP · ตัดที่ ~15000 ตัวอักษร
| argument | type | คำอธิบาย |
|---|---|---|
url* | string | http/https URL ของหน้าที่จะอ่าน |
curl -X POST https://api.mcsv.me/api/v1/tools/web_fetch \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"url":"https://docs.papermc.io/paper/getting-started"}'{
"ok": true,
"result": {
"url": "https://mcsv.me/llms.txt",
"content": "# MCSV — เช่าเปิดเซิร์ฟเวอร์ Minecraft (โฮสติ้งไทย)\n\n> MCSV (mcsv.me) คือบริการเช่าเปิดเซิร์ฟเวอร์ Minecraft สัญชาติไทย ดาต้าเซ็นเตอร์กรุงเทพฯ\n> ปิงต่ำสำหรับผู้เล่นในไทย/เอเชียตะวันออกเฉียงใต้ สร้างเซ…",
"truncated": false
}
}ความปลอดภัย + audit
- Audit ทุกการแก้ไข · ทุกการเรียก tool ที่แก้อะไรบนเซิร์ฟ ถูกเก็บใน "กิจกรรมล่าสุด" ของหน้า API / MCP (แก้ไฟล์เห็น diff ด้วย) และตั้งให้ยิง server webhook แจ้งเตือนได้
- ไฟล์ credentials ถูกล็อค · อ่านหรือแก้ไฟล์อย่าง
.env,.pemหรือไฟล์ที่ชื่อมีคำว่า token / secret / password ไม่ได้ ระบบบล็อคให้อัตโนมัติ - คำสั่งคอนโซลอันตรายถูกบล็อค ·
op,deop,ban,stopส่งผ่านconsole_sendไม่ได้ · จะปิดเซิร์ฟให้ใช้power_actionแทน - อยากปลดล็อกก็ทำได้ (ปุ่มเดียว) · ในหน้าตั้งค่าสิทธิ์ของ key มีสวิตช์ ปลดล็อกทั้งหมด เปิดแล้วด่านกัน 2 ข้อข้างบนหายทั้งหมด สำหรับ key ใบนั้น คำสั่งอย่าง
stop,op,ban,reloadรันได้ ไฟล์ credentials แก้ได้ (ไฟล์ระบบอย่างserver.jar,start.sh,eula.txtยังล็อกไว้เหมือนเดิม) ค่าเริ่มต้นคือปิดไว้ · เปิดแล้วให้ถือ key เท่ารหัสผ่านแอดมิน หลุดเมื่อไหร่ revoke ทันที · เช็คสถานะจากGET /api/v1/meที่ fieldguard_bypass· สวิตช์มีผลทันทีกับการเรียกครั้งถัดไป ถ้าเปิดแล้ว AI ยังบอกว่าทำไม่ได้ ให้พิมพ์บอกให้ลองใหม่ หรือ reload การเชื่อมต่อ MCP ในแอป - Revoke ได้ทุกเมื่อ · กด revoke key ไหนก็ได้จากหน้า API / MCP มีผลทันทีทั้ง REST และ MCP
คำถามที่พบบ่อย
อยากให้ AI ช่วยดูแลเซิร์ฟโดยไม่ต้องตั้งค่าอะไรเลย ใช้ ถาม AI ในเว็บ ได้ทันที · ส่วน key ทั้งหมดจัดการได้ที่เมนู ระบบ → API / MCP (/server-detail/<id>/api)