Search by

switon / mcp-client

switon

Model Context Protocol client: transports, server catalog, and mcp_servers, mcp_tools, mcp_schema, mcp_call for Switon Framework

v1.0.0 2026-08-22 14:34 UTC

This package is auto-updated.

Last update: 2026-11-23 14:46:32 UTC


README

MCP Client CI PHP 8.3+

Switon's Model Context Protocol client: a server catalog, stdio and streamable HTTP transports, and four agent tools for listing and calling remote tools.

Highlights

  • One file, many servers: ~/.switon/mcp.yml names each server. A key is a stdio command or an HTTP URL.
  • Connect on first use: Switon\McpClient\ClientDiscoveryInterface registers a lazy client per server. A tool call opens it.
  • Two transports: newline-delimited JSON-RPC over stdio, or one POST per message over streamable HTTP.
  • Four agent tools: mcp_servers, mcp_tools, mcp_schema, and mcp_call.
  • Catalog command: mcp-client:list prints each client's id and brief. It does not connect.

Installation

composer require switon/mcp-client

Quick Start

docs:
  command: bash
  args: [bin/mcp-serve]
github:
  url: https://example.com/mcp
  headers:
    Authorization: Bearer token

Save that as ~/.switon/mcp.yml. An installed app then exposes mcp_servers, mcp_tools, mcp_schema, and mcp_call. A server id must not contain _.

Docs: https://github.com/switon-php/mcp-client/blob/main/docs/README.md

License

MIT.