How to connect Claude to Instagram with an MCP server
Connect Claude, Codex, or Cursor to Instagram, Facebook, and Pinterest through an MCP server without sharing passwords or risking unreviewed posts.

An MCP server gives AI assistants like Claude, Codex, and Cursor a structured way to prepare Instagram, Facebook, and Pinterest posts without sharing social account passwords or browser cookies. Instead of running brittle browser automation or holding raw OAuth tokens, the assistant calls scoped tools that upload media, check channel formats, preview a schedule, and wait for explicit human confirmation before anything goes live.
This guide shows how the Model Context Protocol fits into an ecommerce social publishing workflow, which guardrails prevent accidental posts, and how to connect an assistant safely.
Why teams avoid raw social tokens in AI agents
Connecting an AI assistant directly to a social network's graph or content API creates three operational problems for an online store:
- Over-broad token exposure. Giving a prompt or local script a long-lived Meta or Pinterest token exposes every connected page, board, and permission in that token's scope.
- No dry-run preview layer. Most raw social platform APIs publish immediately when called, leaving no built-in staging step where an operator checks the crop, caption, or destination account.
- Duplicate posts on retries. Network timeouts and agent tool retries can easily create duplicate posts unless every submission carries an idempotency contract.
Routing the assistant through a dedicated publishing workspace solves all three issues because the workspace holds the encrypted social credentials on the server and exposes only scoped, preview-first tools. You can review the full safety model on the agent workflows overview and in the developer Public API reference.
How the Model Context Protocol works for social publishing
The Model Context Protocol (MCP) standardizes how AI clients discover tools, read structured inputs, and invoke remote capabilities over stdio or Streamable HTTP. Under the MCP authorization specification, remote servers bind access via OAuth 2.1 and Resource Indicators (RFC 8707) so tokens minted for one server cannot be replayed against another endpoint.
When a store connects an assistant to Creavily's MCP endpoint, every call still passes the same validation, brand isolation, and write gates enforced by the developer Public API:
| Layer | Responsibility | What stays protected |
|---|---|---|
| Scoped credential | Identifies the agent and limits allowed actions | Human dashboard cookies and admin settings |
| Brand Publishing Setup | Defines approved accounts, slots, and defaults | Unselected sister brands and unrelated pages |
| Server preview | Checks media formats, captions, and schedule fit | Live social feeds until explicitly confirmed |
| Encrypted server vault | Stores and refreshes platform OAuth tokens | Instagram, Facebook, and Pinterest credentials |
Meta documents the underlying Instagram Content Publishing API requirements for professional accounts, and Pinterest documents board and Pin rules in the Pinterest v5 API reference. Because those provider constraints change by media type and account state, having the MCP server run pre-flight validation before scheduling prevents silent rejections later.
Step-by-step: safe MCP publishing workflow
A reliable agent workflow separates discovery, media intake, previewing, and confirmed scheduling into distinct tool calls.
1. Discover brand and setup context
The assistant starts by calling a read-only context tool (creavily_get_workspace_context) to inspect which brands exist inside the workspace and which Publishing Setups are active. A Publishing Setup is the saved set of social destinations, posting times, and comment rules a brand usually uses. Reading this context prevents an agent from guessing account IDs or posting a skincare product onto a sister brand's account.
2. Import product media from a safe URL
Instead of reading arbitrary files from a user's machine or relying on fragile local file paths, the assistant passes a verified https:// product image URL (creavily_import_media_from_url). The workspace fetches and validates the asset, attaches brand context, and returns a durable media identifier that can be checked against each social network's media rules.
3. Build and inspect a batch preview
Before writing any live job, the assistant calls a preview tool (creavily_preview_publish_batch). This dry-run step evaluates:
- Whether each target account (such as an Instagram Business account, Facebook Page, or Pinterest board) is currently connected and healthy.
- Whether the image dimensions, aspect ratios, and caption lengths fit each destination.
- Which upcoming schedule slots in the brand's Publishing Setup are open without repeating the same product back-to-back.
If a check fails—for example, a disconnected account or missing alt text—the preview returns structured feedback so the assistant or operator can fix the draft without triggering a failed live publish.
4. Require explicit write confirmation and idempotency
Only after the preview passes and the team approves the plan does the assistant invoke the confirmed scheduling call (creavily_create_publish_batch with confirmWrite: true and an idempotency key). Because of the idempotency key, retrying a timed-out request returns the original job record rather than scheduling a second identical post.
If you want to compare this pattern with ChatGPT connector setups, see how to let ChatGPT post to Instagram safely and our overview of what an AI social media manager can and cannot automate.
What to automate vs. keep human-approved
Not every social publishing task carries the same risk. Ecommerce teams get the best speed-to-safety balance when they divide responsibilities clearly:
| Task | Agent via MCP | Human operator |
|---|---|---|
| Discovering brands, Setups, and open calendar slots | Automated | Reviews exceptions |
| Importing product photos and drafting channel captions | Automated | Edits brand voice and claims |
| Checking aspect ratios, caption limits, and readiness | Automated | Resolves account reconnects |
| Confirming live launch posts, pricing, and promos | Waits for confirmation | Approves confirmWrite |
| Reviewing customer replies on pricing or complaints | Drafts replies | Approves before sending |
Claims about discounts, shipping cutoffs, product ingredients, and return policies should always stay behind human confirmation. For deeper guidance on establishing those checkpoints across a store team, read our social media approval process guide.
Monitoring delivery receipts and handling failures
Scheduling a post through MCP is only half the workflow; the assistant or operator also needs confirmation that each social network actually published it. Because social providers return independent responses, one destination can succeed while another needs attention:
- Per-destination receipts: Instagram, Facebook, and Pinterest each record their own delivery state and resulting post ID or permalink in Publishing Activity.
- Signed webhooks: Customer services can subscribe to HMAC-signed webhook updates instead of polling continuously, as covered in our webhooks and TypeScript SDK guide.
- Non-destructive recovery: If an Instagram account token expired before the scheduled time, Facebook and Pinterest still publish as planned while Instagram reports a clear reconnect prompt without duplicating the other channels.
For technical teams wiring up custom integrations alongside MCP, our social media API for ecommerce guide walks through REST payload shapes and retry patterns.
MCP client setup checklist for Claude, Codex, and Cursor
Before connecting an MCP client in production, verify these four configuration boundaries so your assistant stays predictable:
- Transport and endpoint: Point remote HTTP clients at Creavily's hosted Streamable HTTP endpoint (
https://mcp.creavily.com/mcp) using OAuth or anAuthorization: Bearerscoped key, or run the local stdio transport against a verified key in your environment store rather than hardcoding secrets in prompt files. - Minimum key scope: Grant read, media-import, and preview scopes first. Enable scheduling scopes only after your team inspects at least one dry-run batch and confirms the brand's Publishing Setup.
- Human confirmation rule: Keep your client's tool-approval prompt enabled for
creavily_create_publish_batchsoconfirmWrite: truenever fires without an operator reviewing the caption, image crop, and target schedule slots. - Separate test vs. production brands: Run initial agent trials against a dedicated staging or test brand inside your workspace, then switch
brandIdonce media validation and webhook handlers behave as expected.
Documenting these four rules beside your internal team playbook ensures that any developer or marketer adding a new AI assistant inherits the same guardrails.
Key takeaways
- An MCP server lets AI assistants prepare and preview Instagram, Facebook, and Pinterest posts without ever seeing raw social OAuth tokens.
- Keep discovery, media import, dry-run preview, and confirmed scheduling as separate steps guarded by
confirmWriteand idempotency keys. - Use brand-scoped Publishing Setups so assistants only target approved accounts, time zones, and channels for a specific store.
- Always keep pricing claims, promotional copy, and sensitive customer replies behind explicit human review before live delivery.
- Track per-destination receipts or signed webhooks rather than treating an accepted API request as proof of publication.
FAQ
Can Claude or Codex post directly to Instagram using MCP?
Yes, when connected to an MCP server backed by an authorized publishing workspace like Creavily. The assistant prepares media and previews the batch using a scoped credential, while live scheduling still respects your workspace confirmation rules.
Does connecting via MCP expose my Instagram or Meta password?
No. Social accounts connect through official OAuth in the workspace dashboard, and encrypted provider tokens stay on the server. The AI assistant only holds a revocable Creavily credential scoped to permitted actions.
How does MCP prevent duplicate Instagram posts if a tool call retries?
Every confirmed publish request uses an idempotency key tied to the batch. If an AI client retries the same request after a network timeout, the server returns the existing job instead of creating a duplicate post.
Do I need a paid plan to use Creavily's MCP server?
Yes. Public API, webhook, and MCP access are included on paid plans starting at Starter, while the Free plan lets you test manual brand setup and previews first. Check the pricing page for current plan limits.