MCP — AI agent access
Whitesmith exposes your account to AI agents over the Model Context Protocol. An agent with your token can operate the same REST API you use in the dashboard — patterns, mailshots, sequences, webhooks, integrations — with exactly your permissions.
1. Create a personal token
Tokens are created in the dashboard and shown only once: Settings → MCP Tokens. A token inherits your live permissions and can be revoked at any time.
2. Configure your client
Replace <YOUR_TOKEN> with the token from step 1. The same mcp.json works for pi, Cursor, Claude Desktop and any other MCP client.
Connect an AI agent (MCP)
Endpoint: https://whitesmith.ru/api/mcp
You need a personal token — create one in Settings → MCP Tokens. Full guide: whitesmith.ru/mcp
pi (pi coding agent)
pi mcp add whitesmith-org --url https://whitesmith.ru/api/mcp --header "Authorization=Bearer <YOUR_TOKEN>"Claude Code
claude mcp add --transport http whitesmith-org https://whitesmith.ru/api/mcp --header "Authorization: Bearer <YOUR_TOKEN>"mcp.json — Cursor, pi, any MCP client
{
"mcpServers": {
"whitesmith-org": {
"url": "https://whitesmith.ru/api/mcp",
"headers": {
"Authorization": "Bearer <YOUR_TOKEN>"
}
}
}
}3. Install the Whitesmith agent kit
Whitesmith agent kit (skills)
Beyond MCP tools, Whitesmith ships a skill that teaches your agent the custom static-site development loop: pull a site into local files, load its design contract, edit, push back, build a preview, screenshot and audit it with Playwright. One command installs it (Node.js ≥ 20 required):
curl -fsSL https://whitesmith.ru/agent-kit/install.sh | sh- Installs to
~/.whitesmith-agent-kit/and links the skill into~/.pi/agent/skills/(pi) and~/.claude/skills/(Claude Code) - Prefer to review first? read install.sh or download the tarball manually
- Re-run the installer to update; still needs an MCP token (step 1) to do anything
What agents get
- list_endpoints — every REST endpoint the token may call, with RBAC requirements
- api_call — call any of those endpoints (method, path, body); each call runs the real permission stack
- describe_entity — field structure of any model, for composing request bodies
- Sugar tools: org settings get/set, integration account rotation, webhook test-fire, sequence run, and the static-site loop — static_sites_list, static_site_pull, static_site_page_update, static_site_component_update, static_site_preview (preview build + ready-to-use Playwright manifest), static_site_build_status
File uploads
For a site asset or Diary release file, ask your agent to find the endpoint’s fileUpload entry in list_endpoints. The agent calls prepare_file_upload with the file name, size, and SHA-256 checksum.
Use curl if your agent can access the file. MCP returns a short-lived upload URL and the headers to send. No browser, local MCP server, or transfer of file bytes through the conversation is needed. If the agent can’t access the file, open the private browser link it provides and select the file yourself.
If the transfer stops, use file_upload_status to resume from the next part. After upload, complete_file_upload verifies the file and attaches it under your existing permissions. Diary releases still require an explicit publish step. For other multipart endpoints, you can still use api_call with multipart.
Superadmin scope
Platform administrators get a separate scope at /api/superadmin/mcp with organization overview/approval, DNS zone management and MTA status tools. Create its tokens on the superadmin MCP page. The two scopes are fully isolated: an org token can never reach superadmin routes, and vice versa.
Security notes
- Tokens are bearer secrets — store them like passwords
- Every agent call carries your permissions at call time; revoking the token cuts access immediately
- Token activity (creation, last use) is visible on the token page