HeyMark

Post to social media from Claude Code and Codex

One command connects Claude Code or Codex to HeyMark's MCP server, and your agent can create posts, upload files from your computer, schedule and publish to Instagram, TikTok, LinkedIn, Facebook and YouTube. There's no public REST API: it all runs through the MCP, with OAuth sign-in and a preview you approve before anything is published on the spot.

By HeyMark · Reviewed by Crescente Martinez, CMO and co-founder of HeyMark · Updated

You have a folder with 12 images for a campaign and a file with the captions. You ask your coding agent to build the posts, upload each image and show you the schedule; once you approve, it queues them on Instagram and LinkedIn. That’s what it looks like to post to social media from Claude Code or Codex with HeyMark: the agent works with the files already on your computer and puts everything on your brand’s calendar, without a detour through another app.

The difference from Claude or ChatGPT in the browser is the file. A file on your computer doesn’t reach a remote chat on its own; a coding agent can read it and transfer it to HeyMark.

Connect Claude Code or Codex with one command

For Claude Code:

claude mcp add --transport http heymark https://mcp.heymark.ai

The first time you use it, your browser opens HeyMark so you can approve the access.

For Codex:

codex mcp add heymark --url https://mcp.heymark.ai

If authorization is still pending, run codex mcp login heymark and approve it in the browser. From there, Codex social media posting works the same way as in Claude Code.

There are no keys to generate and no application to register: the server uses OAuth 2.1 with PKCE and dynamic registration, so your client registers itself the first time. To test the connection, ask the agent to list your brands.

How your agent uploads a local file

Uploading an image or a video takes three steps, and your agent chains them together:

  1. Prepare the upload. With the post already created and its destination chosen, the agent asks HeyMark for an upload grant with the file’s type and size (prepare_post_media_upload). HeyMark returns the instructions.
  2. Transfer the file. The agent reads the original on your computer and sends it following those instructions, as a resumable upload. The file never goes through the conversation as text.
  3. Attach it. Once the upload is complete, the agent attaches the file to the post (attach_post_media) and reads the post back to verify it. In a carousel, the files go in order.

Three ways to post to social media from Claude Code or Codex

Generate carousel slides and get the post ready

If your carousels come from a template or a script that renders images, the agent can create them in your repo, build the post, upload them in order and leave it ready to schedule.

Carousel from local files

The folder ./launch-carousel has 6 numbered images and a caption.md file with the copy. Create a HeyMark carousel draft for Instagram with that caption, upload the images in order and read the post back. Show me the caption, the account, the files and their order, and stop before scheduling.

A weekly report in a markdown file

The agent reads the last 7 days (followers, views, engagement and top posts, against the previous period) and writes it into your repo. If you run it every Monday, your social media history is versioned right next to the rest of your work.

Weekly report

Use HeyMark to see how my brand did over the last 7 days: followers, views and engagement per network compared with the previous period, plus the top 3 posts. Write it to reports/week.md with one table per network and three takeaways. If a number is missing, say so instead of estimating it.

A full campaign from a folder, with approval

For a launch: a folder with the files and a sheet with the network, date, time and caption for each piece. The agent creates one draft per row, uploads each file and shows you the full table. It only schedules once you approve, because scheduling runs right away.

Campaign from a folder

The folder ./campaign has images and a plan.csv file with the columns file, network, date, time and caption. Create one HeyMark draft per row, upload its file and show me a table with network, date, time in my time zone, caption and file. Don’t schedule anything until I write “approved”. Then schedule each one and read the dates back to confirm them.

TikTok fits these workflows too, with videos and photo carousels with a title. What the agent can do there is on the TikTok MCP server page.

What asks for approval and what doesn’t

Action What happens
Creating or editing drafts and uploading files Runs right away. It’s still planning content: nothing goes out.
Scheduling Runs right away, and a scheduled post publishes at its time with no further confirmation. Approve the date, time and time zone before you ask.
Publishing now Returns a preview and publishes once you approve it.
Replying to comments or DMs, hiding or deleting comments, changing automations Also go through a preview you approve.

Each approval expires after five minutes and only covers that action: if the caption, account or files change, you need a new preview. If a write ends in an unclear state, the agent should read the current state before retrying, because repeating a create can duplicate the draft. The cap is 60 tool calls a minute.

The guide Publish from a coding agent has the full technical detail, including step by step error recovery. The reference for every tool is in the MCP documentation.

No REST API, and when you need one

HeyMark doesn’t have a public REST API yet. The MCP is the way in and covers both reading and writing, but it’s built for an assistant working with your account and your permissions, not for your product to publish on behalf of your users. If that’s what you’re building, you want a publishing API. We explain the difference in social media MCP vs API and compare developer options in our list of the best social media MCP servers.

If you’d rather work in a chat than a terminal, Claude with HeyMark does the same without commands, except uploading files from your computer.

Frequently asked questions

Can Claude Code post to Instagram?

Yes. With HeyMark connected over MCP, Claude Code creates the post, uploads your local files and schedules or publishes it. Publishing now waits for you to approve a preview.

Do I need an API key to connect Codex?

No. You add the server with codex mcp add and approve access in your browser with your HeyMark account. If authorization is still pending, codex mcp login heymark opens it again.

What happens if a file upload gets cut off?

The agent recovers the upload's position and resumes from there. If the upload grant has expired, it prepares a new one, and an incomplete file is never attached to the post.

How much does it cost?

The MCP costs nothing extra on any HeyMark plan, which starts at $12 USD a month after a 14-day trial. Your Claude Code or Codex subscription is separate.

Does it work with other coding agents?

Yes, with any MCP client that supports OAuth. Use the same URL, https://mcp.heymark.ai, and the client registers itself the first time it connects.

See it on your own accounts.

Connect Instagram, TikTok, Facebook, LinkedIn or YouTube and use HeyMark free for 14 days. Mark answers in your voice, and you approve what goes out.

Keep reading