Client

v1.0.0Developer Toolsstable

Client SDK for AI agents — automatically handles payment challenges from MCP servers

clientmcpai-integration
Share:
56
Stars
0
Downloads
0
Weekly
0/5

What is Client?

Client is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to client sdk for ai agents — automatically handles payment challenges from mcp servers

Client SDK for AI agents — automatically handles payment challenges from MCP servers

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Client SDK for AI agents — automatically handles payment cha

Use Cases

Handle payment challenges from MCP servers automatically.
php-mcp

Maintainer

LicenseMIT
Languagephp
Versionv1.0.0
UpdatedMay 15, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx client

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Client

The php-mcp/client library is a PHP SDK that gives PHP applications and AI agents a complete, idiomatic client for the Model Context Protocol, supporting both synchronous and async communication with MCP servers over Stdio and HTTP/SSE transports. It handles the full MCP lifecycle — initialization, tool listing, tool calling, resource reading, prompt retrieval, and resource subscriptions — through a fluent builder API and exposes both blocking and promise-based async variants of every operation. PHP developers building AI agent backends, automation pipelines, or Laravel/Symfony applications that need to connect to MCP servers will find this the most complete PHP-native MCP client available.

Prerequisites

  • PHP 8.1 or later
  • Composer package manager installed
  • A running MCP server to connect to (Stdio or HTTP/SSE-based)
  • Basic familiarity with PHP and PSR-compatible HTTP clients
1

Install via Composer

Add the php-mcp/client package to your PHP project using Composer.

composer require php-mcp/client
2

Configure the server connection

Use the Client builder to define which MCP server to connect to. The example below uses a Stdio transport pointing to a local MCP server script.

use PhpMcp\Client\Client;
use PhpMcp\Client\ServerConfig;
use PhpMcp\Client\Transport\StdioTransport;

$client = Client::make()
    ->withClientInfo('my-app', '1.0.0')
    ->withServerConfig(
        ServerConfig::forStdio(
            command: 'node',
            args: ['/path/to/mcp-server/index.js']
        )
    )
    ->build();
3

Initialize the connection

Call initialize() to perform the MCP handshake and establish the session before making any tool or resource calls.

$client->initialize();
4

List and call tools

Retrieve available tools from the connected MCP server, then call a specific tool with arguments.

$tools = $client->listTools();
foreach ($tools as $tool) {
    echo "Tool: {$tool->name}\n";
}

$result = $client->callTool('search', ['query' => 'PHP MCP documentation']);
echo $result->content;
5

Disconnect when done

Always disconnect cleanly after your operations are complete to release the MCP server process or connection.

$client->disconnect();

Client Examples

Client configuration (Stdio transport)

Complete example of connecting to a local Stdio MCP server, listing tools, calling one, and disconnecting.

<?php
require 'vendor/autoload.php';

use PhpMcp\Client\Client;
use PhpMcp\Client\ServerConfig;

$client = Client::make()
    ->withClientInfo('my-agent', '1.0.0')
    ->withServerConfig(
        ServerConfig::forStdio(
            command: 'node',
            args: ['/path/to/mcp-server/index.js'],
            env: ['DEBUG' => 'mcp*']
        )
    )
    ->build();

$client->initialize();
$tools = $client->listTools();
foreach ($tools as $tool) {
    echo "Available tool: {$tool->name}\n";
}
$client->disconnect();

Prompts to try

This is a PHP library, not a chat-based MCP server. Use these code patterns to interact with any MCP server from a PHP application.

- Connect to an MCP server and list all available tools: $client->listTools()
- Call a specific tool with arguments: $client->callTool('tool_name', ['param' => 'value'])
- Read a resource from the server: $client->readResource('resource://path/to/item')
- Retrieve a named prompt: $client->getPrompt('prompt_name', ['variable' => 'value'])
- Health check the connection: $client->ping()

Troubleshooting Client

Class not found errors after composer require

Run composer dump-autoload after installation. Ensure your PHP file includes require 'vendor/autoload.php' at the top before any use statements.

Connection times out or initialize() hangs

Verify the MCP server command and args in ServerConfig are correct and that the server binary is executable. Test the server independently in a terminal to confirm it starts and outputs valid MCP JSON-RPC on stdout.

callTool() throws a ToolNotFound exception

Call listTools() first to see which tools the connected server actually exposes. Tool names are case-sensitive and must exactly match the name returned by the server.

Frequently Asked Questions about Client

What is Client?

Client is a Model Context Protocol (MCP) server that client sdk for ai agents — automatically handles payment challenges from mcp servers It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Client?

Follow the installation instructions on the Client GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Client?

Client works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Client free to use?

Yes, Client is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "client": { "command": "npx", "args": ["-y", "client"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Client?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides