AI agents
Hand off whole workflows — verify members, restore a backup, post a panel — to an AI agent. Restore Hub supports three integration styles: native MCP, OpenAPI-aware platforms, and plain HTTP with a system prompt. Pick the one that matches your tool.
Bases an agent should know
- REST API:
https://api.restorehub.net/api/v1 - OpenAPI:
https://api.restorehub.net/api/v1/openapi.json - Data model:
https://api.restorehub.net/api/v1/public/schema.json - MCP server:
https://mcp.restorehub.net/mcp - Agent playbook:
https://restorehub.net/agents.md
Native MCP clients
Best for Claude Desktop, Claude Code, Cursor, Zed — anything that speaks the Model Context Protocol. The agent gets a typed tool list pulled live from your account.
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json on macOS (or %APPDATA%\\Claude\\claude_desktop_config.json on Windows) and add:
Cursor
In Cursor, open Settings → MCP → Add new MCP server and paste:
Full MCP setup including troubleshooting is on the MCP Server page.
OpenAPI-aware platforms
For ChatGPT custom GPTs, Vercel AI SDK, LangChain, or any tool that consumes an OpenAPI 3.x spec.
ChatGPT custom GPT
- Open Configure → Actions → Create new action
- Click Import from URL and paste
https://api.restorehub.net/api/v1/openapi.json - Set Authentication → API Key → Bearer and paste your
rh_key - Save. The GPT can now call any endpoint.
Vercel AI SDK
Plain HTTP + system prompt
For agents that have no native tool support — or when you want the simplest possible setup — give the model a system prompt that points at the OpenAPI and lets it construct HTTP calls.
Widget SSO (drop-in Discord login)
Restore Hub's verification widget is a strict superset of rolling your own Discord OAuth. Drop in one script tag and you get a signed JWT plus the full Discord identity scope — username, global name, banner, accent color, locale, MFA status, Nitro tier, public flags, verified email, and account creation date.
Tokens are signed with RS256. The public JWKS is served at:
Verify a widget JWT offline with any JWKS-aware library:
Or POST the token to our HTTP endpoint (no API key required):
Response shape (nested):
Identity fields live under user.*; token + server metadata are at the root. Failure cases return 401 with { error, code: "INVALID_TOKEN" }.
Full snippet generator + payload reference is in your dashboard under Servers → [server] → Widget.
Acting on the user's behalf — token exchange
The widget JWT proves identity but doesn't carry the underlying Discord OAuth credentials. If your backend needs to call the Discord API as the verified user — list their admin guilds, fetch their connections, sync linked-account profile data — exchange the widget JWT for their Discord access_token via POST /api/v1/widget/access-token:
Response:
Then call Discord directly:
Opt-in required. The server owner enables this in Dashboard → Widget → Webhook & Redirect → "Share Discord OAuth tokens with widget integrators". Off by default. Calling the endpoint without the toggle returns 403 ACCESS_TOKEN_SHARE_DISABLED with a message pointing the owner at the setting.
Errors: 400 bad body, 401 invalid JWT, 403 opt-in not enabled, 404 member or server gone, 429 rate-limited (60/min/IP), 500 decrypt failure (member must re-verify). Treat access tokens like any OAuth credential — TLS only, never log, store server-side not in browser storage. The JWT itself expires in 1h; the access_token in ~7 days; use the refresh_token to renew (see below).
Refreshing an expired access_token
Discord access tokens expire after ~7 days. Refreshing requires the OAuth app's client_id + client_secret which we hold, you don't. Proxy the refresh through POST /api/v1/widget/refresh-token — we exchange the refresh token against Discord on your behalf and return new ones:
Response:
Discord rotates the refresh_token on every refresh — store the returned one over the old. We also update our cached encrypted copy on the verified-member row so background workers stay in sync. Same opt-in gate (scopeAccessTokenShare) and rate limit (60/min/IP). If Discord rejects the refresh (token revoked, already used, etc.) you get 401 REFRESH_TOKEN_INVALID — the user needs to re-verify through the widget popup to mint fresh credentials.
1-click DNS via Domain Connect
For the per-domain TXT verification step (proving you own the site embedding the widget), Restore Hub supports the Domain Connect open standard. If your DNS provider supports it (today: Cloudflare, GoDaddy, IONOS, Google Domains via Cloudflare, and a handful of others), the dashboard shows an "Add via Cloudflare — 1 click" button. Click it, approve the record on your provider's screen, and we re-verify automatically when you return. The manual TXT copy-paste flow remains the fallback for everyone else.
Sample prompts
Drop these straight into Claude, Cursor, or any MCP-connected agent.
- "List my Discord servers and show member counts."
- "Set up verification on server [name] with VPN blocking and alt detection."
- "Schedule daily backups at 3am UTC for every PRO server."
- "Pull all verified members from server X to server Y."
- "Mint an API key with only the read scopes I need to monitor my servers."
- "Send a verification panel to the #verify channel on server [name]."
- "Show me the last 20 audit-log entries with action containing 'BACKUP'."
Safety guardrails
Restore Hub doesn't trust agents — it trusts API keys. Two layers protect you:
- Scopes. A key without
backups:restoresimply cannot restore a backup, no matter what an agent decides. - Audit log. Every API-driven action is recorded with the key ID and metadata. View at /dashboard/audit-log.
For agent-driven workflows we recommend minting a read-only key for the first few sessions, then unlocking write scopes once you trust the prompts.