# XBeast MCP Server

> Connect Claude, Cursor, Codex or any MCP client to your XBeast workspace to read accounts, edit presets, manage schedules and create drafts.

Source: https://xbeast.io/docs/mcp

The XBeast MCP server lets an AI agent work inside your XBeast workspace using the same tools you use in the app: read connected accounts, edit account instructions, manage presets, change schedules, and create, edit or publish posts. It is a hosted remote MCP server at `https://xbeast.io/api/mcp` and uses the same API keys as the REST API.

> **Paid plans only**
>
> MCP access is included with every paid XBeast plan. Create a key on the [Developer page](https://xbeast.io/developers), then paste the server URL into your MCP client. The REST API is included too — see [the API docs](https://xbeast.io/docs/api.md).

## Quick start

1. Create an API key on the [**Developer page**](https://xbeast.io/developers). Choose **Full access** (or **Read-only** if the agent should never change anything). Copy the `xb_live_…` value once.
2. Connect your X account from the dashboard.
3. Add the XBeast MCP server to your AI client (snippets below).
4. Ask the agent to call `list_accounts` and then `list_presets` to confirm the connection.

### Claude Code

**terminal**

```text
claude mcp add --transport http xbeast https://xbeast.io/api/mcp \
  --header "Authorization: Bearer xb_live_YOUR_KEY"
```

### Cursor

Add this to your Cursor MCP configuration (for example `~/.cursor/mcp.json`):

**mcp.json**

```json
{
  "mcpServers": {
    "xbeast": {
      "url": "https://xbeast.io/api/mcp",
      "headers": {
        "Authorization": "Bearer xb_live_YOUR_KEY"
      }
    }
  }
}
```

### Claude Desktop (via mcp-remote)

**claude_desktop_config.json**

```json
{
  "mcpServers": {
    "xbeast": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://xbeast.io/api/mcp",
        "--header",
        "Authorization: Bearer xb_live_YOUR_KEY"
      ]
    }
  }
}
```

### Generic HTTP client

The server is stateless Streamable HTTP. Send JSON-RPC POST requests with `Accept: application/json, text/event-stream`, and authenticate with either `Authorization: Bearer xb_live_…` or `X-API-Key`. Never put the key in the query string.

**initialize**

```bash
curl -X POST "https://xbeast.io/api/mcp" \
  -H "Authorization: Bearer xb_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2025-06-18",
      "capabilities": {},
      "clientInfo": { "name": "my-agent", "version": "0.0.1" }
    }
  }'
```

## Tool catalog

Read tools are safe on read-only keys. Write tools create or change data and may spend credits. Destructive tools remove data or cancel work. Each tool returns JSON text and reports expected failures as `{ error: { code, message, hint } }`.

### Accounts & workspace

| Tool | Access | What it does |
| --- | --- | --- |
| get_workspace | Read | Plan, credits, reset date, limits, account/post counts. |
| get_account | Read | One account with prompts, timezone, follower counts. |
| list_accounts | Read | Filter by platform or posting_enabled. |
| update_account | Write | Edit account_prompt, reply_prompt, timezone, posting_enabled. |
| delete_account | Destructive | Remove an account and its schedules and posts. confirm: true. |
| get_connect_url | Read | Browser URL to connect a new X account (X only today). |

### Presets

| Tool | Access | What it does |
| --- | --- | --- |
| list_presets | Read | Owned presets, optionally with community presets. |
| get_preset | Read | Every generator field of one preset. |
| create_preset | Write | Create a preset; title is the only required field. |
| update_preset | Write | Edit any preset field. Community presets must be duplicated first. |
| delete_preset | Destructive | Delete a preset and remove it from schedules. confirm: true. |
| duplicate_preset | Write | Copy a community or owned preset into your workspace. |
| generate_from_preset | Write | Test-run a preset and save a history post. Costs credits. |

### Schedules

| Tool | Access | What it does |
| --- | --- | --- |
| list_schedules | Read | Preset slots, queue slots and reply sessions. |
| create_schedule | Write | Add a slot with days, time window and automations. |
| update_schedule | Write | Change days, times, auto-reply/retweet/plug or community. |
| delete_schedule | Destructive | Delete a weekly slot or reply session. |

### Posts

| Tool | Access | What it does |
| --- | --- | --- |
| list_posts | Read | Drafts, scheduled, queue, posted, cancelled, error and history. |
| get_post | Read | Full tweets, article, settings, metrics and error detail. |
| create_post | Write | Create a draft, schedule or publish now. Defaults to draft. |
| update_post | Write | Edit tweets, article, time, media or settings before it is sent. |
| delete_post | Destructive | Cancel an upcoming post or delete a draft/history post. |
| publish_post | Write | Publish now. Safe to retry; costs 1 credit (+10 with a URL). |
| queue_post | Write | Move a post into the next available queue slot. |
| cancel_post | Destructive | Cancel a scheduled post. |
| uncancel_post | Write | Restore a cancelled post. |
| mark_post_published | Write | Clear an uncertain failure after verifying the post is live. |
| regenerate_post | Write | Regenerate a scheduled preset post. Costs credits. |

### Generation & media

| Tool | Access | What it does |
| --- | --- | --- |
| generate_text | Write | AI, web search, YouTube, X rewrite, X news, link, list or article. |
| beast_mode_generate | Write | One tweet from an account’s profile and recent history. 1 credit. |
| edit_post_with_ai | Write | Rewrite a saved post with post_id (saves by default), or edit tweets state without saving. |
| generate_image | Write | AI image generation. Costs the model price. |
| edit_image | Write | Edit a public HTTPS image. 5 credits. |
| recommend_media | Write | Suggest a stock search query or AI image prompt. 1 credit. |
| search_media | Read | Search Unsplash, Pixabay, Lexica or Yandex. Free. |
| upload_media | Write | Store media from an HTTPS URL or base64. |

### Styles, auto plugs & tweet bank

| Tool | Access | What it does |
| --- | --- | --- |
| list_styles | Read | Owned and community writing styles. |
| get_style | Read | A style and its examples. |
| create_style | Write | Create an empty style. |
| update_style | Write | Rename, add text/URL/handle examples, replace or remove examples. |
| delete_style | Destructive | Delete a style you own. |
| list_auto_plugs | Read | Reusable plug tweets. |
| create_auto_plug | Write | Create a plug tweet (paid plans). |
| update_auto_plug | Write | Edit a plug tweet. |
| delete_auto_plug | Destructive | Delete a plug tweet. |

### Analytics, communities & account admin

| Tool | Access | What it does |
| --- | --- | --- |
| get_account_analytics | Read | Followers, following, tweets, likes and listed over time. |
| list_account_posts | Read | Sent-post performance for one account with engagement ratio, status, date range and pagination. |
| list_auto_replies | Read | Auto-reply activity for an account or post. |
| list_leaderboard | Read | Search the public creator leaderboard. |
| list_tweet_bank | Read | Browse viral tweets with handle, format and recency filters. |
| import_tweet_bank | Write | Import up to 20 post URLs or a handle’s recent top tweets. |
| search_communities | Read | Search X communities for scheduling. |

| Tool | Access | What it does |
| --- | --- | --- |
| get_affiliate | Read | Referral link, commission and pending payout. |
| get_affiliate_earnings | Read | Earnings, payout history and amount owed. |
| request_payout | Destructive | Request an affiliate payout. Needs $50 and confirm: true. |
| list_api_keys | Read | Active keys with prefix, access mode and last-used time. |
| create_api_key | Write | Create a full-access or read-only key. Maximum 5 active keys. |
| revoke_api_key | Destructive | Revoke a key. confirm: true. |
| get_billing_portal_url | Write | Stripe billing portal URL or the in-app /premium fallback. |

## In-app Copilot

The same tools power the in-app Copilot inside XBeast. If an action works there, it works for your MCP agent too — and vice versa. The Copilot adds in-app approval for destructive and public actions, but the tool names, inputs and results are identical to the ones documented here. The Copilot also has OpenRouter web search and web fetch built in, so it can answer current-facts questions and read links you share.

## Resources and prompts

The server also exposes read-only resources and reusable prompts. Resources let an agent load a JSON snapshot without spending a tool call; prompts give it a step-by-step workflow.

- `xbeast://workspace`, `xbeast://accounts`, `xbeast://presets`, `xbeast://schedule/{account_id}`
- Prompts: **Plan my week**, **Audit my schedule**, **Write and schedule a tweet**

## Example prompts

- "Set the account prompt for my main X account to: concise, technical, no hashtags."
- "Change my Tesla News preset to threads at 9am on Monday, Wednesday and Friday."
- "Edit the tweet in my draft to say: We just shipped the new API."
- "Create a draft tweet about our new release and show it to me before scheduling."
- "Queue the latest draft and tell me when it will publish."
- "Summarize my follower growth this month and which sent posts performed best."

## Security and safety

- **Paid plans only.** Free accounts receive `403` with a plan hint.
- **API-key auth.** Keys start with `xb_live_`, are hashed at rest, and are never accepted in query strings. Revoke a leaked key on the [Developer page](https://xbeast.io/developers).
- **Read-only option.** Create a read-only key when the agent should only read data. Every write and generation call is rejected with `403 read_only_key`, and a read-only key cannot create a full-access key.
- **Draft-first.** `create_post` defaults to a draft. Publishing requires an explicit `mode: "now"` or a separate `publish_post` call.
- Destructive tools (`delete_account`, `delete_preset`, `delete_schedule`, `delete_post`, `delete_style`, `delete_auto_plug`, `revoke_api_key`, `request_payout`) are annotated as destructive and require an explicit `confirm: true` argument.
- Use an `idempotency_key` (or the REST `Idempotency-Key` header) so retrying a create call does not make a second post.
- Publishing to X costs 1 credit per post, plus 10 if the post contains a URL. Generation costs the preset credit cost shown in the app.
- Max 7 scheduled or posted tweets per connected account per day (account timezone).
- Articles require an X Premium account. Auto-reply, auto-retweet and auto-plug require a paid plan.
- Requests are rate limited to roughly **120 per minute** per API key (or client IP for unauthenticated requests). A rejected request returns `429` with a `Retry-After` header. The Developer page also shows the last 10 API/MCP calls for the workspace.

## Client compatibility

The endpoint is stateless Streamable HTTP, so every client below uses the same URL and Bearer key. Tested configurations:

- **Claude Code** — `claude mcp add --transport http` with the `Authorization` header.
- **Cursor** — `mcp.json` with a `url` and headers (snippet above).
- **Claude Desktop** — `npx -y mcp-remote` bridging the remote URL to stdio.
- **Generic clients** — must send `Accept: application/json, text/event-stream`; JSON-only and SSE-only clients both work because the response content type is negotiated.
- **Retries** — send the same `idempotency_key` (or REST `Idempotency-Key` header) so a timeout retry returns the original post.
- **Cloudflare Workers** — the endpoint is verified with `pnpm preview` plus `node scripts/mcp-smoke.mjs` before each release.

## Troubleshooting

#### 401 Unauthorized

The key is missing, revoked or malformed. Create a new `xb_live_` key on the [Developer page](https://xbeast.io/developers) and send it as a Bearer token.

#### 403 Forbidden

Either the account is on the free plan (MCP requires a paid plan), or the key is read-only and the tool is a write or generation tool. The error body's `reason` distinguishes the two.

#### 405 Method Not Allowed

MCP JSON-RPC requests must use `POST`. A plain browser GET is not a valid MCP request.

#### 429 Too Many Requests

The endpoint allows about 120 requests per minute per key/IP. Wait for the number of seconds in the `Retry-After` header before retrying. Credits and plan limits are separate from this operational guard.

#### A retry created a duplicate post

Pass the same `idempotency_key` on every retry. The server returns the existing post instead of creating another. `publish_post` is also safe to retry: an already-sent post returns its existing result.

[Create an API key](https://xbeast.io/developers)

[REST API reference](https://xbeast.io/docs/api.md)
