MCP (streamable HTTP) via MCPServerStreamableHttp · LinkedIn

An OpenAI Agents SDK agent that drafts for LinkedIn

Teams building internal assistants with the OpenAI Agents SDK often get the same request: can it also write the LinkedIn post? Adding a LinkedIn specialist agent is straightforward, and connecting it to SocialHandoff keeps it safe. The agent can read brand memory, draft, and schedule, but it cannot approve. Your sales or marketing lead signs off in the inbox, and the audit log shows which agent wrote what.

Prompt

Instructions for the linkedin_writer agent: when handed a webinar record (title, date, speakers, 3 takeaways), write a LinkedIn post inviting operations managers to register. Around 120 words, name the speakers, include the date and timezone, end with the registration link. Call get_brand_memory first, then draft_post with networks ['linkedin'] and schedule_post for 7 days before the event at 09:00.

How to do it

  1. Mint a key Create a key with draft and schedule permissions, scoped to LinkedIn.
  2. Connect Open MCPServerStreamableHttp with url https://app.socialhandoff.com/mcp and an Authorization header in an async context.
  3. Attach to the specialist Pass the server in mcp_servers on linkedin_writer only, and set it as a handoff from your main agent.
  4. Run Run with Runner.run and inspect the trace for the draft_post and schedule_post calls.
  5. Approve The post waits as pending in the inbox until someone approves it.

Example draft

Running a warehouse where every week has a different peak?

On October 16 at 16:00 CET, Maya Okafor and Tom Lindqvist are walking through how they plan labor for weeks they cannot predict.

You will leave with:
A way to forecast from 3 weeks of data instead of 3 years.
A shift template that absorbs a 20% swing without overtime.
The one report they check every morning.

45 minutes, with time for questions. Register here: https://example.com/webinars/peak-planning

Gotchas

  • Pass the timezone to schedule_post. The event time in the post text and the publish time are separate, and both should be checked in review.
  • Line breaks are kept on LinkedIn, but markdown lists are not rendered. Plain lines read cleanest.
  • LinkedIn joins any thread into one post and carries one image. Design the agent's output for a single post.
LinkedIn
  • Character limit: 3,000 characters for a post. The feed shows the first few lines and hides the rest behind a see more link.
  • Media per post: LinkedIn allows multi-image posts, documents, and video. SocialHandoff publishes 1 image per post.
  • Alt text: Supported on images through the API's alt text field. Not available for video or documents.
  • Threads: LinkedIn has no threads. If a draft has several parts, SocialHandoff joins them into one post.
A LinkedIn post scheduler that waits for your approval

Frequently asked questions

Can the agent read post analytics?
With the analytics permission, get_insights returns per-post metrics where LinkedIn provides them. Best-time suggestions are labeled heuristics.
What stops the agent from spamming drafts?
Per-account daily limits, duplicate protection, and your instructions. The inbox shows every draft, and you can revoke the key at any time.

Let your agents post. Keep the final say.

Connect your first agent in minutes. Every draft waits in your inbox until you approve it.

14 days free. No card required.

The hosted version is opening soon

Leave your email and we will send one message when hosted accounts open, with your 14-day trial ready. Want it today? Self-host it free from the repo.

Start free trial