Open-source Laravel blog package
The Laravel blog package that edits with you.
Laravel AI Blog scores every post for on-page SEO, suggests internal links, drafts with any AI provider and lets Claude, ChatGPT or any MCP agent write to your blog. Every AI change lands as a draft. A person decides what goes live.
13 on-page SEO checks8 MCP tools230 testsLaravel 10–13 · PHP 8.2–8.5MIT licensed
- draft-from-keyword"laravel queues" → post 42, saved as draft
- score-post67 / 100 · grade C · 4 fixes
- suggest-links3 links, anchor "queue workers"
- update-postmeta description, H2, 3 links
- score-post92 / 100 · grade A
- schedule-postMonday 09:00 · the scheduler publishes
- publish-postno such tool
A blog that does the editor's checklist
The parts of blogging that get skipped, built into the package.
Keep your own Post model
Add the HasBlogSeo trait to the model you already have, or use the bundled one. No admin panel forced on you. Turn on one flag for /blog routes, Blade components and RSS.
A score with fixes, not just a number
Thirteen weighted checks, from title length to the keyword in an H2, each with a plain-English fix. Deterministic, no API key needed.
Links to your own posts, with anchor text
TF-IDF suggestions from your published posts, and stale-post detection for the ones due a refresh.
An editor, not a ghostwriter
Brief to draft, meta descriptions, rewrites, refresh ideas and translations through the official laravel/ai SDK, with any provider. Unverified claims are marked [verify: …].
Agents get tools, not the publish button
Claude, ChatGPT and Claude Code connect over laravel/mcp. They can draft, score, link and schedule. Publishing stays with people and the scheduler.
Fetches the web without opening your network
SafeFetcher blocks private addresses, pins DNS, obeys robots.txt and caps size and time. For your own write actions there is a command bus with idempotency keys and an audit trail.
Know what to fix before you publish
Every post gets a 0–100 score from the same checks an SEO editor runs by hand.
- Title length10
- Meta description length10
- Content length10
- Uses H2 subheadings8
- Images have alt text6
- Links to other content8
- Readability6
- Target keyword4
- Keyword in title10
- Keyword in meta description6
- Keyword in URL slug6
- Keyword in first 100 words8
- Keyword in an H26
Fixes, in plain English
From $post->seoReport()->fixes()
- Adjust the meta description to 120–160 characters (currently 94).
- Add at least two links — internal links to related posts count most.
- Add "laravel queues" to at least one H2.
Run php artisan ai-blog:audit to score every post at once, or add --fix to let the AI fill missing SEO fields first.
Let AI agents write to your blog
A built-in MCP server. Connect Claude Code with one command; Claude.ai and ChatGPT through OAuth.
| MCP tool | What the agent can do |
|---|---|
| list-posts | List recent posts with status and SEO score, filtered by status or text |
| get-post | Read one post in full, as Markdown |
| create-draft | Create a post as a draft and get its score and fixes back |
| update-post | Change only the fields it passes. It cannot change the status |
| draft-from-keyword | Research a keyword into a brief, write the draft and save it |
| score-post | Score on-page SEO from 0 to 100 and list the fixes |
| suggest-links | Suggest internal links to related posts, with anchor text |
| schedule-post | Schedule a future publish time for the scheduler |
| publish-post | Deliberately missing. Agents can't publish |
The MCP endpoint sits behind the middleware you choose, such as auth:sanctum. Add can:manageAiBlog to let in only the accounts you trust: a scheduled post is published by the scheduler without another check.
From keyword to published post
The same path whether a person, a queued job or an agent starts it.
Brief
A keyword becomes a brief: search intent, an outline, questions to answer and related terms.
Draft
The AI writes the draft from the brief and saves it with status draft. It records how much of the post the AI wrote.
Score and fix
The SEO report lists what is missing.
enrichSeo()can fill in a missing keyword and meta description.Link
Internal link suggestions point the new post at your related published posts, with anchor text that fits the sentence.
Schedule and publish
A person publishes, or schedules the post and
ai-blog:publish-scheduledpublishes it on time. Pages ship with canonical URLs, Open Graph tags andBlogPostingJSON-LD.
The code
Install, publish the migrations, and use it from anywhere in your app.
// Deterministic, no API key needed.
$report = $post->seoReport();
$report->score; // 76
$report->grade(); // "B"
$report->fixes(); // ["Add at least two links — ...", ...]
// Internal links from your own published posts.
$post->suggestedLinks(); // [['post' => Post, 'anchor' => 'queue workers', ...]]
use ByteMinus\AiBlog\Facades\AiBlog;
// Keyword → brief → full draft. Saved as a DRAFT for a person to review.
$draft = AiBlog::draftFromKeyword('laravel queues');
// Fill in a missing keyword and meta description.
AiBlog::enrichSeo($post);
// Publishing is always explicit.
$post->schedule(now()->addDays(2));
use ByteMinus\AiBlog\Concerns\HasBlogSeo;
class Post extends Model
{
use HasBlogSeo;
// Override only what differs from the defaults.
public function getBodyField(): string { return 'content'; }
}
// config/ai-blog.php
'models' => ['post' => App\Models\Post::class],
// config/ai-blog.php
'mcp' => [
'enabled' => true,
'path' => '/mcp/ai-blog',
'middleware' => ['auth:sanctum'],
],
# Then, in your terminal:
claude mcp add --transport http my-blog https://example.com/mcp/ai-blog \
--header "Authorization: Bearer <token>"
Questions developers ask
What is Laravel AI Blog?
Laravel AI Blog is a free, open-source blog package for Laravel. It adds posts, categories and tags, an on-page SEO score with fixes, internal link suggestions, AI drafting through laravel/ai and an MCP server so AI agents can write drafts. Install it with composer require byteminus/laravel-ai-blog.
Which Laravel and PHP versions does it support?
Laravel 10, 11, 12 and 13 on PHP 8.2 to 8.5. Both the newest and the oldest allowed dependencies are tested on every push.
Does it work without an AI provider?
Yes. SEO scoring, link suggestions, structured data, the RSS feed and the blog routes need no API key. The AI features are optional and use laravel/ai when you install it, with any provider it supports.
Will the AI publish posts by itself?
No. Everything the AI or an agent writes is saved as a draft, and the MCP server has no publish tool. A post goes live when a person publishes it, or when the scheduler reaches a time set with schedule() or the schedule-post tool.
Can I keep my existing Post model?
Yes. Add the HasBlogSeo trait to your model, override any field names that differ, and point ai-blog.models.post at it in the config.
How do I connect Claude or ChatGPT to my Laravel blog?
Enable the MCP server in config/ai-blog.php and protect it with middleware. Claude Code connects with claude mcp add and a bearer token. Claude.ai and ChatGPT custom connectors use laravel/mcp's OAuth support with Passport.
Does it add SEO tags to the blog pages?
Yes, when you enable the routes. Post pages get a canonical URL, Open Graph and Twitter cards, publish and modified times, an RSS link and BlogPosting JSON-LD, plus FAQPage JSON-LD when the post has question headings. Index, category and tag pages get descriptions, canonical URLs and prev and next links.
Is it free?
Yes. Laravel AI Blog is MIT licensed, with no paid tier, no Nova or Filament license and no SaaS account.
Read the full FAQ: installation, every SEO check, AI drafting, the MCP tools, routes, safe fetching, testing and troubleshooting.