AI & MCP
Expose LaraPost as a standard remote MCP server so compatible AI clients can inspect publishing context and, with user intent, create or cancel posts.
What the MCP server exposes
| Tool | Purpose | Side effect |
|---|---|---|
get_business_context | Read brand facts, audience, voice, and guidelines | No |
get_capabilities | Read enabled networks and media support | No |
list_accounts | Read connected account metadata without credentials | No |
list_posts | Read publishing history and schedule | No |
create_post | Publish, queue, or schedule content | Yes |
cancel_scheduled_post | Cancel a pending scheduled post | Yes |
1. Install the optional MCP dependency
composer require laravel/mcp:^1.0
2. Enable LaraPost MCP
LARAPOST_MCP_ENABLED=true
LARAPOST_MCP_PATH=/larapost/mcp
LARAPOST_MCP_TOKEN=use-a-long-random-secret
Add real business context so an AI client does not have to guess:
LARAPOST_BUSINESS_NAME="Acme"
LARAPOST_BUSINESS_DESCRIPTION="..."
LARAPOST_TARGET_AUDIENCE="..."
LARAPOST_BRAND_VOICE="..."
LARAPOST_CONTENT_GUIDELINES="..."
3. Use the remote server URL
https://your-app.example/larapost/mcp
The built-in authentication expects Authorization: Bearer <LARAPOST_MCP_TOKEN>. Clients that require OAuth rather than static bearer tokens should place LaraPost behind your application's normal Laravel MCP OAuth or authenticated proxy setup.
ChatGPT and OpenAI clients
Use LaraPost as a remote MCP server in an OpenAI surface that supports custom MCP apps or remote MCP servers. Write tools should remain approval-gated in the client whenever possible. LaraPost marks publishing and cancellation tools as destructive side effects so MCP clients can treat them differently from read-only tools.
Claude and other MCP clients
Point the client at the same remote MCP URL and supply the bearer token when the client supports custom authorization headers. Because LaraPost uses the MCP protocol instead of an OpenAI-specific API, the server is not tied to one model vendor.
Security model
- MCP is disabled by default.
- No MCP route is registered without a configured token.
- Account credentials and provider tokens are not returned by read tools.
- Publishing tools are explicitly side-effecting.
- Business context is guidance, not permission to invent facts or publish without clear intent.
- TikTok MCP publishing uses upload mode so the creator reviews and completes the post in TikTok. LaraPost rejects TikTok Direct Post from the MCP write tool.