Download the PHP package projectsaturnstudios/laravel-vibes without Composer

On this page you can find all versions of the php package projectsaturnstudios/laravel-vibes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-vibes

๐Ÿค– Laravel Vibes

PHP Version Laravel Version Version

A powerful Laravel package for implementing the Machine Control Protocol (MCP) server, enabling seamless integration with AI agents in your applications. Build intelligent, interactive features with structured tool definitions and real-time communication.

๐Ÿ“– Table of Contents - [๐Ÿค– Laravel Vibes](#-laravel-vibes) - [โœจ Key Features](#-key-features) - [๐Ÿšฆ Implementation Status](#-implementation-status) - [Primitive Implementation Status](#primitive-implementation-status) - [Feature Availability Matrix](#feature-availability-matrix) - [๐Ÿ“š Documentation](#-documentation) - [Class Diagram](#class-diagram) - [๐Ÿ”ง Installation](#-installation) - [โš™๏ธ Configuration](#๏ธ-configuration) - [๐Ÿš€ Usage](#-usage) - [Registering Tools](#registering-tools) - [Defining a Custom Tool](#defining-a-custom-tool) - [Using Server-Sent Events](#using-server-sent-events) - [Handling AI Agent Messages](#handling-ai-agent-messages) - [๐Ÿ” Tool Discovery & Registration](#-tool-discovery--registration) - [Auto-Discovery](#auto-discovery) - [Manual Registration](#manual-registration) - [Caching Primitives](#caching-primitives) - [๐Ÿงช Comprehensive Testing Guide](#-comprehensive-testing-guide) - [Unit Testing Custom Tools](#unit-testing-custom-tools) - [Mocking External Services](#mocking-external-services) - [Integration Testing with TheAgency](#integration-testing-with-theagency) - [Testing SSE Connections](#testing-sse-connections) - [Mocking AI Agent Interactions](#mocking-ai-agent-interactions) - [PHPUnit Configuration Recommendations](#phpunit-configuration-recommendations) - [Testing Best Practices](#testing-best-practices) - [๐Ÿงฐ API Reference](#-api-reference) - [TheAgency Class](#theagency-class) - [VibeTool Class](#vibetool-class) - [PrimitiveHandler Interface](#primitivehandler-interface) - [Common Usage Patterns](#common-usage-patterns) - [๐Ÿ›ก๏ธ Middleware Components](#-middleware-components) - [mcp-agent Middleware Group](#mcp-agent-middleware-group) - [ScaffoldSSEConnection Middleware](#scaffoldssconnection-middleware) - [ValidAgentCorsHeaders Middleware](#validagentcorsheaders-middleware) - [Security Best Practices](#security-best-practices) - [Complete Middleware Stack Example](#complete-middleware-stack-example) - [๐Ÿค MCP Protocol Integration](#-mcp-protocol-integration) - [What is the MCP Protocol?](#what-is-the-mcp-protocol) - [MCP Message Structure](#mcp-message-structure) - [Laravel Vibes MCP Implementation](#laravel-vibes-mcp-implementation) - [Supported MCP Methods](#supported-mcp-methods) - [Communication Flow](#communication-flow) - [Future Protocol Support](#future-protocol-support) - [Official Documentation](#official-documentation) - [๐Ÿš€ Advanced Usage Examples](#-advanced-usage-examples) - [Error Handling Patterns](#error-handling-patterns) - [Anthropic Claude Integration](#anthropic-claude-integration) - [Event-driven MCP Architecture](#event-driven-mcp-architecture) - [Database-backed Tool Implementation](#database-backed-tool-implementation) - [Complex Multi-step Agent Interaction](#complex-multi-step-agent-interaction) - [Custom Validation for Tool Parameters](#custom-validation-for-tool-parameters) - [๐Ÿ”„ Laravel 12 Compatibility](#-laravel-12-compatibility) - [Version Compatibility Matrix](#version-compatibility-matrix) - [Laravel 12 Features Utilized](#laravel-12-features-utilized) - [Upgrading from Previous Laravel Versions](#upgrading-from-previous-laravel-versions) - [Known Issues & Limitations](#known-issues--limitations) - [Composer Requirements](#composer-requirements) - [๐Ÿš€ Deployment Considerations](#-deployment-considerations) - [Production Environment Configuration](#production-environment-configuration) - [Performance Optimization](#performance-optimization) - [Scaling Strategies](#scaling-strategies) - [Monitoring and Logging](#monitoring-and-logging) - [Resource Management](#resource-management) - [Security in Production](#security-in-production) - [Hosting Platform-Specific Guidelines](#hosting-platform-specific-guidelines) - [๐Ÿ“Š Architecture](#-architecture) - [๐Ÿ“… Roadmap](#-roadmap) - [๐Ÿ‘ฅ Credits](#-credits) - [๐Ÿ”’ Security](#-security) - [๐Ÿ“„ License](#-license) - [๐Ÿค Contributing](#-contributing) - [๐Ÿ”„ Flow Diagrams](#-flow-diagrams) - [๐ŸŒŸ Real-World Examples](#-real-world-examples)

โœจ Key Features

๐Ÿšฆ Implementation Status

This section provides a clear overview of which MCP primitives are currently implemented and which are planned for future releases.

Primitive Implementation Status

Primitive Status Version Introduced Notes
Tools โœ… Full 0.1.0 Complete implementation with repositories, data objects, and discovery
Resources ๐Ÿšง Partial 0.4.0 Framework in place, API not finalized
Prompts ๐Ÿšง Partial 0.4.0 Framework in place, API not finalized
Samples ๐Ÿšง Partial 0.4.0 Framework in place, API not finalized
Roots ๐Ÿšง Partial 0.4.0 Framework in place, API not finalized

Feature Availability Matrix

Feature v0.1.0 v0.2.0 v0.3.0 v0.4.0 Planned
Tool Registration โœ… โœ… โœ… โœ… โœ…
Server-Sent Events โœ… โœ… โœ… โœ… โœ…
Auto-Discovery โŒ โœ… โœ… โœ… โœ…
Primitive Caching โŒ โŒ โœ… โœ… โœ…
Resource Primitives โŒ โŒ โŒ ๐Ÿšง โœ…
Prompt Primitives โŒ โŒ โŒ ๐Ÿšง โœ…
Sample Primitives โŒ โŒ โŒ ๐Ÿšง โœ…
Root Primitives โŒ โŒ โŒ ๐Ÿšง โœ…

Legend:

๐Ÿ“š Documentation

Comprehensive documentation for Laravel Vibes is available in the docs/ directory:

Documentation File Description
TheAgency.md Detailed documentation for TheAgency class, the central orchestrator for MCP primitives
ClassDiagram.md Structural diagram showing relationships between classes
UsageExamples.md Practical examples for using Laravel Vibes in your applications
CONTRIBUTING.md Guidelines for contributing to Laravel Vibes
Flow-Diagrams.md Visual diagrams of Laravel Vibes architecture and workflows
Examples.md Real-world examples of Laravel Vibes implementation
index.md Overview and core concepts documentation

Class Diagram

Below is a simplified class diagram showing the main components of Laravel Vibes:

๐Ÿ”ง Installation

You can install the package via composer:

The package will automatically register its service provider with Laravel.

โš™๏ธ Configuration

Publish the configuration files with:

This will publish the configuration file to config/vibes.php and config/cors.vibes.php.

Key configuration options:

๐Ÿ‘‰ Learn more: For advanced configuration options, see the Configuration section in TheAgency.md.

๐Ÿš€ Usage

Registering Tools

Register AI tools in your service provider:

Or register via the config file:

Defining a Custom Tool

Create a tool that AI agents can use:

Using Server-Sent Events

Connect AI agents to your application using SSE:

Handling AI Agent Messages

Process incoming MCP messages from agents:

๐Ÿ‘‰ Learn more: Detailed usage examples are available in the UsageExamples.md documentation.

๐Ÿ” Tool Discovery & Registration

Laravel Vibes follows a similar approach to Laravel Event Sourcing for loading primitives, using automatic discovery and registration patterns. For more detailed examples, see the UsageExamples.md documentation.

Auto-Discovery

The package automatically discovers and registers tools and other MCP primitives in the configured directories:

During application bootstrapping, Laravel Vibes scans these directories for classes that implement the PrimitiveHandler interface and automatically registers them with TheAgency:

Manual Registration

For manual registration, modify your AppServiceProvider or create a dedicated service provider:

Then add your provider to config/app.php:

Caching Primitives

For production environments, Laravel Vibes provides caching mechanisms to improve performance. The discovered primitives are cached at bootstrap/cache/vibes.php.

To clear the cache during development:

You can also implement a dedicated command to manage the primitive cache (similar to Laravel Event Sourcing's event-sourcing:cache-event-handlers):

๐Ÿงช Comprehensive Testing Guide

This section provides guidance and examples for testing Laravel Vibes components, focusing on custom tools and AI agent interactions.

Unit Testing Custom Tools

Test your custom tools to ensure they properly handle inputs and produce expected outputs:

Mocking External Services

Test tools that interact with external services by mocking the HTTP responses:

Integration Testing with TheAgency

Test the integration of tools with TheAgency:

Testing SSE Connections

Test Server-Sent Events (SSE) connections using the following approach:

Mocking AI Agent Interactions

Test components that interact with AI agents:

PHPUnit Configuration Recommendations

Here's a sample PHPUnit configuration for optimal testing of Laravel Vibes components:

Testing Best Practices

When testing Laravel Vibes components, follow these best practices:

  1. Isolate your tests: Ensure each test is independent and can run in any order.
  2. Use test doubles: Mock external dependencies like HTTP APIs, databases, and services.
  3. Test edge cases: Verify behavior with invalid inputs, error conditions, and boundary values.
  4. Emulate real-world scenarios: Create tests that mirror actual usage patterns.
  5. Test asynchronous behavior: Verify SSE connections and event listeners work correctly.
  6. Use data providers: Test tools with multiple input/output combinations.
  7. Check exception handling: Verify tools throw appropriate exceptions for invalid inputs.
  8. Test middleware independently: Isolate middleware functionality from controller logic.

For detailed example tests, check out the tests directory in the Laravel Vibes repository.

๐Ÿ‘‰ Learn more: For more detailed testing examples and strategies, see the Testing section in UsageExamples.md.

๐Ÿ”„ Laravel 12 Compatibility

Laravel Vibes is designed to be fully compatible with Laravel 12.x, leveraging many of its new features and improvements to provide optimal performance and developer experience.

Version Compatibility Matrix

The following table shows Laravel Vibes package version compatibility with Laravel framework versions:

Laravel Vibes Version Laravel Version PHP Version Status
1.0.x 12.x โ‰ฅ 8.2 Full Support
0.9.x 11.x โ‰ฅ 8.1 Maintained
0.8.x 10.x โ‰ฅ 8.1 Legacy Support
0.7.x 9.x โ‰ฅ 8.0 End of Support

Laravel 12 Features Utilized

Laravel Vibes takes advantage of several new features introduced in Laravel 12:

Improved Rate Limiting

Laravel Vibes uses the enhanced rate limiting capabilities in Laravel 12 to manage AI agent connections and prevent resource abuse:

Route Grouping Improvements

The package uses Laravel 12's improved route group definitions for cleaner organization:

PHP 8.2 Readonly Classes

Laravel Vibes models use PHP 8.2 readonly classes for improved type safety and performance:

First-class Enum Support

Laravel 12's improved support for PHP enums is used throughout the package:

Upgrading from Previous Laravel Versions

If you're upgrading from a previous Laravel version, follow these steps to ensure compatibility with Laravel Vibes:

From Laravel 11.x

  1. Update your dependencies in composer.json:

  2. Run Composer update:

  3. Update configuration if needed:

  4. Update any custom tool implementations to use the new tool signature format:

From Laravel 10.x or Earlier

  1. First upgrade to Laravel 11.x following the official upgrade guide.
  2. Update to Laravel Vibes 0.9.x.
  3. Test thoroughly that all tools and functionality work correctly.
  4. Then follow the steps above to upgrade to Laravel 12 and Laravel Vibes 1.0.x.

Known Issues & Limitations

Session Handling in Laravel 12

Laravel 12 implements stricter session handling. When using SSE connections with Laravel Vibes, you must use the provided ScaffoldSSEConnection middleware to avoid session conflicts:

Service Container Changes

Laravel 12's service container features improved dependency resolution. If you've extended Laravel Vibes core classes, ensure your bindings are properly registered:

Queue System Changes

If you're using Laravel Vibes with background jobs, note that Laravel 12 introduces changes to the queue system:

Composer Requirements

To use Laravel Vibes with Laravel 12, ensure your composer.json includes the following requirements:

Specific extension requirements:

For development environments, we recommend:

๐Ÿ‘‰ Learn more: Check the compatibility documentation for detailed information about supported features and versions.

๐Ÿš€ Deployment Considerations

This section provides guidance for deploying Laravel Vibes in production environments, focusing on performance, scaling, and security considerations.

Production Environment Configuration

When preparing your Laravel Vibes application for production, ensure these environment-specific settings:

Enable production-optimized caching:

Performance Optimization

Optimize your Laravel Vibes application for high traffic and AI agent interactions:

Tool Execution Optimization

Queue Configuration for Tool Processing

Move long-running operations to background queues:

Compression and Response Optimization

Scaling Strategies

Laravel Vibes can be scaled horizontally or vertically depending on your needs:

Horizontal Scaling with Load Balancing

For handling many concurrent AI agent connections:

If implementing horizontal scaling, ensure:

Queue Workers for Tool Processing

Monitoring and Logging

Implement robust monitoring for AI agent interactions:

Log Configuration

Telemetry Integration

Key Metrics to Monitor

Resource Management

AI interactions can be resource-intensive. Configure proper limits:

PHP-FPM configuration for SSE connections:

Security in Production

Implement additional security measures for production:

CORS Configuration

Input Validation

All tool parameters should be thoroughly validated:

Rate Limiting

Configure tiered rate limiting for different operations:

Hosting Platform-Specific Guidelines

Laravel Forge

Docker Deployment

AWS Elastic Beanstalk

For .ebextensions/01-laravel-vibes.config:

These deployment considerations will help ensure your Laravel Vibes application is robust, performant, and secure in production environments. Always test thoroughly in a staging environment that mirrors your production configuration before deploying updates.

๐Ÿ‘‰ Learn more: For detailed performance benchmarks and advanced scaling strategies, see the Deployment section in UsageExamples.md.

๐Ÿ“Š Architecture

Laravel Vibes is built with a modular architecture focusing on these components:

The package uses these Laravel packages:

For a detailed overview of component implementation status, refer to the TheAgency.md documentation files.

๐Ÿ‘‰ Learn more: View the complete class diagram and architectural details in ClassDiagram.md.

๐Ÿ“… Roadmap

Future development plans aligned with our implementation status:

Version Focus Area Planned Features
0.5.0 Resources - Complete Resources primitive implementation
- Resource discovery and access
- Resource validation and transformation
0.6.0 Prompts - Full Prompts primitive support
- Template system for AI interactions
- Prompt chaining and composition
0.7.0 Samples - Samples primitive for model configuration
- Temperature and top-p controls
- Example response generation
0.8.0 Roots - Custom workflow entry points
- Advanced routing for AI interactions
- Contextual session management
1.0.0 Stability - Complete test coverage for all components
- Improved logging and monitoring
- Performance optimizations
- Comprehensive documentation

The current focus is on completing the Resources primitive implementation for the upcoming 0.5.0 release. Contributions are welcome for any of the planned features.

๐Ÿ‘ฅ Credits

๐Ÿ”’ Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

๐Ÿ“„ License

This package is licensed under the MIT License. See the LICENSE.md file for more information.

๐Ÿค Contributing

We welcome contributions to Laravel Vibes! Please see our Contributing Guidelines for details on how to get started, coding standards, and our pull request process.

๐Ÿ”„ Flow Diagrams

Visual diagrams of Laravel Vibes architecture and interaction flows are available in the Flow Diagrams documentation. These diagrams help developers understand how the components work together and implement the package effectively.

๐ŸŒŸ Real-World Examples

For comprehensive real-world implementation examples, check out our Examples documentation. These examples demonstrate practical use cases and implementation patterns to help you get started quickly.


All versions of laravel-vibes with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
spatie/laravel-package-tools Version ^1.14.0
spatie/laravel-data Version ^4.11
lorisleiva/laravel-actions Version ^2.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package projectsaturnstudios/laravel-vibes contains the following files

Loading the files please wait ....