MCP for AI agents
Connect an AI agent (MCP)
PostNinja runs a remote MCP server. Connect your AI agent once and it can see your accounts, write and schedule posts to X, Instagram, Threads, Facebook, TikTok, YouTube and Pinterest, handle approvals, read analytics and answer comments and direct messages, with 19 tools.
Server details
| Endpoint | https://postninja.app/api/mcp |
| Transport | Streamable HTTP, stateless (POST). Works with 2025 and 2026 MCP clients. |
| Sign-in | OAuth 2.1 (apps that sign in), or Authorization: Bearer pn_… with an API key |
| Tools | 19: see MCP tools |
| Rate limit | 120 requests a minute per API key, or per app and person |
Sign in or use an API key
| Sign in (OAuth) | API key | |
|---|---|---|
| Used by | ChatGPT, Claude.ai and Claude Desktop connectors, the Gemini and Grok apps | Claude Code, Cursor, VS Code, Windsurf, Codex, Gemini CLI, n8n, SDKs and scripts |
| Setup | Paste the server URL, log in, click Allow | Create a key under Settings → API, add it as a header |
| Acts as | You, with your role in the workspace | An admin of the workspace |
| Access | What you allow: posts:read, or posts:read and posts:write | Read & write, or Read only; optionally limited to some profiles |
| Disconnect | Settings → API → Connected apps | Revoke the key under Settings → API |
Permissions
posts:readlets an app use the read tools:list_accounts,get_workspace,list_profiles,list_templates,list_posts,get_post,get_queue,get_analytics,list_comments,list_messages.posts:writeis needed for tools that change something:create_post,update_post,delete_post,approve_post,request_changes,update_queue,reply_to_comment,reply_to_message,upload_image. An app that only hasposts:readgets an error asking you to reconnect and allow changes.- Read only API keys can call every read tool; tools that change something return an error saying the key can only read.
- Keys limited to some profiles (Pro and Agency) only see and post to those profiles' accounts, and can only change those profiles' queues.
- Roles still apply to apps that sign in. When approvals are on, a member's posts wait for approval (
awaiting_approval), and only owners and admins can approve, ask for changes or change the queue. API keys act as admins, so their posts are scheduled straight away. - Members whose access is limited to some profiles can't connect apps; ask a workspace admin for a limited API key instead.
Connect your agent
Replace pn_YOUR_KEY with a key from Settings → API, or keep it in an environment variable (POSTNINJA_API_KEY) where the client supports that. After connecting, ask your agent "List my connected accounts" to check it works.
Jump to: Claude Desktop · ChatGPT · Claude Code · Cursor · OpenAI Codex · VS Code · Windsurf · Gemini · Gemini CLI · Grok · DeepSeek · OpenClaw · Cline · Zed · n8n · OpenAI Agents SDK · Claude Agent SDK · Goose · Any MCP client
Claude Desktop
Add PostNinja as a custom connector and sign in; no API key needed. This works in the desktop app and on claude.ai. Prefer an API key? Use the config file instead (second box).
- In Claude, open Customize → Connectors and click Add custom connector.
- Name it PostNinja and paste the server URL below.
- Click Add, then Connect. Log in to PostNinja and click Allow.
Note: The API key route uses the mcp-remote bridge, which needs Node.js 18 or newer. Quit Claude completely and reopen it after editing the file.
The header is written without a space (Authorization:${AUTH_HEADER}) on purpose: it avoids a known bug with spaces in arguments on Windows.
Example prompts and answers to common questions: Claude Desktop guide.
ChatGPT
Sign in, no API key. In ChatGPT on the web, with developer mode on (Plus, Pro, Business, Enterprise or Edu):
- Open Settings → Security and login and turn on Developer mode.
- Go to chatgpt.com/plugins, click +, then Create MCP App.
- Name it PostNinja and paste the server URL below as the connection.
- Click Create, then Connect. Log in to PostNinja and click Allow.
- In a chat, pick PostNinja from the + menu and ask away.
Note: We're submitting PostNinja to ChatGPT's app directory. Once it's listed, you'll be able to add it in one click without developer mode.
ChatGPT asks before each action that changes something, like scheduling a post.
Example prompts and answers to common questions: ChatGPT guide.
Claude Code
Run this in your terminal. Add --scope user to make it available in every project.
Example prompts and answers to common questions: Claude Code guide.
Cursor
Add PostNinja to your MCP config, for this project or for every project.
Note: Set POSTNINJA_API_KEY in your environment, or paste the key in place of ${env:POSTNINJA_API_KEY}.
Example prompts and answers to common questions: Cursor guide.
OpenAI Codex
Set the key in your shell, then add the server with one command:
Note: POSTNINJA_API_KEY must be set in the shell that starts Codex.
Example prompts and answers to common questions: OpenAI Codex guide.
VS Code
Add this to your workspace's .vscode/mcp.json, or run MCP: Open User Configuration to make it global. VS Code asks for the key the first time.
Note: The top-level key is "servers" in VS Code, not "mcpServers".
Example prompts and answers to common questions: VS Code guide.
Windsurf
In the Cascade panel, open the … menu, go to MCPs and click the icon to open the MCP config file. Add PostNinja:
Note: Windsurf uses "serverUrl" (not "url") for remote servers. Windsurf was renamed Devin Desktop in 2026; the setup is the same.
Example prompts and answers to common questions: Windsurf guide.
Gemini
In the Gemini app, add PostNinja as a custom app and sign in. Building your own agent? Pass PostNinja to the Gemini API as an MCP server instead (code below).
- On gemini.google.com, open Settings → Connected Apps → Custom apps.
- Click Add a custom app and paste the server URL from the first box below.
- Log in to PostNinja when asked and click Allow.
Note: MCP in the Interactions API is in preview, and the SDK's MCP support is experimental, so details may change.
Custom apps in the Gemini app are for personal Google accounts, 18 and over, in the US, in English, with Keep Activity on.
Example prompts and answers to common questions: Gemini guide.
Gemini CLI
Run this once:
Note: Use "httpUrl" (not "url", which means the older SSE transport). Gemini CLI doesn't expand environment variables in headers, so paste the key itself.
Example prompts and answers to common questions: Gemini CLI guide.
Grok
In the Grok app, add PostNinja as a custom connector and sign in. In Grok Bot, add it as a custom MCP server with an API key. From code, pass it to the xAI API.
- On grok.com, go to Connectors → New Connector → Custom.
- Paste the server URL from the first box below.
- Log in to PostNinja when asked and click Allow.
Note: Grok Bot is in beta, so its plugin settings may move. Servers you've set up in the Cursor editor aren't carried over to Grok Bot automatically.
The xAI API runs the MCP calls on xAI's servers, so your PostNinja address must be public.
Example prompts and answers to common questions: Grok guide.
DeepSeek
For example, run Claude Code on DeepSeek's Anthropic-compatible API, then add PostNinja:
Note: The DeepSeek chat app can't connect to MCP servers. Use one of the agents DeepSeek lists under Agent integrations in its API docs.
Prefer a chat-app agent? OpenClaw also runs DeepSeek models and connects to PostNinja; see the OpenClaw guide.
Example prompts and answers to common questions: DeepSeek guide.
OpenClaw
Add PostNinja to OpenClaw from the CLI, then check the connection:
Note: Use OpenClaw 2026.5.12 or later: older versions could forward custom headers, like your API key, across a redirect.
openclaw mcp doctor warns about keys written straight into the config; OpenClaw's secret settings keep it out of the file.
Example prompts and answers to common questions: OpenClaw guide.
Cline
Click the MCP Servers icon in Cline, choose Configure → Configure MCP Servers, and add:
Note: Set "type": "streamableHttp" explicitly. The Remote Servers form has no headers field, so edit the JSON.
Example prompts and answers to common questions: Cline guide.
Zed
Open Settings → AI → MCP Servers → Add Remote Server, or add this to settings.json:
Note: With the Authorization header, Zed connects with your API key. Leave it out and Zed can sign in with OAuth instead, if your Zed version supports it.
Example prompts and answers to common questions: Zed guide.
n8n
In your workflow, add an AI Agent node, then add the MCP Client Tool sub-node with these settings:
Note: Use a recent n8n version: older MCP Client Tool versions only spoke SSE. You can also call the REST API from an HTTP Request node.
Example prompts and answers to common questions: n8n guide.
OpenAI Agents SDK
Install openai-agents, set POSTNINJA_API_KEY, and connect over Streamable HTTP:
Example prompts and answers to common questions: OpenAI Agents SDK guide.
Claude Agent SDK
Add the server to your query options and allow its tools:
Note: Without allowedTools: ["mcp__postninja__*"], the agent sees the tools but isn't allowed to call them.
Example prompts and answers to common questions: Claude Agent SDK guide.
Goose
Run goose configure → Add Extension → Remote Extension (Streamable HTTP), or add it to your config file:
Note: Restart Goose after editing the file.
Example prompts and answers to common questions: Goose guide.
Any MCP client
Point your client at the endpoint below. Apps that sign in with OAuth only need the URL; everything else sends an API key as a Bearer token:
Note: Apps that sign in (ChatGPT, Claude.ai, the Gemini and Grok apps) use OAuth 2.1 instead of a key: discovery starts at /.well-known/oauth-protected-resource, with dynamic client registration, client ID metadata documents and PKCE.
Example prompts and answers to common questions: Any MCP client guide.
Not available yet
- OpenAI Dots: Dots reach other tools through ChatGPT's apps. PostNinja already works as a ChatGPT app you add yourself; Dots will pick it up once it's listed in ChatGPT's app directory, which we've applied for. Until then, use it in ChatGPT directly.
OAuth details for client developers
Building your own MCP client? PostNinja follows the MCP authorization spec. A request without a valid token gets 401 with a WWW-Authenticate: Bearer resource_metadata="…" header pointing at the protected resource metadata. From there:
| What | Where |
|---|---|
| Protected resource metadata (RFC 9728) | https://postninja.app/.well-known/oauth-protected-resource (also …/oauth-protected-resource/api/mcp) |
| Authorization server metadata (RFC 8414) | https://postninja.app/.well-known/oauth-authorization-server (also …/oauth-authorization-server/api/auth) |
| OpenID configuration | https://postninja.app/.well-known/openid-configuration |
| Issuer | https://postninja.app/api/auth |
| Resource (token audience) | https://postninja.app/api/mcp |
| Scopes | posts:read, posts:write, plus offline_access for refresh tokens |
| Client registration | Dynamic client registration (RFC 7591), or a client ID metadata document (your client_id is an https URL) |
| Flow | Authorization code with PKCE. The person logs in and approves your app on a consent page. |
Access tokens are JWTs tied to one workspace. They stop working as soon as the person disconnects the app, leaves the workspace or is suspended. A tool that needs more access answers with an error whose _meta carries a WWW-Authenticate challenge with error="insufficient_scope".
What the server tells your agent
MCP clients receive these instructions when they connect, so your agent already knows the basics:
Errors
- Mistakes the agent can fix (text too long, a missing photo, a time in the past, not enough credits) come back as tool results with
isError: trueand a message written for people. Good agents read it and try again. - A missing, revoked or expired key or token gets HTTP
401. Too many requests get HTTP429with aRetry-Afterheader.