Onie Cloud MCP v1.0.0

Điều khiển toàn bộ dịch vụ Onie Cloud bằng bất kỳ AI nào

Cắm mcp.onie.net vào Claude, ChatGPT, Cursor, Cline, Windsurf, hay OpenAI Agents SDK — và chỉ việc nói: "Tạo VM Ubuntu 4 vCPU ở Hà Nội", "Tắt VM tên web-prod-1", "Số dư còn bao nhiêu", "Tạo snapshot trước khi update". AI tự gọi đúng API.

🔌 Endpoint MCP

https://mcp.onie.net/mcp
Transport: Streamable HTTP (MCP 2025-03-26).

🔐 Auth

Bearer token Sanctum lấy từ Profile → API Tokens.

🛠 Số tool

58 tools (VM, billing, volume, network, K8s, DNS, SSH key, ticket...) + 1 tool onie_api_call generic.

🤖 Tương thích

Mọi client MCP hỗ trợ Streamable HTTP: Claude Code/Desktop, Cursor, Cline, Windsurf, OpenAI Agents SDK, n8n, LangChain MCP adapter...

Bước 1 — Lấy API token

1
Đăng nhập my.onie.net/profile Vào tab API TokensTạo token mới. Đặt tên (ví dụ: "Claude Code"), copy chuỗi token (chỉ hiện 1 lần).
⚠️ Token có toàn quyền user — đừng chia sẻ. Nếu lỡ leak, vào Profile → TokensRevoke ngay.

Bước 2 — Cắm vào AI client

Trên claude.ai → Settings → Connectors → Add custom connector. Form chỉ có 1 ô URL — KHÔNG cần OAuth, KHÔNG cần header. Dán URL có nhúng token:

Name:               Onie Cloud
Remote MCP URL:     https://mcp.onie.net/u/<YOUR_ONIE_TOKEN>/mcp
OAuth fields:       (để trống)

Bấm Add. Claude sẽ tự discover 58 tools.

🔑 Token nằm trong URL nên đừng share screenshot URL. Cần thu hồi: vào /profile → API Tokens → Revoke, URL cũ tự vô hiệu.

Cũng dùng được dạng query string (cho client khác chỉ chấp nhận URL): https://mcp.onie.net/mcp?token=<TOKEN>

Trong terminal đã có claude CLI:

claude mcp add --transport http onie https://mcp.onie.net/mcp \
  --header "Authorization: Bearer YOUR_ONIE_TOKEN"

Sau đó mở Claude Code, gõ /mcp để verify. AI sẽ thấy ngay 58 tools.

Mở file config Claude Desktop:

{
  "mcpServers": {
    "onie": {
      "url": "https://mcp.onie.net/mcp",
      "transport": "http",
      "headers": {
        "Authorization": "Bearer YOUR_ONIE_TOKEN"
      }
    }
  }
}

Restart Claude Desktop. Nếu version cũ chưa hỗ trợ remote MCP qua HTTP, dùng mcp-remote bridge:

{
  "mcpServers": {
    "onie": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote",
        "https://mcp.onie.net/mcp",
        "--header", "Authorization: Bearer YOUR_ONIE_TOKEN"
      ]
    }
  }
}

Cursor → Settings → MCP → Add new MCP Server:

{
  "mcpServers": {
    "onie": {
      "url": "https://mcp.onie.net/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_ONIE_TOKEN"
      }
    }
  }
}

Trong VS Code, mở Cline / Roo Cline settings → MCP → Edit MCP settings:

{
  "mcpServers": {
    "onie": {
      "type": "streamableHttp",
      "url": "https://mcp.onie.net/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_ONIE_TOKEN"
      }
    }
  }
}

Windsurf settings → MCP servers:

{
  "mcpServers": {
    "onie": {
      "serverUrl": "https://mcp.onie.net/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_ONIE_TOKEN"
      }
    }
  }
}

OpenAI Agents SDK (Python):

from agents import Agent
from agents.mcp import MCPServerStreamableHttp

onie_mcp = MCPServerStreamableHttp(
    name="onie",
    url="https://mcp.onie.net/mcp",
    headers={"Authorization": "Bearer YOUR_ONIE_TOKEN"},
)

agent = Agent(
    name="Cloud Ops",
    instructions="Bạn quản lý hạ tầng Onie Cloud của user.",
    mcp_servers=[onie_mcp],
)

OpenAI ChatGPT Connector (web): vào Settings → Connectors → Add custom MCP → URL https://mcp.onie.net/mcp, Bearer token.

# Init handshake
curl -X POST https://mcp.onie.net/mcp \
  -H "Authorization: Bearer YOUR_ONIE_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize",
       "params":{"protocolVersion":"2025-03-26",
                 "capabilities":{},
                 "clientInfo":{"name":"curl","version":"1"}}}'

# Health
curl https://mcp.onie.net/healthz

# List 58 tools
curl https://mcp.onie.net/info | jq '.tools[].name'

Bước 3 — Hỏi AI

Sau khi cắm xong, thử các câu lệnh tiếng Việt tự nhiên với AI:

Tools có sẵn (58)

Xem JSON đầy đủ tại /info. Highlights:

Account

get_profile · get_balance · list_activity · list_projects

Billing

get_billing_summary · list_invoices · list_transactions · get_hourly_usage

VMs

list_vms · create_vm · start_vm · stop_vm · reboot_vm · destroy_vm · resize_vm · reset_vm_password

Snapshots

list_vm_snapshots · create_vm_snapshot · restore_snapshot · delete_snapshot

Volumes

list_volumes · create_volume · attach_volume · detach_volume · delete_volume

Networks

list_networks · list_vpcs · list_ip_addresses · list_security_groups · list_load_balancers

DNS / SSH

list_dns_zones · create_dns_record · list_ssh_keys · create_ssh_key

Other services

list_kubernetes_clusters · list_container_apps · list_object_storage_buckets · list_gpu_instances · list_proxies · list_bare_metal

Support

list_support_tickets · create_support_ticket

Power user

onie_api_call — gọi tùy ý endpoint api.onie.net (trừ /admin).

🛡 Tool xóa (destroy_vm, delete_volume, delete_snapshot, restore_snapshot) yêu cầu tham số confirm: true để chống AI gọi nhầm.

Bảo mật