switon / mcp-client
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
Requires
- php: >=8.3
- psr/event-dispatcher: ^1.0
- psr/log: ^2.0
- switon/ai: ^1.0
- switon/core: ^1.0
- switon/di: ^1.0
- switon/event: ^1.0
- switon/http-client: ^1.0
- switon/tooling: ^1.0
- switon/yaml: ^1.0
Requires (Dev)
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.0
- switon/mcp: ^1.0
- switon/testing: ^1.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
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.ymlnames each server. A key is a stdio command or an HTTP URL. - Connect on first use:
Switon\McpClient\ClientDiscoveryInterfaceregisters 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, andmcp_call. - Catalog command:
mcp-client:listprints 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.