API / MCP
REST API + MCP สำหรับต่อ AI, สคริปต์ และ automation เข้าเซิร์ฟ
ภาพรวม
หน้า API / MCP อยู่ในเมนู ระบบ → API / MCP ของแต่ละเซิร์ฟ (/server-detail/<id>/api) เจ้าของเซิร์ฟสร้าง key ได้สูงสุด 5 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 ช่องทาง
สร้าง key + กำหนดสิทธิ์
เข้าเมนู API / MCP
กดสร้าง key แล้วตั้งชื่อ
เลือกสิทธิ์
copy token
mcsv_ และแสดงครั้งเดียวตอนสร้างเท่านั้น copy เก็บไว้ให้ดีก่อนปิดหน้าต่างสิทธิ์แก้ย้อนหลังได้ตลอดจากปุ่ม "สิทธิ์" ของ key แต่ละตัว มีผลทันทีโดยไม่ต้องแจก token ใหม่
ต่อ 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
ต่อสำเร็จแล้วลองสั่ง AI ว่า "ดูสถานะเซิร์ฟหน่อย" (จะเรียก server_overview) หรือ "อ่าน log ล่าสุด" ถ้าตอบกลับมาพร้อมข้อมูลจริงของเซิร์ฟ แปลว่าใช้งานได้แล้ว
ใช้ REST API
ถ้าไม่ได้ต่อ AI แต่อยากยิงเองจากสคริปต์หรือ bot ใช้ REST API ได้เลย base URL คือhttps://api.mcsv.me/api/v1 ทุก endpoint ใช้ header เดียวกับ MCP
เช็คว่า key ใช้ได้ + ดูสิทธิ์ · GET /api/v1/me:
curl -H "Authorization: Bearer <TOKEN>" https://api.mcsv.me/api/v1/meดูรายชื่อ 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: 401 key ผิดหรือถูก revoke · 403 key ไม่มีสิทธิ์ tool นั้น · 404 ไม่รู้จัก tool · 429 เกิน rate limit
POST /api/v1/tools/backups_create · สคริปต์แจ้งเตือนตอนดิสก์ใกล้เต็มTool reference (ครบทุกตัว · 46 tools · 13 กลุ่ม)
กดที่ชื่อ tool เพื่อดู arguments ที่ต้องส่ง พร้อมตัวอย่าง request / response จริง · argument ที่มี * คือจำเป็นต้องส่ง · ตัวที่ติดป้าย read-only คือ tool ที่อ่านข้อมูลอย่างเดียว ไม่แก้อะไรบนเซิร์ฟ (ชุดสิทธิ์ "อ่านอย่างเดียว" เปิด 19 ตัวนี้ให้อัตโนมัติ)
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 | default: 20 |
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
}
}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 (root = `/`). คืน name, size, is_file, mime, modified_at
| argument | type | คำอธิบาย |
|---|---|---|
directory* | string | absolute path เช่น `/` หรือ `/plugins` |
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 จาก Wings (max 200k chars). ใช้สำหรับ config/log/source ทั่วไป
| argument | type | คำอธิบาย |
|---|---|---|
path* | string | — |
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* | string[] | absolute paths เช่น ["/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 ดาวน์โหลดไฟล์จาก Wings (TTL สั้น)
| argument | type | คำอธิบาย |
|---|---|---|
file* | string | — |
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_writeเขียน/สร้างไฟล์
เขียนทับไฟล์ (สร้างใหม่ถ้าไม่มี). content เป็น UTF-8 text
| argument | type | คำอธิบาย |
|---|---|---|
path* | string | — |
content* | string | — |
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_deleteลบไฟล์/โฟลเดอร์
ลบไฟล์/โฟลเดอร์ใน root (relative). ระวัง — ไม่มี recycle bin
| argument | type | คำอธิบาย |
|---|---|---|
root | string | default: "/" |
files* | string[] | — |
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สร้างโฟลเดอร์
สร้างโฟลเดอร์ใหม่ใน root
| argument | type | คำอธิบาย |
|---|---|---|
root | string | default: "/" |
name* | string | — |
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ย้าย/เปลี่ยนชื่อไฟล์
เปลี่ยนชื่อ/ย้ายหลายไฟล์ใน root (relative paths)
| argument | type | คำอธิบาย |
|---|---|---|
root | string | default: "/" |
renames* | object[] | — |
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`). location = absolute path
| argument | type | คำอธิบาย |
|---|---|---|
location* | string | — |
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"
}
}files_compressบีบอัดเป็น .tar.gz
บีบอัดไฟล์/โฟลเดอร์ใน root เป็น .tar.gz (Pelican-managed)
| argument | type | คำอธิบาย |
|---|---|---|
root | string | default: "/" |
files* | string[] | — |
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,
"archive": {
"name": "archive-2026-07-12.tar.gz",
"size": 10485760
}
}
}files_decompressแตกไฟล์ archive
แตก archive ใน root (tar/tar.gz/zip)
| argument | type | คำอธิบาย |
|---|---|---|
root | string | default: "/" |
file* | string | — |
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, รูป, world, schema) · text ธรรมดาควรใช้ files_write
| argument | type | คำอธิบาย |
|---|---|---|
path* | string | absolute path ปลายทาง เช่น `/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 บรรทัดล่าสุดของ /logs/latest.log
| argument | type | คำอธิบาย |
|---|---|---|
lines | integer | default: 200 |
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": {
"lines": [
"[12:00:01] Server started.",
"[12:00:05] Player Steve joined the game"
],
"count": 2
}
}console_sendส่งคำสั่ง console
ส่งคำสั่งเข้า server console (เช่น `say hello`, `tps`, `op user`). ไม่มี filter — owner เท่านั้น
| argument | type | คำอธิบาย |
|---|---|---|
command* | string | — |
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!"
}
}power_actionstart / stop / restart / kill
Start/stop/restart/kill server
| argument | type | คำอธิบาย |
|---|---|---|
action* | string | start | stop | restart | kill |
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 | default: "MCP backup" |
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 | default: false |
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 ใน /plugins (Paper/Spigot/Bukkit) หรือ /mods (Forge/Fabric)
ไม่ต้องส่ง arguments (body ว่างได้)
curl -X POST https://api.mcsv.me/api/v1/tools/plugins_list \
-H "Authorization: Bearer <TOKEN>"{
"ok": true,
"result": {
"directory": "/plugins",
"plugins": [
{
"file": "EssentialsX-2.20.1.jar",
"size": 1048576,
"enabled": true
}
],
"count": 1
}
}security_scanread-onlyสแกนมัลแวร์ใน jar
สแกน .jar ใน /plugins + /mods หามัลแวร์ที่รู้จัก: jar infector ตระกูล ServerLibs/LibAPI (ฝังตัวลามข้าม jar → ปลั๊กอิน/Geyser พังสุ่ม ต้องรีเซิร์ฟบ่อย) + xmrig cryptominer · คืนรายชื่อ jar ที่ติด + family/markers · ⚠️ ตรวจแบบ signature = จับเฉพาะมัลแวร์ที่รู้จักแล้ว ไม่ใช่การรับประกันว่าสะอาด 100% (partial detection)
ไม่ต้องส่ง arguments (body ว่างได้)
curl -X POST https://api.mcsv.me/api/v1/tools/security_scan \
-H "Authorization: Bearer <TOKEN>"{
"ok": true,
"result": {
"scanned": 0,
"infected_count": 0,
"clean_count": 0,
"infected": [],
"verdict": "CLEAN",
"disclaimer": "signature-based scan — detects KNOWN malware only (ServerLibs/LibAPI jar infector + xmrig miner). NOT a guarantee the server is clean."
}
}search_modsread-onlyค้นหา plugin/mod (Modrinth)
ค้น plugin/mod จาก Modrinth + Hangar (PaperMC) · คืนชื่อ/slug/คำอธิบาย/ยอดโหลด/หน้าโปรเจกต์ · เอา URL ดาวน์โหลดไปใช้กับ files_fetch_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:p4ssw0rd_Example123@db6.mcsv.me: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:p4ssw0rd_Example123@db6.mcsv.me: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 | command | power |
action_data* | object | — |
cron_expression* | string | เช่น `0 6 * * *` (every 6am) |
timezone | string | default: "Asia/Bangkok" |
is_active | boolean | default: true |
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 · 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 | discord | json · default: "discord" |
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 (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": "friend@example.com",
"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"
}
}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แทน - Revoke ได้ทุกเมื่อ · กด revoke key ไหนก็ได้จากหน้า API / MCP มีผลทันทีทั้ง REST และ MCP
คำถามที่พบบ่อย
อยากให้ AI ช่วยดูแลเซิร์ฟโดยไม่ต้องตั้งค่าอะไรเลย ใช้ ถาม AI ในเว็บ ได้ทันที · ส่วน key ทั้งหมดจัดการได้ที่เมนู ระบบ → API / MCP (/server-detail/<id>/api)