Download the PHP package fastmcphp/fastmcphp without Composer

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

Fastmcphp

NOTE:

A PHP 8.2+ implementation of the Model Context Protocol (MCP).

Inspired by FastMCP for Python.

Requirements

Installation

Quick Start

Features

Tools

Define callable functions that can be invoked by MCP clients:

Resources

Expose data via URI-based resources:

Prompts

Define reusable prompt templates:

Transports

Three transport modes are supported:

The HTTP transport automatically detects whether Swoole/OpenSwoole is installed. With Swoole, it runs a high-performance async server with multiple workers. Without Swoole, it uses ReactPHP's event-loop-based HTTP server (async, single-process). Swoole is recommended for production deployments.

Authentication

Implement custom authentication providers for bearer tokens, API keys, or any auth system:

AuthRequest

AuthRequest is the abstraction layer between transports and authentication. It normalizes request data from any transport (Swoole HTTP, built-in PHP HTTP, SSE) so auth providers don't need to know transport details.

Token extraction — use getToken() for automatic priority-based lookup:

  1. X-API-TOKEN header (via getApiToken())
  2. Authorization: Bearer <token> header (via getBearerToken())
  3. ?key=<token> query parameter (via getApiKeyFromQuery())

Available methods:

Method Description
getToken() Get token from any source (priority order above)
getHeader(string $name) Get any header value (case-insensitive)
getBearerToken() Extract token from Authorization: Bearer header
getApiToken() Get X-API-TOKEN header value
getApiKeyFromQuery(string $param = 'key') Get token from query parameter
getQuery(string $key) Get any query parameter

Sending tokens from clients:

Per-Tool Authorization

Control access to individual tools, resources, or prompts:

Middleware

Intercept and modify requests/responses:

Multi-Tenant Workspace Support

Fastmcphp supports multi-tenant architectures through the authentication system:

Usage with Claude Code

Add your MCP server to .mcp.json in your project root (or ~/.claude/.mcp.json for global access):

Stdio transport (subprocess — Claude Code manages the process):

HTTP transport (remote — start the server separately):

HTTP with authentication:

Testing

MCP Protocol Support

Feature Status
Tools ✅
Resources ✅
Resource Templates ✅
Prompts ✅
Stdio Transport ✅
HTTP Transport ✅
SSE Transport ✅
Authentication ✅
Middleware ✅
Per-Component Auth ✅
Scopes ✅
Multi-Tenant ✅
Pagination ❌

License

MIT


All versions of fastmcphp with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
psr/log Version ^3.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 fastmcphp/fastmcphp contains the following files

Loading the files please wait ...