Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MCP setup for agents

Rustiz serves the Model Context Protocol in two ways:

TransportCommand / URLAuthWhen to use
stdiorustiz mcpAPI key from config.env (or --api-key)The agent runs on the same machine
Streamable HTTPhttps://<your-host>/mcpAuthorization: Bearer <api-key>, or OAuth 2.1 + PKCERemote agents, Rustiz Cloud, several agents sharing one server

The server uses the official rmcp SDK. It implements spec revision 2026-07-28 and still accepts older clients that send initialize. Tool names match Postiz’s MCP server, so prompts written for Postiz keep working.

Operator details such as the OAuth endpoints, allowed hosts and token lifetimes are in Self-hosting §7.

Local (stdio)

Run rustiz init once. It prints the exact block for your machine:

{
  "mcpServers": {
    "rustiz": {
      "command": "/usr/local/bin/rustiz",
      "args": ["mcp"]
    }
  }
}

Use the absolute path: desktop apps don’t inherit your shell’s PATH. If you ran init --dir <path>, add "env": { "RUSTIZ_CONFIG": "<path>/config.env" }. stdout carries the protocol and diagnostics go to stderr.

Claude Desktop

Open Settings → Developer → Edit Config (on macOS the file is ~/Library/Application Support/Claude/claude_desktop_config.json), merge the block above into it, and restart Claude Desktop.

Claude Code

claude mcp add rustiz -- /usr/local/bin/rustiz mcp
# remote server:
claude mcp add --transport http rustiz https://social.example.com/mcp \
  --header "Authorization: Bearer $RUSTIZ_API_KEY"

Cursor

Add the block to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project). For a remote server:

{
  "mcpServers": {
    "rustiz": {
      "url": "https://social.example.com/mcp",
      "headers": { "Authorization": "Bearer <api-key>" }
    }
  }
}

Other clients

Any MCP client that can launch a command (rustiz mcp) or speak Streamable HTTP works. For example, OpenAI Codex CLI in ~/.codex/config.toml:

[mcp_servers.rustiz]
command = "/usr/local/bin/rustiz"
args = ["mcp"]

Client config formats change often. If a snippet here doesn’t match your client’s documentation, follow the client’s documentation. The Rustiz side is always the same: rustiz mcp, or https://<host>/mcp with a Bearer key.

Remote (HTTP)

{
  "mcpServers": {
    "rustiz": {
      "type": "http",
      "url": "https://social.example.com/mcp",
      "headers": { "Authorization": "Bearer <api-key>" }
    }
  }
}

OAuth instead of a key in the config: leave out the header. A client that supports MCP authorization gets a 401 pointing at /.well-known/oauth-protected-resource/mcp, registers itself and opens a consent page that asks for the organization API key once. Access tokens last 1 hour and refresh tokens 30 days. Rotating the API key (rustiz org rotate-key <org-id>) revokes all of them.

If clients reach the server under a hostname other than FRONTEND_URL, add it to MCP_ALLOWED_HOSTS.

Tools

31 tools. The typical flow is in bold.

AreaTools
ChannelsprovidersStatusTool, integrationList, integrationSchema, connectChannelTool, triggerTool, channelSetupTool, channelSetTool, groupList, customersTool, mentionsTool
PostsvalidatePostTool, schedulePostTool, postStatusTool, postsListTool, updatePostTool, deletePostTool, findSlotTool, postSettingsTool
MediauploadFromUrlTool, mediaListTool, mediaDeleteTool
AnalyticsanalyticsTool, postAnalyticsTool, shortLinkStatsTool, notificationsListTool
WorkspacetagsTool, setsTool, signaturesTool, webhooksTool, plugsTool, autopostTool

How an agent schedules a post

providersStatusTool                     -> which platforms this server can connect
integrationList                         -> connected channels and their ids
integrationSchema { platform: "x" }     -> length limit, threads, settings, functions
validatePostTool  { socialPost: [...] } -> checks without creating anything
schedulePostTool  { idempotencyKey, socialPost: [...] }
postStatusTool    { group }             -> QUEUE / PUBLISHED / ERROR, URL, retryable?

A schedulePostTool call:

{
  "idempotencyKey": "launch-note-1",
  "socialPost": [
    {
      "integrationId": "<channel id>",
      "type": "schedule",
      "date": "2030-01-01T09:00:00Z",
      "postsAndComments": [
        { "content": "<p>We just shipped.</p>", "attachments": ["https://cdn.example.com/shot.png"] },
        { "content": "<p>Docs: https://example.com/docs</p>" }
      ],
      "settings": []
    }
  ]
}

postsAndComments[0] is the post and the rest are replies (a thread). Content is HTML: wrap each line in <p>.

Resending is safe. An identical call within 10 minutes, or the same idempotencyKey within 24 hours, returns the first result instead of posting again.

type: "now" returns a durable task handle to clients that declare the MCP Tasks extension. Other clients get a normal result and poll postStatusTool.

Live updates: subscriptions/listen on rustiz://posts/<id> or rustiz://groups/<id> sends a hint whenever a post’s state changes.

Connecting accounts from an agent

connectChannelTool handles every connection mode:

  • OAuth (X, LinkedIn, YouTube, …) returns {connected:false, pending:true, connectionId, url}. A human opens url once, and the agent polls with connectionId. Clients with URL elicitation get the link directly.
  • Credentials (Bluesky, Dev.to, WordPress, …): pass customFields, and the account connects immediately with no browser.
  • Telegram, Moltbook, Farcaster return an instruction for the human (a bot command, a claim URL, or a signer approval), then the agent polls.
  • Pages and companies (Facebook, Instagram, LinkedIn Page, YouTube, Google Business, Tumblr): finish with triggerTool and then channelSetupTool.

Each provider page lists the exact fields and follow-up steps.