Download the PHP package mcp/sdk without Composer

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

MCP PHP SDK

[![Latest Version](https://img.shields.io/packagist/v/mcp/sdk.svg)](https://packagist.org/packages/mcp/sdk) [![CI](https://github.com/modelcontextprotocol/php-sdk/actions/workflows/pipeline.yaml/badge.svg)](https://github.com/modelcontextprotocol/php-sdk/actions/workflows/pipeline.yaml) [![PHP Version](https://img.shields.io/packagist/php-v/mcp/sdk.svg)](https://packagist.org/packages/mcp/sdk) [![License](https://img.shields.io/packagist/l/mcp/sdk.svg)](LICENSE) [![Server Conformance](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/modelcontextprotocol/php-sdk/badges/server-conformance.json)](https://github.com/modelcontextprotocol/php-sdk/actions/workflows/conformance-weekly.yaml) [![Client Conformance](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/modelcontextprotocol/php-sdk/badges/client-conformance.json)](https://github.com/modelcontextprotocol/php-sdk/actions/workflows/conformance-weekly.yaml)

The official PHP SDK for Model Context Protocol (MCP). It provides a framework-agnostic API for implementing MCP servers and clients in PHP.

This project represents a collaboration between the PHP Foundation and the Symfony project. It adopts development practices and standards from the Symfony project, including Coding Standards and the Backward Compatibility Promise.

Until the first major release, this SDK is considered experimental, please see the roadmap for planned next steps and features.

Table of Contents

Installation

Overview

The MCP PHP SDK provides both server and client implementations for the Model Context Protocol, enabling you to:

Server SDK

Build MCP servers to expose your PHP application's capabilities to AI agents like Claude, Codex, and others.

Quick Start

Server Capabilities

Registration Methods

There are multiple ways to register your MCP capabilities—choose the approach that best fits your application's architecture:

1. Attribute-Based Discovery — Define capabilities using PHP attributes for automatic discovery:

2. Manual Registration — Register capabilities programmatically without attributes:

3. Hybrid Approach — Combine both methods for maximum flexibility:

Transports

Choose the transport that matches your deployment environment:

1. STDIO Transport — For command-line integration and local processes:

2. HTTP Transport — For web-based servers and distributed systems:

Session Management

Configure session storage to maintain state between requests. Choose the backend that fits your infrastructure:

In-Memory (default, suitable for STDIO):

File-Based (suitable for single-server HTTP deployments):

PSR-16 Cache (for example with Redis for scaled deployments):

→ Server Documentation

Client SDK

Connect to MCP servers from your PHP applications to access their tools, resources, and prompts.

Quick Start

Client Capabilities

Advanced Features

Transports

Connect to MCP servers using the transport that matches your setup:

1. STDIO Transport — Connect to local server processes:

2. HTTP Transport — Connect to remote or web-based servers:

→ Client Documentation

Documentation

Core Concepts

Learning & Examples

External Resources

PHP Libraries Using the MCP SDK

Building something on top of the SDK? Open a pull request to add it to this list.

Contributing

We are passionate about supporting contributors of all levels of experience and would love to see you get involved in the project.

See the send pull requests.

Credits

The starting point for this SDK was the PHP-MCP project, initiated by Kyrian Obikwelu, and the Symfony AI initiative. We are grateful for the work done by both projects and their contributors, which created a solid foundation for this SDK.

License

This project is licensed under the Apache License, Version 2.0 for new contributions, with existing code under the MIT License — see the LICENSE file for details.


All versions of sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-fileinfo Version *
opis/json-schema Version ^2.4
php-http/discovery Version ^1.20
phpdocumentor/reflection-docblock Version ^5.6 || ^6.0
psr/clock Version ^1.0
psr/container Version ^1.0 || ^2.0
psr/event-dispatcher Version ^1.0
psr/http-client Version ^1.0
psr/http-factory Version ^1.1
psr/http-message Version ^1.1 || ^2.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0
psr/log Version ^1.0 || ^2.0 || ^3.0
symfony/uid Version ^5.4 || ^6.4 || ^7.3 || ^8.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 mcp/sdk contains the following files

Loading the files please wait ...