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 pageOverviewSign 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:

MethodUse it forWhat the app acts as
Sign in (OAuth)ChatGPT, Claude, Claude Code and other apps that support sign-inYou, with your role, in the workspace you pick
API key in a headerCursor, Gemini CLI, Claude Code and most other clientsThe workspace, with admin access
API key in the URLApps that only take a URL and can't sign inThe workspace, with admin access

Sign in with ChatGPT, Claude or Claude Code

  1. In your AI app, add a custom connector (MCP server) with the address https://your-postline-address/api/mcp.
  2. The app sends you to Postline. Sign in if you aren't already.
  3. 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

ToolWhat it does
list_channelsLists channels with ids, networks, character limits and posting times
get_channel_settingsShows the per-post settings a channel accepts, such as a YouTube title or Pinterest board
list_postsLists posts in a time range
get_postGets one post with per-channel status, links and engagement
create_postCreates a post. Saves a draft unless asked to schedule or publish. Without a date, it takes the next free posting time
update_postChanges a post that hasn't been published. Only the fields passed change
delete_postDeletes a post. Published copies stay on the networks
find_next_slotFinds the next free posting time for channels
import_media_from_urlDownloads an image or video from a public URL into the media library
list_mediaLists recent files in the media library
list_templatesLists saved post templates
get_analyticsSummarizes publishing and engagement over the last N days
create_preview_linkCreates a client preview link for a post
get_post_statsEngagement for one post on each channel, plugs that ran, and link clicks
get_channel_statsFollower history and engagement totals for one channel
list_groupsLists client groups and their channels
list_setsLists saved channel sets
list_networksLists 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.