# Let AI agents write your blog over MCP

> **Diagram:** An agent such as Claude Code, Claude.ai or ChatGPT calls the MCP endpoint with a token. Your middleware rejects unauthenticated calls before any tool runs. The MCP server writes drafts and schedules; it has no publish tool, so only you or the scheduler publish.

```php
// config/ai-blog.php
'mcp' => [
    'enabled' => true,
    'path' => '/mcp/ai-blog',
    'middleware' => ['auth:sanctum'],
],
```

Then connect:

```bash
claude mcp add --transport http my-blog https://example.com/mcp/ai-blog --header "Authorization: Bearer <token>"
```

Tools: `list-posts`, `get-post`, `create-draft`, `update-post`, `draft-from-keyword`, `score-post`,
`suggest-links`, `schedule-post`. There is deliberately **no `publish-post` tool** — agents draft,
score, link and schedule; a human (or the scheduler, after a human scheduled it) publishes.

For Claude.ai and ChatGPT custom connectors, use laravel/mcp's OAuth support (`Mcp::oauthRoutes()` with Passport).
