# Laravel AI Blog: SEO scoring, AI drafts and an MCP server for Laravel

> Laravel AI Blog is our free, MIT-licensed blog package for Laravel 10–13: on-page SEO scores, internal links, AI drafting and an MCP server for agents.

- URL: https://byteminus.com/blog/laravel-ai-blog-package/
- Published: 2026-10-15
- Author: Byte Minus Engineering (Byte Minus)
- Topics: Open source, Laravel AI Blog, Laravel, SEO, AI

**In short:** Laravel AI Blog (byteminus/laravel-ai-blog) is a free, MIT-licensed blog package by Byte Minus for Laravel 10 to 13 on PHP 8.2 to 8.5. It scores every post for on-page SEO with plain-English fixes, suggests internal links, drafts with you through the laravel/ai SDK, and includes an MCP server so Claude, ChatGPT or any MCP agent can draft, score, link and schedule posts. AI output always lands as a draft; nothing publishes itself by default.

Adding a blog to a Laravel app usually means one of two things: a full CMS you didn't want, or a `posts` table and a lot of hand-written SEO plumbing. Neither tells you whether a post is any good before it goes out, and neither is ready for the way more and more teams now write — with an AI assistant in the loop.

**Laravel AI Blog** is our answer: a free, open-source blog package for Laravel 10 to 13, released under the **MIT license**, with no paid tier.

```bash
composer require byteminus/laravel-ai-blog
php artisan vendor:publish --tag=laravel-ai-blog-migrations
php artisan migrate
```

The code is on [GitHub](https://github.com/byteminus/laravel-ai-blog) and the package on [Packagist](https://packagist.org/packages/byteminus/laravel-ai-blog).

## Headless by default

Laravel AI Blog gives you models, migrations and a trait — not an admin panel you have to work around. Already have a `Post` model? Keep it:

```php
use ByteMinus\AiBlog\Concerns\HasBlogSeo;

class Post extends Model
{
    use HasBlogSeo;

    // Override only what differs from the defaults
    public function getBodyField(): string { return 'content'; }
}
```

Point `ai-blog.models.post` at your model and you're done. When you want public pages, one config flag turns on `/blog`, post, category and tag routes, an RSS feed, and Blade components for meta tags, structured data and the post body.

## An SEO score with fixes you can act on

Every post gets a deterministic on-page score — no API key required:

```php
$report = $post->seoReport();
$report->score;    // 72
$report->grade();  // "B"
$report->fixes();  // ["Include \"laravel queues\" in the title.", "Add at least two links — ..."]
```

The fixes are written in plain English, so a writer knows exactly what to change. Alongside the score:

- **Internal links** — `$post->suggestedLinks()` proposes related published posts with anchor text.
- **Stale-post detection** — `php artisan ai-blog:audit --stale` lists posts due for a refresh.
- **Structured data** — `BlogPosting` JSON-LD on every post, and `FAQPage` when a post has a `## Question?` heading followed by its answer.
- **The search-engine basics** — canonical URLs, Open Graph and Twitter cards, publish and modified times, paginated index pages with distinct titles, and an RSS 2.0 feed.

`php artisan ai-blog:audit` scores every post and lists its fixes and link suggestions in one go.

## AI as your editor, not your ghostwriter

The AI features are optional. Install the official [laravel/ai](https://github.com/laravel/ai) SDK, use any provider it supports, and you can:

```php
// Keyword → brief → full draft, saved as a DRAFT for a human to review.
$draft = AiBlog::draftFromKeyword('laravel queues');

// Fill in a missing target keyword and meta description.
AiBlog::enrichSeo($post);
```

There are also rewrites, refresh suggestions and translations. Every one of them produces a **draft**. The package marks unverified claims as `[verify: ...]` and records how much AI was involved in each post, because AI that writes thirty posts a month from a keyword list is exactly what search engines are built to bury. Auto-publishing exists as a config flag you turn on knowingly — never as a default.

## Let agents write your blog — safely

Laravel AI Blog includes a [laravel/mcp](https://github.com/laravel/mcp) server. Enable it in the config, protect it with your usual middleware, and connect Claude Code or any MCP client:

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

Agents get `list_posts`, `get_post`, `create_draft`, `update_post`, `draft_from_keyword`, `score_post`, `suggest_links` and `schedule_post`. There is deliberately **no `publish_post` tool**: agents draft, score, link and schedule, and a human — or the scheduler, after a human scheduled it — publishes. For Claude.ai and ChatGPT custom connectors, laravel/mcp's OAuth support works with Passport.

## Built to be safe around untrusted content

Two pieces do the unglamorous work that keeps an AI-connected blog safe:

- **`SafeFetcher`** reads public pages and feeds so the AI has real sources. It runs only from queued jobs or Artisan commands, rejects internal hosts and non-standard ports, pins each connection to the address it checked so DNS rebinding can't redirect it, obeys `robots.txt`, and caps size and time. Everything it returns is treated as untrusted text before it goes near a model.
- **The command bus** sends every change — from a dashboard, an Artisan command, a job or an agent — through the same rules: the actor must hold the command's ability, every request carries an idempotency key so retries can't run twice, and each outcome is written to an audit trail.

## What's next

The roadmap includes a built-in XML sitemap, semantic linking with embeddings, topic clusters and content gaps from your existing posts, Filament and Nova adapters, multilingual posts with hreflang, and scheduled drafting pipelines. Most items have a `good first issue` in the repository.

## Get started

- Install: `composer require byteminus/laravel-ai-blog` ([Packagist](https://packagist.org/packages/byteminus/laravel-ai-blog))
- Source, issues and contributing guide: [github.com/byteminus/laravel-ai-blog](https://github.com/byteminus/laravel-ai-blog)
- Requirements: PHP 8.2 to 8.5 with `curl`, `dom`, `libxml` and `mbstring`; Laravel 10, 11, 12 or 13

Security issues should be reported privately, as described in the repository's `SECURITY.md`.
