Download the PHP package kirschbaum-development/laravel-loop without Composer

On this page you can find all versions of the php package kirschbaum-development/laravel-loop. 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-loop

Laravel Loop

Laravel Supported Versions Latest Version on Packagist

Laravel Loop is a powerful Model Context Protocol (MCP) server designed specifically for Laravel applications. It connects your Laravel application with AI assistants using the MCP protocol.

Laravel Loop uses Prism behind the scenes to build the tools.

[!IMPORTANT] Laravel Loop and its pre-built tools are still in development and this is a beta version.

What It Does

Laravel Loop allows you to:

Pre-built tools:

Installation

You can install the package via composer:

Publish the configuration file:

Usage

First, you must register your tools (If you don't know where to put, put in app/Providers/AppServiceProvider).

Custom Tools

To build your own tools, you can use the Loop::tool method.

The available parameters types can be found in the Prism Tool Documentation.

Custom Tool Objects

You can also build your own tool classes. Each tool must implement the Tool contract, and return a Prism\Prism\Tool instance in the build method.

If you want to provide multiple similar tools, you can build a toolkit which returns a collection of tools.


Connecting to the MCP server

For this to be really useful, you need to connect your MCP client (Claude Code, Claude Desktop, Cursor, Windsurf, etc) to the Laravel LoopMCP server.

The MCP protocol has two main transports to connect: STDIO and Streamable HTTP, and the deprecated HTTP+SSE transport. Laravel Loop supports all of them.

The easiest way to configure your MCP client is to use the php artisan loop:mcp:config command. This will guide you through the process of configuring your MCP client.

STDIO

To run the MCP server using STDIO, we provide the following artisan command:

To connect Laravel Loop MCP server to Claude Code, for example, you can use the following command:

To configure Laravel Loop in Cursor, Claude or any MCP clients with a JSON config file:

Streamable HTTP & SSE

Having to run PHP or Node to run the MCP server can be annoying. To avoid this, you can use the Streamable HTTP or SSE transport, which connects the MCP client directly to your application via HTTP.

Laravel Loop also supports the streamable HTTP transport and the deprecated HTTP+SSE transport.

[!IMPORTANT] NOTE: The Streamable HTTP transport is new and not yet supported by all MCP clients, while the SSE (supported by most MCP clients) is deprecated.

The following docs are for both transports. Please note you only need to enable one of them.

1. Enable and configure the transport

To enable the Streamable HTTP transport, update your .env file:

Note: When using SSE, the default driver is file, which is the simplest and most convenient for local development. However, for production, we recommend using redis to avoid issues with file locking. You can change the driver and additional options in the config/loop.php file.

This will expose two MCP endpoints:

Note: If you are running your application locally with https, most clients will fail due to the self-signed certificates. To avoid this, use the STDIO transport or use the http protocol locally.

2. Configure authentication (optional)

Be aware that if you are exposing your endpoint publicly, you are exposing your data to the world. To ensure your MCP endpoints are secure, make sure to configure the streamable_http.middleware or sse.middleware config options. We recommend using something like Sanctum (configured by default) to protected the endpoint.

3. Add the MCP server to your client

Then, you just need to configure the MCP server endpoint in your client:

Claude Code

From JSON config file

Please note that not all clients support direct SSE connections. For those situations, you can proxy it through the mcp-remote package. This requires you to have Node.js (> 20) installed. Below an example using the mcp-remote package.


Troubleshooting

Connection failed: MCP error -32000: Connection closed

If you get this error, it likely means there's some error happening in your application. Check your applicationlogs for more details.

Error: spawn php ENOENT

This can happen when your "php" binary is not in the PATH. This can be solved in a few ways:

Manually call tools and verify output

Sometimes when building tools, you may be getting unexpected results and debugging from the MCP client can be difficult. You can manually call tools and verify the output by running the following command:

Make sure to check your application logs

If you are getting an unkown error, check your application logs for more details.


Roadmap

Security

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

Sponsorship

Development of this package is sponsored by Kirschbaum Development Group, a developer driven company focused on problem solving, team building, and community. Learn more about us or join us!

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-loop with dependencies

PHP Build Version
Package Version
Requires spatie/laravel-package-tools Version ^1.18
illuminate/support Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0
prism-php/prism Version ^0.56.0
react/event-loop Version ^1.5
react/stream Version ^1.4
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 kirschbaum-development/laravel-loop contains the following files

Loading the files please wait ....