🛠 API Reference
MCP Tools Reference
16 MCP tools — ใช้ผ่าน Claude/Manus/GPT หรือเรียก programmatic
เอกสารเต็มที่ docs/tools-reference.md · ดูภาษา MCP ที่ modelcontextprotocol.io
Quick start
1. Install MCP server:
git clone https://github.com/Nirvacore/nirvadeploy.git cd nirvadeploy-mcp python3 -m venv .venv && source .venv/bin/activate pip install -r requirements.txt
2. Set RAILWAY_TOKEN:
cp .env.example .env # then edit RAILWAY_TOKEN=xxx
3. Connect to Claude Desktop — see full guide
📖 READ (8)
nirvadeploy_list_projects
แสดงรายชื่อโปรเจกต์ทั้งหมดของบัญชี
AI prompt example:
"ดูโปรเจกต์ใน NirvaDeploy ที"nirvadeploy_list_services
ดู services + สถานะ deployment ล่าสุดในโปรเจกต์
Input:
project_id: stringrequired — ID โปรเจกต์
AI prompt example:
"services ใน project nirvacore มีอะไรบ้าง"nirvadeploy_list_environments
ดู production / staging / preview environments
Input:
project_id: stringrequired — ID โปรเจกต์
nirvadeploy_list_deployments
ประวัติการ deploy ของ service (10 ล่าสุด default)
Input:
service_id: stringrequired — ID servicelimit: int (1-100) — Default 10
nirvadeploy_list_variables
ดู env variables — default แสดงแค่ชื่อ (กัน secret หลุด)
Input:
project_id: stringrequiredservice_id: stringrequiredenvironment_id: stringrequiredreveal_values: bool — Default false. ระวัง — secret อาจอยู่ใน output
nirvadeploy_get_logs
ดู logs ของ deployment ที่ระบุ
Input:
deployment_id: stringrequired — ID deploymentlimit: int (1-1000) — Default 100
nirvadeploy_get_metrics
CPU / RAM / network usage ของ service ใน 1 ชม. ล่าสุด
Input:
service_id: stringrequired
nirvadeploy_list_templates
ดู Thai-focused templates (10 ตัว: free + premium)
Input:
category: string? — scraping | line | parser | nlp | other | allfree_only: bool — Default false
✏️ WRITE (6)
nirvadeploy_redeploy_service
สั่ง deploy service ใหม่
Input:
service_id: stringrequired
nirvadeploy_set_variable
ตั้ง env variable (upsert — idempotent)
Input:
project_id: stringrequiredservice_id: stringrequiredenvironment_id: stringrequiredname: string (≤100)required — เช่น DATABASE_URLvalue: stringrequired
nirvadeploy_create_project_from_repo
สร้างโปรเจกต์ใหม่จาก GitHub repo (auto-detect Nixpacks)
Input:
repo: stringrequired — owner/repo หรือ URL เต็มname: string? — ชื่อโปรเจกต์ (default = repo name)branch: string — Default main
nirvadeploy_rollback_deployment
Rollback ไป deployment เก่า
Input:
deployment_id: stringrequired — Target deployment
nirvadeploy_scale_service
เปลี่ยนจำนวน replicas (1-10) — horizontal scaling
Input:
service_id: stringrequiredreplicas: int (1-10)required — 1 = no scale, 2+ = horizontal
nirvadeploy_deploy_template
Deploy template จาก marketplace
Input:
slug: stringrequired — เช่น line-bot-starterproject_name: string?env: dict? — Required env vars for template
🤝 AFFILIATE (1)
nirvadeploy_get_referral_link
ได้ affiliate link ของ user (สำหรับ AI ช่วย share)
Input:
source: string? — utm_source (twitter, blog, line-oa)to: string? — Deep-link path (default /)
⚠️ DESTRUCTIVE (1)
nirvadeploy_delete_service
⚠️ ลบ service ถาวร — ต้องส่ง confirm=True
Input:
service_id: stringrequiredconfirm: boolrequired — ต้อง true เท่านั้น (default false)
📐 MCP Annotation reference
ทุก tool มี annotations 4 ตัวเพื่อบอก AI client ว่าทำงานยังไง
| Flag | ถ้า True |
|---|---|
| readOnlyHint | AI เรียกได้อิสระไม่ต้องถาม user |
| destructiveHint | AI ต้องขอ confirm จาก user ก่อนเรียก |
| idempotentHint | AI retry ได้อย่างปลอดภัย |
| openWorldHint | AI ไม่ควร cache ผล |