# Connect Cursor to Mastodon

Source: https://postgale.com/guides/cursor/mastodon

Yes, Cursor can post to Mastodon through Postgale. Add https://postgale.com/mcp to Cursor’s mcp.json and sign in to Postgale when Cursor asks (or use an API key header), connect your Mastodon account in Postgale once, and Cursor can statuses on any server with media, alt text, content warnings and threads. A person can be required to approve every post, reply and message before it goes out.

## Can Cursor post to Mastodon?

Postgale is the secure layer for AI agents on social media. MCP (Model Context Protocol) is the open standard that lets AI assistants such as Claude and Cursor use outside tools. An MCP server is what they connect to. Cursor does not reach Mastodon on its own; with Postgale connected it gets tools for the Mastodon accounts you connected and nothing else.

| Task | What Postgale does |
| --- | --- |
| Publish | Statuses within your server’s character limit; up to 4 images (or your server’s maximum) or one video with alt text; content warnings; public, unlisted, followers-only or direct visibility; language; scheduling. |
| Threads and replies | A thread of up to 25 statuses in one request, or a reply to a status on your server. |
| Delete | Remove a status it published. |

## What do you need?

- A Mastodon account on any server (mastodon.social, hachyderm.io, your own instance...).
- A Postgale workspace, and a sign-in or an API key for the agent.
- Optional images or a video on a public HTTPS URL (upload them with `upload_media`).
- Cursor, set up as below (Cursor’s agent with MCP).

## Step 1: connect your Mastodon account

1. Create a Postgale workspace and open Dashboard → Accounts → Mastodon.
2. Enter your server’s domain (for @you@hachyderm.io that is hachyderm.io), sign in there and approve Postgale.
3. Connect your AI tool: add `https://postgale.com/mcp` in [ChatGPT](https://postgale.com/guides/chatgpt), [Claude](https://postgale.com/guides/claude) or [Cursor](https://postgale.com/guides/cursor) and sign in to Postgale, or create a key under Dashboard → API keys for [n8n](https://postgale.com/guides/n8n) or your own code.
4. Ask the agent for a draft first. Turn on approval in the dashboard if a person should sign off before anything goes live.

An agent can also start the connection itself: the `connect_account` tool (or `GET /api/v1/connect/mastodon?instance=your.server`) returns a sign-in link that is valid for 10 minutes and that the account owner opens in a browser. The agent never sees the password or the token.

## Step 2: connect Cursor to Postgale

1. Create a Postgale workspace and connect the social accounts the agent may use under Dashboard → Accounts.
2. In Cursor, open Settings → MCP and add a server, or edit `.cursor/mcp.json` in the project (or `~/.cursor/mcp.json` for every project). The URL alone is enough:

.cursor/mcp.json:
```json
{
  "mcpServers": {
    "postgale": {
      "url": "https://postgale.com/mcp"
    }
  }
}
```

1. Cursor shows a sign-in prompt for the server. A Postgale page opens in the browser: sign in, pick the workspace the app may use and approve. The consent page names the app and where it returns to; approve only requests you started yourself.
2. Cursor lists the Postgale tools under the server once it connects; enable them for the agent.
3. In the agent chat, ask: “Which social accounts are connected in Postgale?” to check the connection.

## Can I use an API key instead?

Yes, for shared or automated setups where nobody should sign in personally. In Postgale, open Dashboard → API keys, create a key and copy it (it starts with `sk_` and is shown once). Connect the social accounts the agent may use under Dashboard → Accounts. Then add a headers block:

.cursor/mcp.json (API key):
```json
{
  "mcpServers": {
    "postgale": {
      "url": "https://postgale.com/mcp",
      "headers": {
        "Authorization": "Bearer sk_…"
      }
    }
  }
}
```

> Keep the key out of version control: use the global file, or an environment variable if your Cursor version supports `${env:…}` in mcp.json.

## What can I ask Cursor to do on Mastodon?

Check the connection first: “Which Mastodon accounts are connected in Postgale?” Then, in plain language:

> Ask your agent: “Post this release note to our Mastodon account with the content warning “release notes”.”

> Ask your agent: “Write alt text for this image and post it to Mastodon with the caption from the brief.”

> Ask your agent: “Turn these notes into a short Mastodon thread, as drafts.”

POST /api/v1/posts (Mastodon):
```json
{
  "content": "Release 2.4 is out: faster sync and dark mode. https://example.com/changelog",
  "platforms": [
    {
      "accountId": "acc_masto",
      "platformSpecificData": {
        "mediaUrl": "https://media.example.com/screenshot.png",
        "altText": "The new dashboard in dark mode",
        "visibility": "unlisted",
        "language": "en"
      }
    }
  ],
  "publishNow": true
}
```

## Which Mastodon rules does Postgale enforce?

- Text is counted the way your server counts it (links as 23 characters, remote mentions by username, content warnings included) against your server’s limit, usually 500.
- Media is uploaded with its alt text and the status waits until your server has processed it.
- Every status carries an idempotency key, so a retried request never posts twice.
- If you revoke Postgale under Authorized apps, the account is marked as needing reconnection and your webhook hears about it.
- When your server asks to slow down, Postgale waits until its limit resets before retrying.

## How do I keep a person in the loop?

- Approval: tick “Hold posts from this app for approval” when you sign in, or in the Postgale dashboard require approval for the API key the agent uses (or for the whole workspace, or one account). Posts then wait as pending approval; comment replies and moderation, direct messages, WhatsApp sends and edits to live posts wait in the same queue. A person approves, edits or rejects each one in Dashboard → Approvals; the agent’s own key or sign-in cannot approve.
- Tool annotations: every Postgale tool declares whether it only reads, writes, or publishes live, deletes or spends. Clients that honour annotations ask before destructive tools run.
- Audit log: every write the agent makes is recorded with the key or the connected app, the action and the time.
- Revoking: each sign-in appears under Dashboard → Connected apps and each key under Dashboard → API keys; either can be revoked at any time.

## What can’t an agent do on Mastodon through Postgale?

- Edit a status (not supported yet); delete and post again instead.
- Read favourites, boosts or replies yet.
- Create polls.

## Questions

### Can Cursor post to Mastodon?

Yes, Cursor can post to Mastodon through Postgale. Add https://postgale.com/mcp to Cursor’s mcp.json and sign in to Postgale when Cursor asks (or use an API key header), connect your Mastodon account in Postgale once, and Cursor can statuses on any server with media, alt text, content warnings and threads. A person can be required to approve every post, reply and message before it goes out.

### Does Cursor see my Mastodon password or tokens?

No. The account owner signs in on their Mastodon server’s own page once, and Postgale stores the resulting tokens encrypted. Cursor only holds a Postgale API key or sign-in, which you can revoke at any time.

### Can I approve what Cursor sends to Mastodon before it goes live?

Yes. Turn on approval for the API key it uses, the account or the whole workspace. Posts, replies and messages then wait in the Postgale dashboard until a person approves, edits or rejects them; Cursor’s own access cannot approve.

### Can Cursor schedule Mastodon posts?

Yes. Ask for a date and time; Postgale stores the post as scheduled and publishes it then, and reports the result (post.published or post.failed) on your webhook and in get_post.

## Related

- [Cursor guide](https://postgale.com/guides/cursor)
- [Mastodon for AI agents](https://postgale.com/integrations/mastodon)
- [Cursor and Instagram](https://postgale.com/guides/cursor/instagram)
- [Cursor and Facebook](https://postgale.com/guides/cursor/facebook)
