1. Conduid
  2. AI
  3. Client
MCP server · AI

Client

Model Context Protocol client implementation in PHP

Unclaimed MIT ai
34Low

Scored 7 days ago · breakdown

About Client

Client is an MCP server published by swisnl in the AI category: model Context Protocol client implementation in PHP.

The repository has 8 stars and 3 forks, with the last commit 4 months ago. Recent commit activity is the strongest signal that reported issues will get attention.

Install

From source
git clone https://github.com/swisnl/mcp-client

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Client

Powered by Claude · Grounded in docs

I know everything about Client. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 3 days ago. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • ✓License declaredUsable under a stated license.
  • ✓Tests presentA test suite exists in the repository.
  • !Dependencies pinnedNo lockfile. Installs can pull different code over time.
  • ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.

1 check has not been run yet.

Releases

0.7.00.7.0 · 2 Mar 2026What's Changed Support streamed JSON body in StreamableHttpTransporter by @ATLCTO in https://github.com/swisnl/mcp-client/pull/19 New Contributors @ATLCTO made their first contribution in https://github.com/swisnl/mcp-client/pull/19 Full…
0.6.10.6.1 · 19 Feb 2026Full Changelog: https://github.com/swisnl/mcp-client/compare/0.6.0...0.6.1 Fix: Empty `_metadata` is not allowed, do not send Metadata when empty Fix: `data` returned within a JsonRpc Error is not always an array, cast to array
0.6.00.6.0 · 18 Feb 2026What's Changed Fix Streamable HTTP response dispatch and request awaiting lifecycle by @jormeijer in https://github.com/swisnl/mcp-client/pull/17 Full Changelog: https://github.com/swisnl/mcp-client/compare/0.5.1...0.6.0
0.5.10.5.1 · 17 Feb 2026What's Changed feat: Add support for custom headers by @jormeijer in https://github.com/swisnl/mcp-client/pull/15 Full Changelog: https://github.com/swisnl/mcp-client/compare/0.5.0...0.5.1
0.5.00.5.0 · 5 Jan 2026What's Changed build(deps): bump actions/checkout from 5 to 6 by @dependabot[bot] in https://github.com/swisnl/mcp-client/pull/12 build(deps): bump dependabot/fetch-metadata from 2.4.0 to 2.5.0 by @dependabot[bot] in…

README

Model Context Protocol client implementation for PHP

PHP from Packagist Latest Version on Packagist Software License Buy us a tree Build Status Made by SWIS

A PHP client library for interacting with Model Context Protocol (MCP) servers.

Installation

You can install the package via composer:

composer require swisnl/mcp-client

Requirements

Features

  • Multiple transport mechanisms:
    • SSE (Server-Sent Events)
    • Stdio (Standard input/output)
    • Process (External process communication)
    • StreamableHttp (HTTP with session management)
  • Promise-based API with ReactPHP
  • PSR-3 Logger interface support
  • Most of MCP protocol support (2025-03-26)
  • Tool annotation support
  • _meta support

Basic Usage

SSE Transport

use Swis\McpClient\Client;

// Create client with SSE transporter
$endpoint = 'https://your-mcp-server.com/sse';
$client = Client::withSse(
    $endpoint,
    headers: ['Authorization' => 'Bearer your-token']
);

// Connect to the server
$client->connect(function($initResponse) {
    echo "Connected to server: " . json_encode($initResponse['serverInfo']) . "\n";
});

// List available tools
$tools = $client->listTools();
foreach ($tools->getTools() as $tool) {
    echo "- {$tool->getName()}: {$tool->getDescription()}\n";
    
    // Access tool annotations if available
    if ($annotations = $tool->getAnnotations()) {
        echo "  * Read-only: " . ($annotations->getReadOnlyHint() ? 'Yes' : 'No') . "\n";
        echo "  * Title: " . ($annotations->getTitle() ?? 'N/A') . "\n";
    }
}

// Call a tool
$result = $client->callTool('echo', ['message' => 'Hello World!']);
echo $result->getResult() . "\n";

Process Transport

use Swis\McpClient\Client;

// Create client with a process transporter
[$client, $process] = Client::withProcess('/path/to/mcp-server/binary');

// Connect to the server
$client->connect();

// Use the client...

// Disconnect when done
$client->disconnect();

StreamableHttp Transport

use Swis\McpClient\Client;

// Create client with StreamableHttp transporter
$endpoint = 'https://your-mcp-server.com/';
$client = Client::withStreamableHttp(
    $endpoint,
    headers: ['Authorization' => 'Bearer your-token']
);

// Connect to the server
$client->connect();

// The transporter will automatically manage session IDs from the Mcp-Session-Id header

// Use the client...

// Disconnect when done
$client->disconnect();

Use in combination with Agents SDK

First, install Agents SDK

composer require swisnl/agents-sdk
use Swis\Agents\Agent;
use Swis\Agents\Mcp\McpConnection;
use Swis\McpClient\Client;
use Swis\Agents\Orchestrator;

$agent = new Agent(
    name: 'Calculator Agent',
    description: 'This Agent can perform arithmetic operations.',
    mcpConnections: [
        new MathMcpConnection(),
    ]
);

$orchestrator = new Orchestrator($agent);
echo $orchestrator
        ->withUserInstruction('What\'s 5 + 5?')
        ->run($agent)

class MathMcpConnection extends McpConnection
{
    public function __construct()
    {
        [$client, $process] = Client::withProcess(
            command: 'node ' . realpath(__DIR__ . '/node_modules/math-mcp/build/index.js'),
        );

        parent::__construct(
            client: $client,
            name: 'Math MCP',
        );
    }
}

Advanced Usage

Metadata

You can send metadata using the _meta parameter:

use Swis\McpClient\Requests\CallToolRequest

$request = new CallToolRequest('search');
$request->withMeta(['traceparent' => '0000-0000-00-00x']);

Custom Transporter

You can implement your own transporter by implementing the TransporterInterface:

use Swis\McpClient\TransporterInterface;
use Swis\McpClient\EventDispatcher;

class CustomTransporter implements TransporterInterface
{
    // Implement required methods
}

// Create a client with your custom transporter
$transporter = new CustomTransporter();
$eventDispatcher = new EventDispatcher();
$client = new Client($transporter, $eventDispatcher);

Async Operations

The client supports async operations using ReactPHP promises:

$client->sendRequest(new ListToolsRequest())->then(...);

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

This package is open-sourced software licensed under the MIT license.

This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

SWIS :heart: Open Source

SWIS is a web agency from Leiden, the Netherlands. We love working with open source software.

README fetched from the repository 3 days ago. The original is authoritative.

Questions

About Client

How do I install Client?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Client safe to use with an AI agent?

Its trust score is 34 out of 100 (low). It passes 4 of the 5 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Client still maintained?

Yes — the last commit was 4 months ago. The repository has 8 stars and 3 forks.