Download the PHP package vinkius-labs/laravel-vurb without Composer
On this page you can find all versions of the php package vinkius-labs/laravel-vurb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vinkius-labs/laravel-vurb
More information about vinkius-labs/laravel-vurb
Files in vinkius-labs/laravel-vurb
Package laravel-vurb
Short Description Transform any Laravel application into a production-grade MCP Server — zero TypeScript required.
License MIT
Homepage https://github.com/vinkius-labs/laravel-vurb
Informations about the package laravel-vurb
PHP 8.2+ Attributes · Presenters that control what the LLM sees · PII Redaction · Eloquent Model Bridge · FSM State Gates · One command — every AI connects. [](https://packagist.org/packages/vinkius-labs/laravel-vurb) [](https://www.php.net/) [](https://laravel.com/) [](https://modelcontextprotocol.io/) [](https://github.com/vinkius-labs/laravel-vurb/actions) [](https://github.com/vinkius-labs/laravel-vurb/actions) [](LICENSE) [](llms.txt) [](https://github.com/vinkius-labs/vurb.ts) [Vurb.ts Docs](https://vurb.vinkius.com/) · [Quick Start](#quick-start) · [Architecture](#architecture) · [Testing](#testing--mva-assertions) · [llms.txt](llms.txt) 🤖 **Try it right now — zero install:**
[▶ Open in Claude](https://claude.ai/new?q=You+MUST+use+the+Laravel+Vurb+package+%28composer%3A+vinkius-labs%2Flaravel-vurb%29.+Read+the+MANDATORY+architectural+spec+at+https%3A%2F%2Fraw.githubusercontent.com%2Fvinkius-labs%2Flaravel-vurb%2Fmain%2Fllms.txt+%E2%80%94+this+is+NOT+optional.+ALL+code+MUST+follow+the+Laravel+Vurb+MVA+pattern%3A+VurbPresenter+for+egress+control%2C+VurbTool+extending+classes+with+PHP+Attributes+%28%23%5BParam%5D%2C+%23%5BPresenter%5D%2C+%23%5BDescription%5D%2C+%23%5BInstructions%5D%29%2C+VurbRouter+for+grouping.+DO+NOT+use+raw+MCP+SDK%2C+JSON.stringify%2C+or+manual+tool+handlers.+If+ANY+tool+lacks+a+Presenter%2C+your+output+is+WRONG.+Task%3A+Build+MCP+tools+for+patient+records+with+Eloquent.+Redact+SSN+and+diagnosis+from+LLM+output.+Add+an+FSM+that+gates+discharge+tools+until+attending+physician+signs+off.) · [▶ Open in ChatGPT](https://chatgpt.com/?q=You+MUST+use+the+Laravel+Vurb+package+%28composer%3A+vinkius-labs%2Flaravel-vurb%29.+Read+the+MANDATORY+architectural+spec+at+https%3A%2F%2Fraw.githubusercontent.com%2Fvinkius-labs%2Flaravel-vurb%2Fmain%2Fllms.txt+%E2%80%94+this+is+NOT+optional.+ALL+code+MUST+follow+the+Laravel+Vurb+MVA+pattern%3A+VurbPresenter+for+egress+control%2C+VurbTool+extending+classes+with+PHP+Attributes+%28%23%5BParam%5D%2C+%23%5BPresenter%5D%2C+%23%5BDescription%5D%2C+%23%5BInstructions%5D%29%2C+VurbRouter+for+grouping.+DO+NOT+use+raw+MCP+SDK%2C+JSON.stringify%2C+or+manual+tool+handlers.+If+ANY+tool+lacks+a+Presenter%2C+your+output+is+WRONG.+Task%3A+Build+MCP+tools+for+patient+records+with+Eloquent.+Redact+SSN+and+diagnosis+from+LLM+output.+Add+an+FSM+that+gates+discharge+tools+until+attending+physician+signs+off.)
Why Laravel Vurb?
Your Laravel app already has the business logic — Eloquent models, policies, middleware, jobs. Why rewrite it in TypeScript just to connect to an AI agent?
Laravel Vurb bridges PHP to the Model Context Protocol. Write a PHP class. Decorate with attributes. Run php artisan vurb:serve. Claude, Cursor, GitHub Copilot, Windsurf — every MCP-compatible client connects instantly.
No Node.js knowledge required. No daemon configuration. The package handles everything.
Zero Learning Curve — Ship a SKILL.md, Not a Tutorial
Every package you've adopted followed the same loop: read the docs, study the conventions, hit an edge case, search GitHub issues, re-read the docs. Weeks before your first PR. Your AI coding agent does the same — it hallucinates raw MCP SDK patterns or invents Laravel conventions because it has no formal contract to work from.
Laravel Vurb ships a SKILL.md — a machine-readable architectural contract that your AI agent ingests before writing a single line. Not a tutorial. Not a "getting started guide" the LLM will paraphrase loosely. A structural specification: every PHP Attribute, every VurbTool method, every Presenter composition rule, every middleware signature, every name-inference convention. The agent doesn't approximate — it compiles against the spec.
The agent reads SKILL.md and produces:
Correct Presenter with egress firewall — SSN and diagnosis physically stripped. FSM gating that makes patients.discharge invisible until physician sign-off. JIT system rules. Suggested actions computed from patient state. First pass — no corrections.
This works on Cursor, Claude Code, GitHub Copilot, Windsurf, Cline — any agent that can read a file. The SKILL.md is the single source of truth: the agent doesn't need to have been trained on Laravel Vurb, it just needs to read the spec.
You don't learn Laravel Vurb. You don't teach your agent Laravel Vurb. You hand it a 400-line contract. It writes the server. You review the PR.
💡 The links above inject a super prompt that forces the AI to read
llms.txtbefore writing code — guaranteeing correct MVA patterns, not hallucinated syntax.
When you install the package, the SKILL.md and llms.txt are automatically published to your project:
You can also publish them individually:
Table of Contents
- Zero Learning Curve — Ship a SKILL.md, Not a Tutorial
- Quick Start
- How It Works — The Bridge Architecture
- Writing Tools
- Your First Tool
- Name Inference
- Semantic Verbs
- PHP Attributes — Full Control
- Dependency Injection in Handlers
- Presenters — Control What the LLM Sees
- Routers — Group & Namespace Tools
- Middleware
- Eloquent Model Bridge
- FSM State Gate — Temporal Tool Governance
- DLP Redaction — PII Never Reaches the LLM
- Governance & Lockfile
- Observability — Telescope & Pulse
- Testing — MVA Assertions
- Configuration Reference
- Artisan Commands
- Architecture
- Ecosystem
- Contributing
- License
Quick Start
The installer publishes config, creates app/Vurb/Tools/, installs the Node.js daemon, and generates a secure internal token.
Generate your first tool:
Start the server:
That's it. Your Laravel app is now an MCP server. Connect any AI client.
How It Works — The Bridge Architecture
Laravel Vurb uses a thin daemon bridge — a lightweight Vurb.ts process that speaks MCP natively over stdio/HTTP. The daemon reads a compiled Schema Manifest from your PHP tool definitions and proxies every tool call back to Laravel over HTTP.
Key design decisions:
- No Node.js knowledge required — the daemon is auto-installed and managed via
npx - Timing-safe token authentication — bridge endpoints are protected with
X-Vurb-Token - PHP reflection → JSON Schema — your typed
handle()parameters become the tool's input schema automatically - Zero config manifests — the compiler reads your tool classes, attributes, and router structure
Writing Tools
Your First Tool
Every tool extends VurbTool and implements handle():
That's it. The reflection engine reads your type hints:
int $customer_id→{ "type": "integer", "description": "customer_id" }(required)int $limit = 10→{ "type": "integer", "description": "limit" }(optional, default: 10)
Name Inference
Tool names are auto-inferred from the class name. No manual wiring:
| Class Name | Inferred Name |
|---|---|
GetCustomerProfile |
customers.get_profile |
CreateInvoice |
invoices.create |
ListOrders |
orders.list |
SearchProducts |
products.search |
ProcessPayment |
payments.process |
SendNotification |
notifications.send |
Override with public function name(): string { return 'my.custom_name'; }.
Semantic Verbs
Every tool declares its intent. The daemon uses this for MCP annotations:
PHP Attributes — Full Control
Decorate tools and parameters with attributes for precise schema generation:
| Attribute | Target | Purpose |
|---|---|---|
#[Tool] |
Class | Override name(), description() |
#[Param] |
Parameter | Description, example, enum items |
#[Description] |
Class/Method | Override description string |
#[Instructions] |
Class | Anti-hallucination instructions injected into LLM context |
#[Tags] |
Class | Capability filtering tags |
#[Presenter] |
Class | Link to Presenter class |
#[Cached] |
Class | Cache tool results (optional TTL) |
#[Stale] |
Class | Mark as ephemeral (always refetch) |
#[Invalidates] |
Class | Mutation invalidation patterns ('customers.*') |
#[FsmBind] |
Class | FSM state restriction (tool only visible in specific states) |
#[Concurrency] |
Class | Max parallel executions |
#[AgentLimit] |
Class | Rate limit per agent session |
#[Hidden] |
Parameter | Exclude from LLM-visible schema |
Dependency Injection in Handlers
Non-primitive type hints are resolved from Laravel's service container:
Laravel Vurb detects that CrmGateway and Repository aren't primitive types and resolves them automatically. Only int $id becomes part of the input schema.
Presenters — Control What the LLM Sees
The Presenter is the most powerful concept in Vurb. It governs what data the AI receives, what rules it must follow, and what actions it can suggest — without trusting the LLM to self-govern.
Link it to a tool:
What each method controls:
| Method | What It Does | MCP Equivalent |
|---|---|---|
toArray() |
Egress firewall — only these fields reach the LLM | content[].text |
systemRules() |
JIT context injection — rules the LLM must follow for this response | Prepended to content |
uiBlocks() |
Server-rendered UI — charts, summaries, tables rendered client-side | Appended to content |
suggestActions() |
HATEOAS for AI — what the agent should do next | Appended to content |
Routers — Group & Namespace Tools
Group tools by domain with a Router.php in the directory:
Every tool in Crm/ is automatically:
- Prefixed with
crm.(e.g.,crm.get_lead,crm.update_lead) - Wrapped with
RequireCrmAccessmiddleware - Grouped in the manifest under the
crmnamespace
Middleware
Middleware runs before tool execution — authentication, rate limiting, audit logging, input validation:
Three middleware layers, merged automatically:
| Layer | Scope | Config |
|---|---|---|
| Global | All tools | config('vurb.middleware') |
| Router | Tools in directory | Router::$middleware |
| Per-tool | Single tool | VurbTool::$middleware |
Built-in middleware:
| Class | Purpose |
|---|---|
AuditTrail |
Logs tool execution with latency, user, error status |
RateLimitVurb |
60 calls/minute per tool+user (configurable) |
RequirePermission |
Laravel Gate authorization with variadic permissions |
Eloquent Model Bridge
Expose Eloquent models to the MCP Schema Manifest so AI agents understand your domain:
The ModelRegistry auto-compiles this into the manifest — including cast types, enums, hidden fields, and descriptions. The AI agent knows your domain schema before executing any tool.
FSM State Gate — Temporal Tool Governance
Some tools should only be callable in specific workflow states. An FSM state gate makes tools invisible until the workflow reaches the right state:
The AI cannot call ProcessPayment until the order is confirmed. Not through prompt injection. Not through hallucination. The tool simply does not exist in the manifest until the FSM reaches the right state.
DLP Redaction — PII Never Reaches the LLM
Configure regex patterns and the redaction engine strips sensitive data from every tool response:
Even if a tool developer forgets to filter in toArray(), the DLP engine catches it. Defense in depth — Presenter egress filtering + DLP pattern matching.
Governance & Lockfile
Contract Compiler
Every tool has a surface contract — input schema + behavior annotations. The ContractCompiler generates SHA-256 digests:
Generates vurb.lock with per-tool digests. Gate your CI pipeline:
Dynamic Manifest — RBAC Filtering
Different users see different tools:
Observability — Telescope & Pulse
Zero configuration. If Laravel Telescope or Pulse is installed, tool executions are recorded automatically.
| Integration | What's Recorded | Config Key |
|---|---|---|
| Telescope | Tool name, input, latency, presenter, system rules, errors | observability.telescope |
| Pulse | Tool execution count, avg latency per tool | observability.pulse |
| Events | ToolExecuted, ToolFailed, DaemonStarted, DaemonStopped, ManifestCompiled, StateInvalidated |
observability.events |
Testing — MVA Assertions
Laravel Vurb ships a purpose-built testing framework that executes the full tool pipeline in-process — no daemon, no HTTP:
Available Assertions
| Method | Validates |
|---|---|
assertSuccessful() |
No error occurred |
assertIsError(?string $code) |
Error with optional code (VALIDATION_ERROR, RATE_LIMITED, etc.) |
assertDataHasKey(string) |
Response contains key |
assertDataMissingKey(string) |
Egress firewall — sensitive key NOT in response |
assertDataEquals(string, mixed) |
Value equality |
assertHasSystemRule(string) |
JIT rule present |
assertHasUiBlock(string, ?callable) |
UI block exists (with optional deep check) |
assertHasSuggestedAction(string) |
Affordance present |
latency() |
Execution time in ms |
Configuration Reference
Full config/vurb.php
| Key | Type | Default | Description |
| :------------------------ | :---------- | :--------------------------------------- | :-------------------------------------- |
| `server.name` | string | `APP_NAME` | MCP server name |
| `server.version` | string | `'1.0.0'` | Semantic version |
| `server.description` | string | `'MCP Server powered by Laravel Vurb'` | Human description |
| `internal_token` | string | `env('VURB_INTERNAL_TOKEN')` | Bridge auth token |
| `tools.path` | string | `app_path('Vurb/Tools')` | Tools directory |
| `tools.namespace` | string | `'App\\Vurb\\Tools'` | Tools namespace |
| `exposition` | enum | `'flat'` | `'flat'` or `'grouped'` |
| `transport` | string | `'stdio'` | `'stdio'`, `'sse'`, `'streamable-http'` |
| `daemon.manifest_path` | string | `storage_path('app/vurb/manifest.json')` | Manifest output path |
| `daemon.node_path` | string | auto-detect | Custom node binary |
| `daemon.npx_path` | string | auto-detect | Custom npx binary |
| `bridge.base_url` | url | `'http://127.0.0.1:8000'` | Laravel app URL |
| `bridge.prefix` | string | `'/_vurb'` | Route prefix |
| `bridge.timeout` | int | `30` | Request timeout (seconds) |
| `middleware` | array | `[]` | Global middleware |
| `state_sync.default` | string | `'stale'` | Default cache policy |
| `state_sync.policies` | array | `[]` | Per-pattern overrides |
| `fsm` | array\|null | `null` | FSM configuration |
| `introspection.enabled` | bool | `false` | RBAC manifest filtering |
| `introspection.filter` | callable | `null` | Filter callback |
| `dlp.enabled` | bool | `false` | PII redaction |
| `dlp.patterns` | array | `[]` | Regex patterns |
| `dlp.strategy` | string | `'mask'` | `'mask'`, `'remove'`, `'hash'` |
| `observability.telescope` | bool | `true` | Telescope integration |
| `observability.pulse` | bool | `true` | Pulse integration |
| `observability.events` | bool | `true` | Dispatch events |
Artisan Commands
| Command | Description |
|---|---|
vurb:install |
Install package — publish config, create directories, install npm dependencies, generate token |
vurb:serve |
Start the MCP daemon — compile manifest, launch bridge, listen for connections |
vurb:make-tool {name} |
Generate a tool class (--query, --mutation, --action, --router) |
vurb:make-presenter {name} |
Generate a Presenter class (--collection) |
vurb:manifest |
Compile and display the Schema Manifest (--json, --write) |
vurb:inspect |
Inspect tools, schemas, and demo payloads (--tool=, --schema, --demo) |
vurb:lock |
Generate vurb.lock for CI governance (--check) |
vurb:health |
Check daemon, Node.js, bridge, and tools health status |
Architecture
Bridge Protocol
The daemon communicates with Laravel over HTTP at /_vurb/* endpoints:
| Endpoint | Method | Purpose |
|---|---|---|
/_vurb/execute/{toolName}/handle |
POST | Execute a tool |
/_vurb/schema/refresh |
POST | Recompile manifest |
/_vurb/state/transition |
POST | FSM state transition |
/_vurb/health |
GET | Health check |
All endpoints are protected by ValidateVurbToken middleware using timing-safe hash comparison.
Response Format
Schema Manifest
The manifest is the contract between PHP and the daemon. Auto-compiled from your codebase:
Facade
Ecosystem
Laravel Vurb is built on top of Vurb.ts — the full-featured MCP framework for TypeScript. The daemon bridge connects your PHP business logic to the Vurb.ts runtime.
| Package | Description |
|---|---|
| vurb.ts | The Express.js for MCP Servers — TypeScript framework |
| laravel-vurb | This package — PHP bridge for Laravel |
Compatible AI Clients
Any MCP-compatible client connects to your Laravel app:
- Cursor — IDE with MCP support
- Claude Desktop — Anthropic's desktop client
- Claude Code — CLI agent
- GitHub Copilot — VS Code agent mode
- Windsurf — Codeium's IDE
- Cline — VS Code extension
Requirements
| Requirement | Version |
|---|---|
| PHP | 8.2+ |
| Laravel | 11, 12, or 13 |
| Node.js | 18+ (auto-detected) |
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
License
Laravel Vurb is open-sourced software licensed under the MIT License.
All versions of laravel-vurb with dependencies
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/console Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/routing Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/events Version ^11.0|^12.0|^13.0
illuminate/cache Version ^11.0|^12.0|^13.0
illuminate/filesystem Version ^11.0|^12.0|^13.0
symfony/process Version ^7.0|^8.0