# Snapchat MCP server

Add https://pubnio.com/mcp to your agent and it publishes Stories, Saved Stories, and Spotlight videos to Snapchat through two Code Mode tools: `search` reads the API, `execute` runs a short program against it.

## Connect your agent

```sh
claude mcp add --transport http pubnio https://pubnio.com/mcp
codex mcp add pubnio --url https://pubnio.com/mcp && codex mcp login pubnio
```

Sign in with OAuth when the agent asks, and choose the workspace that holds your Snapchat account. Setup for each client: [Claude Code](https://pubnio.com/claude), [Codex](https://pubnio.com/codex), [Cursor](https://pubnio.com/cursor), [OpenCode](https://pubnio.com/opencode), [Grok](https://pubnio.com/grok), [Dots](https://pubnio.com/dots), [Muse Code](https://pubnio.com/muse).

## Rules the agent reads

Before it writes a post, the agent reads the capability catalog. The Snapchat entry lists its placements, media, and caption limits:

```json
{
  "provider": "snapchat",
  "label": "Snapchat",
  "availability": "beta",
  "accountKinds": [
    "social_page"
  ],
  "requiredScopes": [
    "snapchat-profile-api"
  ],
  "placements": [
    {
      "placement": "story",
      "default": true,
      "mediaTypes": [
        "image",
        "video"
      ],
      "maxMedia": 1,
      "captionCharacters": 160
    }
  ]
}
```

## The execute call

Asked "Save the market-day clip to our Snapchat profile as a Saved Story called Market day.", the agent's Code Mode calls run like this:

```text
search   -> find the integrations, create-post, and read-post operations
execute  -> list ready accounts, keep { provider: "snapchat" }
         => { accounts: [ { id: "…", provider: "snapchat" } ] }
execute  -> create the post body below
            Idempotency-Key: snapchat-market-saved
         => 202 { postId, targets: [snapchat/story: queued] }
execute  -> read post, sleep 1s between checks, within the 30s budget
         => { status: "published", url: "…" }
```

```json
{
  "publishNow": true,
  "targets": [
    {
      "accountId": "7f3c2a10-5b4e-4d6f-8a9b-0c1d2e3f4a5b",
      "provider": "snapchat",
      "placement": "story",
      "settings": {
        "contentType": "saved_story",
        "title": "Market day"
      },
      "media": [
        {
          "url": "https://cdn.example.com/market-day.mp4"
        }
      ]
    }
  ]
}
```

Snapchat fetches media from an HTTPS URL, so the program skips the import.

Other requests it handles the same way:

- "Put the behind-the-scenes clip on our Snapchat Story."
- "Submit the latte video to Spotlight with a one-line description."
- "Save the opening-day video as a Saved Story titled Opening day."

## Errors the agent fixes

Validation names the field and says what to change, so the agent fixes the request before anything reaches Snapchat:

| Code | Message |
| --- | --- |
| `settings_conflict` | Add a title for this Snapchat Saved Story. |
| `media_type` | Snapchat Spotlight requires one video. |
| `caption_too_long` | Snapchat Saved Story titles are limited to 45 characters. |

Create answers [422 Invalid publication](https://pubnio.com/docs/problems/invalid-publication/) for these; validate lists them under `errors`.

## Before posting to Snapchat

- The connection requests the `snapchat-profile-api` scope, and the connected account is a profile, the kind PubNio calls a page.
- One item per post: PubNio checks a workspace JPEG or PNG at up to 20 MB, or an MP4 at up to 30 MB.
- `link` attaches a URL, and `locale` takes a code shaped like `en_US`.
- Spotlight accepts video only; a Story or a Saved Story may be a single image instead.

## Limits

- Snapchat is in beta: accounts connect and publish, and behavior may still change.
- One `execute` call runs at most 30 seconds, so a slow job returns the post ID and the next call reads its status.
- Binary files do not stream through `execute`: the agent imports media from an HTTPS URL or sends up to 8 MiB inline.

## Related

- [Snapchat publishing API](https://pubnio.com/platforms/snapchat)
- [Hosted MCP server](https://pubnio.com/agents)
- [All platforms](https://pubnio.com/platforms)

