SDK, CLI and MCP
The TypeScript SDK, JSON-first CLI and MCP server for the Siar social media API: what each does and its status (version 0.1.0, not on npm yet).
Updated
Status: TypeScript SDK, CLI and MCP server (version 0.1.0), built from the same OpenAPI contract. Not on npm yet. Until they are published, call the REST API directly with curl, fetch or requests; every example in these docs works that way. The usage below is what the packages will look like.
All three are generated from or built on the same OpenAPI contract as the API, so they cover the same 270 operations and stay in step with it. They read the API key from SIAR_API_KEY and the API origin from SIAR_API_URL when set.
TypeScript SDK
@siar/sdk has a typed method for every operation (siar.post.create, siar.team.getList, and so on), retries 429, 5xx and network errors on idempotent requests with exponential backoff, picks the right upload flow by size, pages through lists and verifies webhooks.
import { Siar } from '@siar/sdk';
const siar = new Siar({ apiKey: process.env.SIAR_API_KEY });
const post = await siar.post.create({
teamId: 'TEAM_ID',
title: 'Launch day',
postDate: '2026-12-01T01:00:00.000Z',
status: 'SCHEDULED',
socialAccountTypes: ['BLUESKY'],
data: { BLUESKY: { text: 'We shipped today.' } },
});
console.log(post.id, post.status); Errors are thrown as SiarError with statusCode, message, issues and retryAfter. Helpers worth knowing:
siar.paginate(operationId, params): async iterator over every page.siar.uploads.fromFile(pathOrBlob)andsiar.uploads.fromUrl(url).siar.webhooks.constructEvent(rawBody, headers, secret): verify and parse; see webhooks.
CLI
@siar/cli prints JSON on stdout and progress on stderr, so it composes with jq, shell scripts, CI and cron. Exit codes tell a script what happened: 0 ok, 2 usage, 3 auth, 4 not found, 5 validation, 6 rate limited, 7 server or network.
export SIAR_API_KEY=sk_live_...
siar teams:list
siar accounts:list --team TEAM_ID
siar posts:create --team TEAM_ID --networks BLUESKY,MASTODON --text "Shipped" --now
siar posts:get POST_ID
siar help Schedule with --at 2026-10-20T09:00:00Z, save a draft with --draft, and pass network-specific fields with --data @data.json keyed by network. Any operation without a dedicated command is one siar call away:
# Any operation by its operationId
siar call analytics.getPostAnalytics --query '{"postId":"POST_ID","platformType":"INSTAGRAM"}' The package ships a SKILL.md that describes the CLI to agent runtimes.
MCP server
@siar/mcp is a local (stdio) MCP server that lets Claude, Cursor or any MCP client publish, schedule and read analytics with your API key. It is not on npm yet and there is no hosted MCP endpoint, so there is no install command to give here.
Tools: list_teams, create_team, list_social_accounts, get_connect_url, upload_media, create_post, schedule_post, list_posts, get_post, retry_post, delete_post, list_comments, reply_to_comment, get_post_analytics, get_account_analytics, get_usage, get_credit_balance, quote_x_cost and call_operation for everything else.
An agent can do anything its API key can. Start with a draft or a test team while you build confidence. See Siar for AI agents.