PHPackages                             builtbyberry/laravel-swarm-mcp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. builtbyberry/laravel-swarm-mcp

ActiveLibrary

builtbyberry/laravel-swarm-mcp
==============================

Read-only Model Context Protocol (MCP) server for Laravel Swarm — expose durable run history, durable-run inspection, and audit-outbox health as MCP Resources over the official laravel/mcp package.

v0.1.0(1mo ago)10MITPHPPHP ^8.5CI passing

Since Jul 10Pushed 1mo agoCompare

[ Source](https://github.com/builtbyberry/laravel-swarm-mcp)[ Packagist](https://packagist.org/packages/builtbyberry/laravel-swarm-mcp)[ Docs](https://swarm.builtbyberry.com)[ RSS](/packages/builtbyberry-laravel-swarm-mcp/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (10)Versions (5)Used By (0)

Laravel Swarm MCP
=================

[](#laravel-swarm-mcp)

[![tests](https://github.com/builtbyberry/laravel-swarm-mcp/actions/workflows/tests.yml/badge.svg)](https://github.com/builtbyberry/laravel-swarm-mcp/actions/workflows/tests.yml)

A read-only [Model Context Protocol](https://modelcontextprotocol.io) server for [Laravel Swarm](https://github.com/builtbyberry/laravel-swarm), built on the official [`laravel/mcp`](https://github.com/laravel/mcp) package. It exposes a swarm's durable run history, durable-run inspection, and audit-outbox health as MCP **Resources**, so any MCP-compatible AI client — Claude, Cursor, and others — can observe your swarm runs.

> **Read-only by design.** This release exposes observability **Resources only**and registers **zero Tools**. It can *observe* swarm runs but can never pause, resume, cancel, or signal them. Operator control is a deliberately deferred later minor (see [Read-only by design](#read-only-by-design)).

It wraps Laravel Swarm's public display-read contracts (introduced in core `v0.19.0`) — `ReadableRunHistoryStore`, `InspectsDurableRuns`, and `ReadableAuditOutbox` — so every read is **display-decrypted and degrade-safe by construction**: an undecryptable field (e.g. after an `APP_KEY` rotation) comes back as `null` with an `*_available: false` flag rather than raw `sw0:`ciphertext or a failed read.

Requirements
------------

[](#requirements)

- PHP `^8.5`
- `builtbyberry/laravel-swarm` `^0.19`
- `laravel/mcp` `^0.8`

Installation
------------

[](#installation)

```
composer require builtbyberry/laravel-swarm-mcp
```

Optionally publish the config file:

```
php artisan vendor:publish --tag="swarm-mcp-config"
```

Configuration
-------------

[](#configuration)

`config/swarm-mcp.php`:

KeyDefaultDescription`server.enabled``true`Master switch for the observability server.`server.name``Laravel Swarm`Display name reported to MCP clients.`transports.stdio.enabled``true`Expose the server over stdio (local / agent-host).`transports.http.enabled``false`Expose the server over the networked HTTP transport. **Off by default.**`transports.http.path``swarm-mcp`Route path for the HTTP transport.`authentication.middleware``['auth:sanctum']`Middleware applied to the HTTP transport route.`resources.*``true`Toggle individual resource groups (`run_history`, `durable_inspection`, `audit_outbox`).Connecting an MCP client
------------------------

[](#connecting-an-mcp-client)

### stdio (default)

[](#stdio-default)

The server is registered under the handle `laravel-swarm` and started with the `laravel/mcp` command:

```
php artisan mcp:start laravel-swarm
```

Point your MCP client at that command. For example, a Claude Desktop entry:

```
{
  "mcpServers": {
    "laravel-swarm": {
      "command": "php",
      "args": ["artisan", "mcp:start", "laravel-swarm"]
    }
  }
}
```

### HTTP (Streamable)

[](#http-streamable)

Set `transports.http.enabled` to `true`. The server is then reachable at the configured path (default `POST /swarm-mcp`) behind the configured authentication middleware. **A networked caller must authenticate** — the default guard is `auth:sanctum` (your application provides Sanctum). See [Authorization](#authorization).

Resources
---------

[](#resources)

URIBacked byReturns`swarm://runs``ReadableRunHistoryStore::query()`The most recent runs — a lean, decryption-free projection.`swarm://runs/{runId}``ReadableRunHistoryStore::findForDisplay()`A single run with its steps; sealed fields degrade per field.`swarm://durable-runs/{runId}``InspectsDurableRuns::inspect()`Assembled durable-run state: waits, signals, progress, children, branches, hierarchical outputs.`swarm://audit-outbox/health``ReadableAuditOutbox::healthSummary()`Outbox availability + pending / dead-letter / reserved counts.`swarm://audit-outbox/queue/{state}``pending()` / `deadLettered()`The `pending` or `dead-lettered` queue (metadata + `last_error` only).`swarm://audit-outbox/records/{id}``ReadableAuditOutbox::record()`A single outbox row with its full display-decrypted payload.### Display-safe reads

[](#display-safe-reads)

Every resource resolves the **bound public contract** — never the `@internal``SwarmPersistenceCipher`. Sealed payloads are opened through the display path, which honors `swarm.persistence.decrypt_failure_policy` and **degrades per field**: an undecryptable value becomes `null` with an explicit `*_available: false` flag (`output_available`, `context_available`, `payload_available`, …). A rotated `APP_KEY` or a single poison row therefore never throws, never aborts the read, and never leaks `sw0:` ciphertext to the client. The audit-outbox reads are pure `SELECT`s — they cannot drain or mutate the outbox that `swarm:relay --type=audit` drains.

Read-only by design
-------------------

[](#read-only-by-design)

`v0.1.0` is intentionally **Resources-only**. The server registers no Tools, so an AI client can read swarm state but cannot act on it. Exposing the operator control verbs (pause / resume / cancel / signal) to an autonomous agent is a subtle surface — it requires a per-run authorization callback and deliberately excludes fleet-wide batch verbs — and is planned for a later minor behind an explicit opt-in. Until then, this package is a safe, observe-only window into your swarms.

Authorization
-------------

[](#authorization)

The server authenticates a networked caller (via the configured `authentication.middleware`), but it is **agnostic about *which* runs a caller may read** — scoping run visibility to a tenant or user is your application's responsibility. This release exposes read-only data only.

Testing
-------

[](#testing)

```
composer test       # Pest
composer analyse    # PHPStan (level 8)
composer lint       # Pint
```

License
-------

[](#license)

The MIT License (MIT). Please see the [License File](LICENSE) for more information.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance90

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

50d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1000887?v=4)[Daniel Berry](/maintainers/dberry37388)[@dberry37388](https://github.com/dberry37388)

---

Top Contributors

[![dberry37388](https://avatars.githubusercontent.com/u/1000887?v=4)](https://github.com/dberry37388 "dberry37388 (18 commits)")

---

Tags

laravelmcpaiagentsobservabilityswarm

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/builtbyberry-laravel-swarm-mcp/health.svg)

```
[![Health](https://phpackages.com/badges/builtbyberry-laravel-swarm-mcp/health.svg)](https://phpackages.com/packages/builtbyberry-laravel-swarm-mcp)
```

###  Alternatives

[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.6k31.1M880](/packages/laravel-boost)[spatie/laravel-health

Monitor the health of a Laravel application

89313.5M195](/packages/spatie-laravel-health)[laravel/ai

The official AI SDK for Laravel.

1.1k6.4M360](/packages/laravel-ai)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

24795.1k](/packages/harris21-laravel-fuse)[psalm/plugin-laravel

Psalm plugin for Laravel

3365.5M359](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

80732.6M270](/packages/laravel-mcp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
