Search by

aisdk / mcp

aisdk

Stateless Model Context Protocol (2026-07-28) client and server for the PHP AI SDK.

Package info

github.com/phpaisdk/mcp

pkg:composer/aisdk/mcp

Fund package maintenance!

Open Collective

Statistics

Installs: 6

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 1

v0.11.0 2026-10-31 02:58 UTC

This package is auto-updated.

Last update: 2026-11-03 18:56:23 UTC


README

A Model Context Protocol client and server for PHP. Expose SDK tools and resources over HTTP or stdio, or use remote MCP tools with any PHP AI SDK provider.

Installation

composer require aisdk/mcp

Usage

<?php

require __DIR__.'/vendor/autoload.php';

use AiSdk\Mcp\Server\Server;
use AiSdk\Mcp\Server\StdioServer;
use AiSdk\Tool;

$server = Server::make('my-tools', '1.0.0')
    ->tool(Tool::make('hello', 'Return a greeting')
        ->run(fn (): string => 'Hello from PHP!'));

(new StdioServer($server))->run();

Save the example as server.php and run it with php server.php. Supports modern MCP and explicit legacy client compatibility.

Documentation

Read the documentation for configuration, supported features, and more examples.

Contributing ยท Support

License

The MIT License (MIT). See LICENSE for details.