Skip to main content

Connect AI agents to WriteMars

WriteMars ships a remote MCP server. Once connected, an AI agent can browse your workspaces, draft and edit posts, write per-platform content, schedule, and (only when you explicitly ask) publish. Calls run with your permissions and are attributed to you; post/content actions use the same activity paths as the app.

You need: a personal access token — create one in Profile → API Tokens (guide).

Server details

The same for every client:

URLhttps://api.writemars.com/mcp/
TransportStreamable HTTP
Auth headerX-API-Key: writemars_pat_...

The trailing slash matters less than you'd think — both /mcp and /mcp/ work — but the header name must be exactly X-API-Key (an Authorization: Bearer writemars_pat_... header also works).

30-second quickstart

  1. In WriteMars, go to Profile → API Tokens → New token and copy the token (shown once).
  2. Connect Claude Code:
    claude mcp add --transport http writemars https://api.writemars.com/mcp/ \
    --header "X-API-Key: writemars_pat_..."
    …or Codex:
    export WRITEMARS_PAT="writemars_pat_..." # add to ~/.zshrc or ~/.bashrc
    codex mcp add writemars --url "https://api.writemars.com/mcp/" --bearer-token-env-var WRITEMARS_PAT
  3. Ask: "List my WriteMars workspaces."

Set up your client

ClientGuide
Claude CodeConnect Claude Code
CodexConnect Codex
CursorConnect Cursor
Claude DesktopConnect Claude Desktop

What to expect once connected

  • The agent discovers your workspaces itself (list_workspaces) — you don't need to feed it ids. Slugs and post ids from the app's URLs work too: in /my-team/posts/ce6b6c57-..., my-team is the workspace slug and the UUID is the post id.
  • Every change lands in the post's activity log attributed to you.
  • The agent has your permissions, nothing more. Workspace-scoped tokens confine it to that workspace.
  • Publishing is deliberately conservative: the server instructs agents to call publish_variant only when you explicitly ask to publish.
  • Requests are rate-limited per token (120/minute); a long agent session may briefly pause and retry. That's normal.

See the tool reference for what's available, the prompt cookbook for example prompts, security and permissions for what an agent can and can't do, and troubleshooting if the connection fails.