Using PostEverywhere with Claude
There are three ways to use Claude with PostEverywhere, depending on your use case: MCP for interactive use in Claude Code or Claude Desktop, or the Anthropic API for building your own automated agent.
Option 1: Claude Code (MCP)
Claude Code is Anthropic's CLI tool for agentic coding. With the PostEverywhere MCP server, Claude Code can manage your social media directly from your terminal.
Add this to your Claude Code MCP config:
{
"mcpServers": {
"posteverywhere": {
"command": "npx",
"args": ["-y", "@posteverywhere/mcp"],
"env": {
"POSTEVERYWHERE_API_KEY": "pe_live_..."
}
}
}
}
Then ask Claude to manage your social media in natural language:
"Schedule a LinkedIn post for tomorrow at 9am announcing our Series A funding"
See the full MCP Server setup guide for detailed instructions, troubleshooting, and configuration for other tools.
Option 2: Claude Desktop (MCP)
Claude Desktop supports MCP servers through its configuration file. This lets you manage social media from the Claude chat interface without any coding.
macOS: Edit ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: Edit %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"posteverywhere": {
"command": "npx",
"args": ["-y", "@posteverywhere/mcp"],
"env": {
"POSTEVERYWHERE_API_KEY": "pe_live_..."
}
}
}
}
Restart Claude Desktop after saving. You'll see a tools icon in the chat input indicating the MCP server is connected. Now you can chat with Claude and ask it to schedule posts, check account status, or review publishing results.
Option 3: Claude API (Build Your Own Agent)
Use the Anthropic SDK with tool use to build a custom agent that manages social media automatically. This is ideal for workflows like automated content pipelines, scheduled reporting, or AI-driven social media strategies.
Install Dependencies
npm install @anthropic-ai/sdk posteverywhere
Define PostEverywhere as a Tool
import Anthropic from '@anthropic-ai/sdk';
import { PostEverywhere } from 'posteverywhere';
const anthropic = new Anthropic();
const pe = new PostEverywhere({ apiKey: process.env.POSTEVERYWHERE_API_KEY });
const tools: Anthropic.Tool[] = [
{
name: 'list_accounts',
description: 'List all connected social media accounts',
input_schema: {
type: 'object' as const,
properties: {},
required: [],
},
},
{
name: 'create_post',
description: 'Create and schedule a social media post',
input_schema: {
type: 'object' as const,
properties: {
content: {
type: 'string',
description: 'The post text content',
},
account_ids: {
type: 'array',
items: { type: 'string' },
description: 'Account IDs to post to',
},
schedule_for: {
type: 'string',
description: 'ISO 8601 datetime to schedule the post (optional, publishes immediately if omitted)',
},
},
required: ['content', 'account_ids'],
},
},
];
Handle Tool Calls in a Loop
async function handleToolCall(
name: string,
input: Record<string, any>
): Promise<string> {
switch (name) {
case 'list_accounts': {
const accounts = await pe.accounts.list();
return JSON.stringify(accounts);
}
case 'create_post': {
const post = await pe.posts.create({
content: input.content,
accountIds: input.account_ids,
scheduleFor: input.schedule_for,
});
return JSON.stringify(post);
}
default:
return JSON.stringify({ error: `Unknown tool: ${name}` });
}
}
async function runAgent(userMessage: string) {
const messages: Anthropic.MessageParam[] = [
{ role: 'user', content: userMessage },
];
while (true) {
const response = await anthropic.messages.create({
model: 'claude-sonnet-4-20250514',
max_tokens: 1024,
tools,
messages,
});
// If Claude is done (no more tool calls), return the text
if (response.stop_reason === 'end_turn') {
const textBlock = response.content.find((b) => b.type === 'text');
return textBlock ? textBlock.text : '';
}
// Process tool calls
const assistantContent = response.content;
const toolResults: Anthropic.ToolResultBlockParam[] = [];
for (const block of assistantContent) {
if (block.type === 'tool_use') {
const result = await handleToolCall(
block.name,
block.input as Record<string, any>
);
toolResults.push({
type: 'tool_result',
tool_use_id: block.id,
content: result,
});
}
}
messages.push({ role: 'assistant', content: assistantContent });
messages.push({ role: 'user', content: toolResults });
}
}
Run It
const result = await runAgent(
'List my social accounts, then schedule a post to all active Instagram ' +
'and LinkedIn accounts for tomorrow at 10am saying "Big announcement coming soon!"'
);
console.log(result);
The agent will call list_accounts to discover your connected accounts, filter for active Instagram and LinkedIn accounts, then call create_post with the right account IDs and schedule time.
Example Workflow: A Week of Content
Whether using MCP or the API, Claude can help you plan and schedule an entire week of social media content. Here's an example conversation with Claude via MCP:
You:
Create a week of social media posts for my SaaS product launch. Post to LinkedIn and X every weekday next week at 9am EST. Day 1: teaser, Day 2: problem we solve, Day 3: feature highlight, Day 4: customer quote, Day 5: launch announcement with link to example.com/launch.
Claude:
I'll create 5 posts scheduled across next week. Let me first check your connected accounts...
I found your LinkedIn account (@yourcompany) and X account (@yourcompany). Here's what I've scheduled:
- Mon 9am: "Something big is coming next week. Stay tuned." (LinkedIn + X)
- Tue 9am: "Teams waste 4 hours/week switching between social media platforms..." (LinkedIn + X)
- Wed 9am: "One API call. Eight platforms. Zero context-switching..." (LinkedIn + X)
- Thu 9am: "'PostEverywhere cut our social media publishing time by 80%' — Sarah, Head of Marketing at Acme" (LinkedIn + X)
- Fri 9am: "It's here. PostEverywhere is now live..." (LinkedIn + X)
All 5 posts are scheduled. You can review or edit them in your PostEverywhere dashboard.
Next Steps
- MCP Server Setup — Detailed MCP configuration and troubleshooting
- SDKs & CLI — Node.js SDK and CLI reference
- Create Post API — Full endpoint documentation
- Bulk Schedule — Schedule up to 100 posts at once