MCP ExplorerExplorer

Mcp Bundle

@php-llmon 9 months ago
5 MIT
FreeCommunity
AI Systems
Symfony integration bundle for Model Context Protocol (via php-llm/mcp-sdk)

Overview

What is Mcp Bundle

mcp-bundle is a Symfony integration bundle designed for the Model Context Protocol (MCP), utilizing the unofficial PHP SDK php-llm/mcp-sdk.

Use cases

Use cases include creating applications that serve as MCP servers to expose AI tools to clients, such as Claude Desktop, and potentially integrating with other MCP servers in the future.

How to use

To use mcp-bundle, first decide if your application will act as an MCP server or client. Configure the mcp section in your config/packages/mcp.yaml file to set up the desired transport methods (STDIO or SSE) for server functionality.

Key features

Key features include the ability to expose tools as an MCP server through Server-Sent Events (SSE) and STDIO. It currently supports only server functionalities for tools.

Where to use

mcp-bundle can be used in applications that require integration with the Model Context Protocol, particularly in environments that leverage AI tools and services.

Content

MCP Bundle [WIP]

Symfony integration bundle for Model Context Protocol using the unofficial
PHP SDK php-llm/mcp-sdk library.

Currently only supports tools as server via Server-Sent Events (SSE) and STDIO.

Installation

composer require php-llm/mcp-bundle

Usage

At first, you need to decide whether your application should act as a MCP server or client. Both can be configured
in the mcp section of your config/packages/mcp.yaml file.

Act as Server

Currently only supports tools.

To use your application as an MCP server, exposing tools to clients like Claude Desktop,
you need to configure in the client_transports section the transports you want to expose to clients.
You can use either STDIO or SSE.

Act as Client

Not implemented yet.

To use your application as an MCP client, integrating other MCP servers, you need to configure the servers you want to
connect to. You can use either STDIO or Server-Sent Events (SSE) as transport methods.

You can find a list of example Servers in the MCP Server List.

Tools of those servers are available in your LLM Chain Bundle
configuration and usable in your chains.

Configuration

mcp:
    app: 'app' # Application name to be exposed to clients
    version: '1.0.0' # Application version to be exposed to clients

    # Configure this application to act as an MCP server
    # Currently exposes tools registered in LLM Chain
    client_transports:
        stdio: true # Enable STDIO via command
        sse: true # Enable Server-Sent Event via controller
    
    # Configure MCP servers to be used by this application
    # Not implemented yet
    servers:
        name:
            transport: 'stdio' # Transport method to use, either 'stdio' or 'sse'
            stdio:
                command: 'php /path/bin/console mcp' # Command to execute to start the client
                arguments: [] # Arguments to pass to the command
            sse:
                url: 'http://localhost:8000/sse' # URL to SSE endpoint of MCP server

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers