# Ayrshare — how to use (mcp.ai)

Connect your Ayrshare account and use 3 tools for social media marketing straight from your AI agent. Connect with your own API key. Ayrshare provides a Social Media API that enables developers to programmatically manage and automate social media posts, analytics, and interactions across multiple platforms.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_ayrshare?ms=1787295960000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `ayrshare_create_auto_schedule`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/ayrshare`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/ayrshare/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/ayrshare/create/auto/schedule` — Tool to create a new auto-post schedule with specified times and optional weekday filters. Use when setting up recurring posting plans.
  - body: { title?: string, schedule: string[], daysOfWeek?: integer[] }
- `POST https://api.mcp.ai/api/ayrshare/delete/delete/post` — Tool to delete an Ayrshare post. Use when you need to remove a published or scheduled post by its Ayrshare Post ID, after confirming the correct ID. Note: Instagram and TikTok published posts cannot b
  - body: { id?: string, bulk?: string[], markManualDeleted?: boolean, deleteAllScheduled?: boolean }
- `POST https://api.mcp.ai/api/ayrshare/get/post/history` — Tool to retrieve Ayrshare post history with metrics. Use when you need to fetch and filter past posts by date, status, or record count.
  - body: { limit?: integer, status?: string, endDate?: string, lastDays?: integer, startDate?: string, Profile-Key?: string, lastRecords?: integer }

## Example prompts
- "What can I do in Ayrshare?"
- "Show me a summary of my Ayrshare account"

## More
- Page: https://mcp.ai/ayrshare
- Agent spec (llms.txt): https://mcp.ai/ayrshare/llms.txt
- Postman collection: https://mcp.ai/ayrshare/postman.json
