Yardstick MCP Client
A command-line client for interacting with Model Context Protocol (MCP) servers.
Overview
The client connects to MCP servers using various transport mechanisms and allows you to:
- Get server information and connection status
- List available tools and resources
- Call tools with JSON arguments
Usage
./client [flags]
Command-Line Flags
| Flag |
Type |
Default |
Description |
-transport |
string |
stdio |
Transport type: stdio, sse, or streamable-http |
-address |
string |
localhost |
Server address (for HTTP-based transports) |
-port |
int |
8080 |
Server port (for HTTP-based transports) |
-command |
string |
"" |
Command to run for stdio transport (required for stdio) |
-timeout |
duration |
30s |
Connection timeout |
-action |
string |
info |
Action to perform: info, list-tools, list-resources, call-tool |
-tool |
string |
"" |
Tool name to call (required for call-tool action) |
-args |
string |
"{}" |
Tool arguments as JSON (for call-tool action) |
Environment Variables
Configuration can also be set via environment variables:
MCP_TRANSPORT: Override transport type
ADDRESS: Override server address
PORT: Override server port
COMMAND: Override command for stdio transport
Transport Types
stdio (default)
Uses standard input/output for communication with a subprocess:
./client -transport=stdio -command="./server" -action=info
sse
Server-Sent Events over HTTP:
./client -transport=sse -address=localhost -port=8080 -action=list-tools
streamable-http
HTTP POST requests for JSON-RPC communication:
./client -transport=streamable-http -address=localhost -port=8080 -action=call-tool -tool=echo -args='{"input":"test123"}'
Actions
info (default)
Get server information including session ID, connection status, and available tools/resources count:
./client -action=info
List all available tools from the server with their descriptions:
./client -action=list-tools
list-resources
List all available resources from the server with their descriptions:
./client -action=list-resources
Call a specific tool with provided JSON arguments:
./client -action=call-tool -tool=echo -args='{"input":"hello world"}'
Examples
./client -transport=stdio -command="./my-mcp-server"
./client -transport=sse -address=api.example.com -port=3000 -action=list-tools
./client -action=call-tool -tool=process-data -args='{"input": {"data": [1,2,3], "format": "json"}}'
Using environment variables
export MCP_TRANSPORT=sse
export ADDRESS=remote.example.com
export PORT=3000
./client -action=list-resources