larapost

mcp
Guvenlik Denetimi
Uyari
Health Uyari
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 5 GitHub stars
Code Gecti
  • Code scan — Scanned 8 files during light audit, no dangerous patterns found
Permissions Gecti
  • Permissions — No dangerous permissions requested

Bu listing icin henuz AI raporu yok.

SUMMARY

Laravel-native social publishing for Facebook, X, LinkedIn & TikTok with OAuth, queues, scheduling, retries, multi-account publishing & optional MCP.

README.md

LaraPost

CI
Packagist
PHP
Laravel
License

LaraPost is Laravel-native social publishing for Facebook Pages, Twitter / X, LinkedIn, and TikTok. It provides OAuth account connections, immediate, queued, and scheduled publishing, retries, multi-account targeting, and optional authenticated MCP integration inside your Laravel application.

It is not a separate social-media SaaS. It lives inside your Laravel application, so your app owns the database records, business rules, connected accounts, publishing history, and provider credentials.

What ships in 2.x

  • Facebook Pages
  • Twitter / X with OAuth 2.0 plus the optional Xquik backend
  • LinkedIn member profiles
  • TikTok Content Posting API with safe upload-to-inbox by default and explicit Direct Post opt-in
  • Immediate, scheduled, and queued publishing
  • Multi-account targeting
  • Retry and backoff for scheduled work
  • Token-expiry tracking and refresh where the provider supports it
  • Authenticated operator dashboard
  • Custom driver registration
  • Optional remote MCP server for AI clients
  • A diagnostic command with php artisan larapost:doctor

Requirements

LaraPost 2.x targets:

  • PHP 8.3+
  • Laravel 12 or 13

Laravel 11 is no longer in its security support window, so LaraPost 2.x does not carry that compatibility burden. Old maintenance branches are created from release tags only when a real backport is needed.

Installation

composer require prateekbhujel/larapost
php artisan larapost:install

The installer asks which platforms you want. You can enable one provider, several, or all of them.

Non-interactive examples:

# Facebook only
php artisan larapost:install --platforms=facebook

# Facebook + TikTok
php artisan larapost:install --platforms=facebook,tiktok

# API/package usage without the built-in dashboard
php artisan larapost:install --platforms=linkedin --no-dashboard

# Prepare the optional MCP integration too
php artisan larapost:install --platforms=facebook,tiktok --mcp

Enabled platforms are controlled by:

LARAPOST_PLATFORMS=facebook,tiktok

Disabled drivers do not appear in the manager, dashboard, or MCP capability list.

Publish

use SocialSync\Facades\SocialMedia;

$results = SocialMedia::post()
    ->content('We just shipped a new release.')
    ->platform('facebook')
    ->publish();

Target exact connected accounts:

SocialMedia::post()
    ->content('Only these destinations')
    ->platform('facebook')
    ->accounts([
        'facebook' => [12, 19],
    ])
    ->publish();

Schedule for later:

SocialMedia::post()
    ->content('Tomorrow morning')
    ->platform('linkedin')
    ->scheduleFor(now()->addDay()->setTime(9, 0))
    ->publish();

Queue immediate work:

SocialMedia::post()
    ->content('Process this through Laravel queues')
    ->platform('facebook')
    ->queue();

TikTok

LaraPost defaults to TikTok's upload flow:

TIKTOK_PUBLISH_MODE=upload

In upload mode, LaraPost sends the photo or video to the creator's TikTok inbox and the creator reviews and completes the post in TikTok. This is the safe default for the built-in dashboard, automation, and MCP clients.

SocialMedia::post()
    ->content('Behind the scenes from launch day')
    ->video('https://media.example.com/launch.mp4')
    ->platform('tiktok')
    ->publish();

Media uses PULL_FROM_URL, so it must be available over HTTPS from a domain or URL prefix verified for the TikTok developer app.

Direct Post is available only as an explicit application-level opt-in with TIKTOK_PUBLISH_MODE=direct. In that mode LaraPost requires current creator info, an explicit creator-selected privacy level, explicit interaction settings, and metadata.tiktok.consent=true. The built-in MCP tool intentionally refuses TikTok Direct Post. A host application using Direct Post must implement TikTok's required creator-facing sharing UX and pass those choices to LaraPost.

Changing TikTok publish mode changes the OAuth scope, so reconnect existing TikTok accounts after changing between upload and direct.

Optional MCP for ChatGPT, Claude, Codex, and other clients

MCP is not required for normal LaraPost installations.

Install it only when you want an AI client to interact with LaraPost:

composer require laravel/mcp:^1.0
php artisan larapost:install --mcp

Then configure:

LARAPOST_MCP_ENABLED=true
LARAPOST_MCP_PATH=/larapost/mcp
LARAPOST_MCP_TOKEN=replace-with-a-long-random-secret

LARAPOST_BUSINESS_NAME="Acme"
LARAPOST_BUSINESS_DESCRIPTION="What the company actually does"
LARAPOST_TARGET_AUDIENCE="Who the content is for"
LARAPOST_BRAND_VOICE="Clear, practical, no hype"
LARAPOST_CONTENT_GUIDELINES="Never invent prices or guarantees"

The MCP server exposes read-only business/account/history tools plus explicit write tools for publishing and cancelling pending posts. Provider tokens and account credentials are never returned by read tools.

Use the remote server URL:

https://your-app.example/larapost/mcp

Authentication uses:

Authorization: Bearer <LARAPOST_MCP_TOKEN>

For MCP clients that require OAuth rather than a static bearer token, integrate LaraPost with your application's Laravel MCP OAuth/authorization layer instead of exposing the endpoint anonymously.

Dashboard security

The dashboard is an operator surface, not a demo route. It can publish content and change provider credentials.

LaraPost 2.x protects operator routes with:

['web', 'auth']

by default. If your application uses another guard, tenant middleware, or admin authorization layer, override operator_middleware in the published config.

OAuth callbacks use a separate callback middleware stack so provider redirects do not inherit an application-specific operator policy accidentally.

Scheduler and queues

LaraPost registers its scheduled runner with Laravel's scheduler automatically.

Your application still needs Laravel's scheduler process:

php artisan schedule:work

or the normal schedule:run cron entry.

Enable queued scheduled publishing with:

LARAPOST_QUEUE_ENABLED=true
LARAPOST_QUEUE_CONNECTION=redis
LARAPOST_QUEUE_NAME=larapost

Due posts are claimed before publishing, and queued publishing uses a unique job per scheduled post.

Custom drivers

Register another implementation without editing package internals:

use SocialSync\Facades\SocialMedia;

SocialMedia::extend('mastodon', App\Social\MastodonDriver::class);

Custom drivers implement SocialSync\Contracts\SocialDriverInterface.

Diagnostics

Before production rollout:

php artisan larapost:doctor

The command checks database tables, enabled platforms, scheduler status, queue mode, dashboard access middleware, and MCP configuration.

Documentation

Full documentation:

https://prateekbhujel.github.io/larapost/

Start here:

Repository docs:

License

LaraPost is released under the MIT license.

Yorumlar (0)

Sonuc bulunamadi