Download the PHP package klapaudius/symfony-mcp-server without Composer

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

Symfony MCP Server

A powerful Symfony package to build a Model Context Protocol Server seamlessly

Build Status Coverage License [//]: # (Latest Stable Version) [//]: # (Total Downloads)

Overview

Symfony MCP Server is a powerful package designed to streamline the implementation of Model Context Protocol (MCP) servers in Symfony applications. This package utilizes Server-Sent Events (SSE) transport, providing a secure and controlled integration method.

Why SSE instead of STDIO?

While stdio is straightforward and widely used in MCP implementations, it has significant security implications for enterprise environments:

By implementing the MCP server with SSE transport, enterprises can:

Key benefits:

Key Features

Requirements

Installation

  1. Create the configuration file config/packages/klp_mcp_server.yaml and paste into it:

    For more detailed explanations, you can open the default configuration file from that link.

  2. Install the package via Composer:

  3. Add routes in your config/routes.yaml

You're all done! Upon completing this setup, your project will include two new API endpoints:

Docker Setup (Optional)

The project includes a Docker setup that can be used for development. The Docker setup includes Nginx, PHP-FPM with Redis extension, and Redis server.

For detailed instructions on how to set up and use the Docker containers, please refer to the Development Guidelines.

Strongly Recommended

Enhance your application's security by implementing OAuth2 Authentication. You can use the klapaudius/oauth-server-bundle or any other compatible OAuth2 solution.

Basic Usage

Creating and Adding Custom Tools

The package provides convenient Artisan commands to generate new tools:

This command:

You can also manually create and register tools in config/packages/klp_mcp_server.yaml:

Testing MCP Tools

The package includes a special command for testing your MCP tools without needing a real MCP client:

This helps you rapidly develop and debug tools by:

For deep diving into tools creation please take a look at dedicated documentation Here

Visualizing MCP Tools with Inspector

You can also use the Model Context Protocol Inspector to visualize and test your MCP tools:

This will typically open a web interface at localhost:6274. To test your MCP server:

  1. Warning: symfony server:start CANNOT be used with this package because it cannot handle multiple PHP connections simultaneously. Since MCP SSE requires processing multiple connections concurrently, you must use one of these alternatives:

    • Nginx + PHP-FPM
    • Apache + PHP-FPM
    • Custom Docker setup
    • Any web server that properly supports SSE streaming
  2. In the Inspector interface, enter your Symfony server's MCP SSE URL (e.g., http://localhost:8000/mcp/sse)
  3. Connect and explore available tools visually

The SSE URL follows the pattern: http(s)://[your-web-server]/[default_path]/sse where default_path is defined in your config/packages/klp_mcp_server.yaml file.

Advanced Features

Pub/Sub Architecture with SSE Adapters

The package implements a publish/subscribe (pub/sub) messaging pattern through its adapter system:

  1. Publisher (Server): When clients send requests to the /messages endpoint, the server processes these requests and publishes responses through the configured adapter.

  2. Message Broker (Adapter): The adapter maintains message queues for each client, identified by unique client IDs. This provides a reliable asynchronous communication layer.

  3. Subscriber (SSE Connection): Long-lived SSE connections subscribe to messages for their respective clients and deliver them in real-time.

This architecture enables:

Redis Adapter Configuration (Optional)

A Redis adapter can be configured as follows:

Roadmap

We are committed to actively pursuing the following key initiatives to enhance the package's functionality and ensure compliance with evolving standards.

Credits

License

This project is distributed under the MIT license.


All versions of symfony-mcp-server with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
ext-fileinfo Version *
psr/log Version ^3.0
symfony/cache Version ^7.2
symfony/config Version ~7.0
symfony/console Version ~7.0
symfony/dependency-injection Version ~7.0
symfony/finder Version ~7.0
symfony/http-foundation Version ~7.0
symfony/http-kernel Version ~7.0
symfony/routing Version ~7.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 klapaudius/symfony-mcp-server contains the following files

Loading the files please wait ....