Cho agent · v1

REST + MCP

Cùng một nội dung, hai đường vào: REST cho script, MCP cho agent. Guide subscriber cần token; bài công khai không cần.

Xác thực

Tạo token trong API keys, gửi kèm header Authorization: Bearer.

GET /content/:locale/:slug

Trả về nội dung đã compile của một guide theo ngôn ngữ. Guide subscriber yêu cầu quyền truy cập đang hoạt động.

Tham sốKiểuMặc định
localevi | enbắt buộc
slugstringbắt buộc
request
curl https://api.slopengineer.dev/content/vi/herdr-complete-guide \
  -H "Authorization: Bearer $SLOP_TOKEN"
response · 200
{
  "slug": "herdr-complete-guide",
  "locale": "vi",
  "version": "1.1.0",
  "license": "All rights reserved",
  "body": "<h2>…</h2>"
}

MCP server

Khai báo một lần trong client MCP; agent thấy các tool catalog.list, catalog.get, content.read, article.list, article.get và pack.download.

mcp.json
{
  "mcpServers": {
    "slopengineer": {
      "url": "https://api.slopengineer.dev/mcp",
      "headers": { "Authorization": "Bearer $SLOP_TOKEN" }
    }
  }
}

Gọi guide subscriber khi quyền truy cập đã hết trả về lỗi entitlement kèm liên kết tới trang gói.