MCP and AI agents
Connect ChatGPT, Claude, Claude Code, Cursor, Gemini CLI and other AI agents to Postline with MCP, or use the Postline skill for Codex and OpenClaw.
On this page
OverviewSign in with ChatGPT, Claude or Claude CodeConnect with an API key in a headerConnect with an API key in the URLToolsConnected appsThe Postline skill (Codex, OpenClaw and other command-line agents)Overview
Postline runs an MCP server at:
https://your-postline-address/api/mcp
With it, AI apps can list channels, draft, schedule and edit posts, import media and read analytics in your workspace. You find these addresses, with your server's real address filled in, in Settings → API → Connect an AI agent (MCP).
There are three ways to connect:
| Method | Use it for | What the app acts as |
|---|---|---|
| Sign in (OAuth) | ChatGPT, Claude, Claude Code and other apps that support sign-in | You, with your role, in the workspace you pick |
| API key in a header | Cursor, Gemini CLI, Claude Code and most other clients | The workspace, with admin access |
| API key in the URL | Apps that only take a URL and can't sign in | The workspace, with admin access |
Sign in with ChatGPT, Claude or Claude Code
- In your AI app, add a custom connector (MCP server) with the address
https://your-postline-address/api/mcp. - The app sends you to Postline. Sign in if you aren't already.
- Pick the workspace the app may use and allow access.
No API key is needed. The app acts as you, so it can do only what your role allows. If you're an editor in a workspace that requires approval, posts the app schedules wait for approval.
For Claude Code, add the server without a header:
claude mcp add --transport http postline https://your-postline-address/api/mcp
Sign-in needs Postline to run on an https address. If your server doesn't, use an API key instead.
Connect with an API key in a header
Create a key in Settings → API (see REST API). Then add Postline to your client's MCP settings. For Cursor, Gemini CLI and other clients that use this format:
{
"mcpServers": {
"postline": {
"type": "http",
"url": "https://your-postline-address/api/mcp",
"headers": { "Authorization": "Bearer pl_..." }
}
}
}
For Claude Code:
claude mcp add --transport http postline https://your-postline-address/api/mcp \
--header "Authorization: Bearer pl_..."
Connect with an API key in the URL
If an app only takes a URL and can't sign in, put the key in the address and use no authentication:
https://your-postline-address/api/mcp/k/pl_...
Anyone with this URL can use the key. Keep it private, and revoke the key in Settings → API if it leaks.
Tools
| Tool | What it does |
|---|---|
list_channels | Lists channels with ids, networks, character limits and posting times |
get_channel_settings | Shows the per-post settings a channel accepts, such as a YouTube title or Pinterest board |
list_posts | Lists posts in a time range |
get_post | Gets one post with per-channel status, links and engagement |
create_post | Creates a post. Saves a draft unless asked to schedule or publish. Without a date, it takes the next free posting time |
update_post | Changes a post that hasn't been published. Only the fields passed change |
delete_post | Deletes a post. Published copies stay on the networks |
find_next_slot | Finds the next free posting time for channels |
import_media_from_url | Downloads an image or video from a public URL into the media library |
list_media | Lists recent files in the media library |
list_templates | Lists saved post templates |
get_analytics | Summarizes publishing and engagement over the last N days |
create_preview_link | Creates a client preview link for a post |
get_post_stats | Engagement for one post on each channel, plugs that ran, and link clicks |
get_channel_stats | Follower history and engagement totals for one channel |
list_groups | Lists client groups and their channels |
list_sets | Lists saved channel sets |
list_networks | Lists the networks Postline can publish to, with limits |
Times are ISO 8601. The server tells the app your workspace's time zone. The in-app assistant uses the same tools.
The MCP server allows 120 requests per minute.
Connected apps
Apps you signed in to are listed in Settings → Account → Connected apps, with the workspace each one uses and when it was last used. Choose Disconnect to remove an app's access.
A sign-in lasts 30 days without use before the app must sign in again. If you leave the workspace, the app loses access to it.
The Postline skill (Codex, OpenClaw and other command-line agents)
Agents that run shell commands can use the Postline skill instead of MCP. It calls the REST API with curl.
npx skills add shekhar9837/postline
export POSTLINE_URL=https://your-postline-address
export POSTLINE_API_KEY=pl_...
The skill tells the agent to save drafts first, check channel limits, use the next free posting time when you don't give one, and never invent facts or links.