A Model Context Protocol server for the Meta Threads API. Gives Claude (or any MCP client) full read/write access to Threads — post analytics, content publishing, thread chaining, webhook events, and dual-account management.
Built for use with ideAI as a cross-platform content strategy tool, but works standalone with any MCP-compatible client.
- 15 MCP tools covering the full Threads API surface
- Dual account support — manage a primary and mirror/brand account from one server
- Thread chaining — publish multi-post threads with a single tool call
- Webhook events — real-time mentions, replies, and post notifications via ngrok
- Polling — detect new posts since last check for cross-account workflows
- Daily digest — aggregated insights for both accounts in one call
- Batch insights — engagement metrics across your recent posts
| Tool | Description |
|---|---|
threads_list_accounts |
List configured accounts |
threads_get_profile |
Profile info (username, bio, verification) |
threads_get_posts |
Recent posts with text, media, timestamps |
threads_get_post_insights |
Single post metrics: views, likes, replies, reposts, quotes |
threads_batch_insights |
Bulk engagement metrics for N recent posts |
threads_get_account_insights |
Account-level metrics over day/week/28 days |
threads_get_replies |
Replies to a specific post |
threads_get_my_replies |
Your replies to other posts |
threads_create_post |
Publish text, image, or video posts |
threads_create_thread |
Publish a reply chain (thread) from an array of texts |
threads_publishing_limit |
Check remaining publishing quota (250/24h) |
threads_get_events |
Read webhook events (mentions, replies) |
threads_setup_webhooks |
Register webhook subscriptions with Meta |
threads_poll_account |
Fetch only new posts since last poll |
threads_daily_digest |
Full digest: insights, top posts, events, quota |
All tools that interact with an account accept an optional account parameter ("primary" or "mirror", defaults to "primary").
- Node.js 20+
- A Meta Developer App with Threads API enabled
- ngrok (free tier works) for OAuth callback and webhooks
git clone https://github.com/svetimfm/threads-mcp-server.git
cd threads-mcp-server
npm installcp .env.example .envEdit .env with your Meta app credentials:
THREADS_APP_ID=your_app_id
THREADS_APP_SECRET=your_app_secret
THREADS_REDIRECT_URI=https://your-domain.ngrok-free.app/callback
Start ngrok pointing at port 3001:
ngrok http 3001 --domain=your-domain.ngrok-free.appThen authenticate your primary account:
npm run auth:primaryThis opens your browser for OAuth, exchanges for a long-lived token (60 days), and saves it to .env.
For a second account:
npm run auth:mirrornpm run buildClaude Code — add to ~/.claude.json:
{
"mcpServers": {
"threads": {
"command": "node",
"args": ["/path/to/threads-mcp-server/dist/index.js"]
}
}
}Claude Desktop / Cowork — add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"threads": {
"command": "node",
"args": ["/path/to/threads-mcp-server/dist/index.js"]
}
}
}For real-time event monitoring, point ngrok at port 3002:
ngrok http 3002 --domain=your-domain.ngrok-free.appThen use the threads_setup_webhooks tool from Claude to register with Meta.
src/
├── index.ts # MCP server — 15 tool registrations, stdio transport
├── threads-api.ts # Threads API client (all HTTP calls)
├── accounts.ts # Dual account config loader + API factory
├── auth.ts # OAuth flow (short-lived → long-lived token)
├── state.ts # Persistent state (~/.threads-mcp-state.json)
└── webhook-server.ts # HTTP server for Meta webhook events (port 3002)
The server runs two transports simultaneously:
- stdio for MCP communication with Claude
- HTTP on port 3002 for Meta webhook delivery (gracefully skipped if port is busy)
The OAuth flow requests these Threads API scopes:
threads_basic— profile accessthreads_content_publish— post creationthreads_manage_insights— analyticsthreads_read_replies— read repliesthreads_manage_replies— manage repliesthreads_manage_mentions— mention monitoringthreads_keyword_search— keyword search
- Content strategy — pull engagement data, identify what performs, plan content
- Dual-account workflows — primary posts, mirror account reacts/amplifies
- Scheduled digests — daily summary via Cowork's scheduler or cron
- Thread publishing — draft multi-part threads in conversation, publish in one call
- Engagement monitoring — webhooks for real-time mention/reply alerts
This server is designed to work alongside the ideAI MCP connector. When both are connected to Claude, you can cross-reference your Threads engagement with your personal knowledge graph, notes, and behavioral data to build data-driven content strategies grounded in your actual thinking.
MIT