# Agent setup

Connect an AI assistant to Postaki so it can prepare posts for you. The server address is the same everywhere:

```text
https://app.postaki.io/mcp
```

The assistant can read your brands and channels, check posts against each platform's rules, upload media and create
posts, and send them for approval. It cannot approve or publish: you do that in Postaki. See the
[MCP tool reference](https://postaki.io/docs/mcp-tools/) for the tools.

Before you start: your workspace needs a plan that includes the API (the beta plan does), and you need a Postaki account
that is a member of that workspace. Menu names in other companies' apps change often; if a label below differs, look
for the place where the app adds a custom MCP server or connector.

## Which sign-in does each assistant use

| Assistant | Sign-in |
|---|---|
| Claude.ai, Claude Desktop and the Claude apps | OAuth: you sign in to Postaki when you add the connector |
| Claude Code | OAuth, or an API key in a header |
| ChatGPT | OAuth only (ChatGPT does not accept API keys) |
| Cursor | OAuth, or an API key in a header |
| Anything else that speaks MCP over HTTP | OAuth, or an API key as `Authorization: Bearer` |

With OAuth you are sent to Postaki to sign in, choose the workspace to give access to and see what the assistant may do.
You can disconnect it at any time under Settings, "For developers", "API keys and webhooks", "Connected apps". With an API key, make the key
under Settings, "For developers", "API keys and webhooks", "API keys" (see [Authentication](https://postaki.io/docs/authentication/)).

## Claude.ai, Claude Desktop and the Claude apps

Add Postaki as a custom connector, by its address.

1. In Claude, open the connector settings and add a custom connector.
2. Paste `https://app.postaki.io/mcp` and confirm.
3. Claude sends you to Postaki. Sign in, choose the workspace, and allow `read` and `write`.
4. Back in Claude, start a chat and ask, for example: "Look at my Postaki brands and prepare a post for Friday about
   our new opening hours, then send it for approval."

On a Team or Enterprise plan the organisation's owner adds the connector, and each member then connects with their own
Postaki account. Plans differ in how many custom connectors they allow (the free plan allows one).

## Claude Code

With an API key (`POSTAKI_API_KEY` holds your key):

```bash
claude mcp add --transport http postaki https://app.postaki.io/mcp \
  --header "Authorization: Bearer $POSTAKI_API_KEY"
```

Or with OAuth, add the server without the header and let Claude Code walk you through the sign-in:

```bash
claude mcp add --transport http postaki https://app.postaki.io/mcp
```

Check it with `claude mcp list`. Use the HTTP transport (Streamable HTTP).

## ChatGPT

ChatGPT connects to Postaki with OAuth, from its settings for custom MCP servers (apps). Add `https://app.postaki.io/mcp`,
sign in to Postaki when asked, and choose the workspace.

Your ChatGPT plan decides what ChatGPT may do with it. On Pro, custom MCP servers are read-only: ChatGPT can look at
brands, channels and posts but cannot create posts. Creating posts works on the plans that allow write actions for custom
MCP servers (Business, Enterprise and Edu). See [ChatGPT and your plan](https://postaki.io/docs/chatgpt-plans/).

ChatGPT asks you to confirm actions that change something. Postaki marks every tool as read-only or not, so ChatGPT
knows which is which.

## Cursor

Add Postaki to `mcp.json` (the project's `.cursor/mcp.json`, or the global one), with an API key from the environment:

```json
{
  "mcpServers": {
    "postaki": {
      "url": "https://app.postaki.io/mcp",
      "headers": { "Authorization": "Bearer ${env:POSTAKI_API_KEY}" }
    }
  }
}
```

Or leave `headers` out and Cursor starts the OAuth sign-in. Cursor asks for approval before a tool runs unless you have
turned that off.

## Other clients

Any client that supports remote MCP servers over Streamable HTTP can connect: give it the address, and either let it
use OAuth (it discovers everything from `https://app.postaki.io/.well-known/oauth-protected-resource/mcp`) or send
`Authorization: Bearer <API key>` on every request.

## What to tell the assistant

The server's own instructions already say this, but it helps to repeat it in your own words:

- Every post needs your approval in Postaki, and the assistant cannot give it. It should say "waiting for approval" and
  give you the link, never "published".
- `ai_generated` must be honest: true if the text or media was written or changed by AI.
- Ask it to check a post first (`postaki_validate_post`) and to read a TikTok account's own options before posting.

## If something does not work

- 401 or "sign in again": the key was revoked, the app was disconnected, or you were removed from the workspace.
- 403 `api_not_in_plan`: the workspace's plan does not include the API.
- Writes refused on ChatGPT Pro: see [ChatGPT and your plan](https://postaki.io/docs/chatgpt-plans/).
- Too many requests: see [Rate limits](https://postaki.io/docs/rate-limits/).
