Download the PHP package opgginc/laravel-mcp-server without Composer

On this page you can find all versions of the php package opgginc/laravel-mcp-server. 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-mcp-server

Laravel MCP Server by OP.GG

Build a route-first MCP server in Laravel and Lumen

Build Status Total Downloads Latest Stable Version License

Official Website

English | Português do Brasil | 한국어 | Русский | 简体中文 | 繁體中文 | Polski | Español

Breaking Changes 2.0.0

Full migration guide: docs/migrations/v2.0.0-migration.md

Overview

Laravel MCP Server provides route-based MCP endpoint registration for Laravel and Lumen.

Key points:

Requirements

Quick Start

1) Install

2) Register an endpoint (Laravel)

If you need compatibility with clients that do not support 2025-11-25, set:

3) Verify

Quick JSON-RPC check:

Dynamic Tool Filtering by Query String

If one endpoint needs to expose different tool sets based on the incoming URL, attach a dynamic tools resolver to the route. The resolver owns both the declared tool catalog for the endpoint and the per-request visible subset.

Example requests:

The same filtered tool set is applied consistently to:

If the same endpoint also uses POST /tools/{tool_name}, you can optionally expose a public consumedQueryParameters(): array hook on the resolver for query keys that should be used only for filtering and not forwarded as tool arguments. This hook is a documented convention and is not part of DynamicToolResolverInterface; resolvers that omit it will forward those query keys as tool arguments.

Lumen Setup

Minimal Security (Production)

Use Laravel middleware on your MCP route group.

v2.0.0 Migration Notes (from v1.0.0)

Full guide: docs/migrations/v2.0.0-migration.md

Advanced Features (Quick Links)

Code references:

Swagger/OpenAPI -> MCP Tool

Generate MCP tools from a Swagger/OpenAPI spec:

Useful options:

Generation behavior:

Enhanced Interactive Preview

If you run the command without --group-by, the generator shows an interactive preview of folder structure and file counts before creation.

Example preview output:

After generation, register generated tool classes on your MCP endpoint:

MCP Tools -> OpenAPI Export

Export all registered ToolInterface classes (via Route::mcp(...)->tools([...]) or ->dynamicTools(...)) to an OpenAPI JSON document using each tool's inputSchema(). Only endpoints configured with ->enabledApi() are included in this export and exposed through POST /tools/{tool_name}. Operations are grouped by endpoint name using OpenAPI tags. If multiple endpoints register the same tool name, the operation keeps first-registration behavior and merges all matching endpoint names into tags. If route registration is missing, the command auto-discovers tools under default paths: app/MCP/Tools and app/Tools.

Enable Tool API route generation:

Swagger UI testing tip:

Example Tool Class

JsonSchema Builder (Laravel-Style)

This package provides its own JsonSchema builder under the OPGG\LaravelMcpServer namespace. You can define tool schemas in a Laravel 12-style fluent format while keeping inputSchema(): array.

Notes:

Example Prompt Class

Example Resource Class

Register Examples on a Route

Testing and Quality Commands

Translation

Translate selected languages:

License

This project is distributed under the MIT license.


All versions of laravel-mcp-server with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^9.0||^10.0||^11.0||^12.0||^13.0
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 opgginc/laravel-mcp-server contains the following files

Loading the files please wait ...