- Explore MCP Servers
- mcp-tools-cli
Mcp Tools Cli
What is Mcp Tools Cli
mcp-tools-cli is a command-line client designed for interacting with Model Context Protocol (MCP) servers, facilitating communication and operations on these servers.
Use cases
Use cases for mcp-tools-cli include automating data retrieval from MCP servers, executing specific tools for data analysis, and managing server configurations for different environments.
How to use
To use mcp-tools-cli, install it via pip with ‘pip install mcp-tools-cli’. Configure the connection details in a JSON file named ‘mcp_config.json’. Then, execute commands using the syntax: ‘mcp-tools-cli
Key features
Key features of mcp-tools-cli include the ability to list available tools on MCP servers, call specific tools with arguments, and manage multiple MCP server configurations through a single configuration file.
Where to use
mcp-tools-cli can be used in various fields that require interaction with MCP servers, such as data processing, automation tasks, and integration with other software systems.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Mcp Tools Cli
mcp-tools-cli is a command-line client designed for interacting with Model Context Protocol (MCP) servers, facilitating communication and operations on these servers.
Use cases
Use cases for mcp-tools-cli include automating data retrieval from MCP servers, executing specific tools for data analysis, and managing server configurations for different environments.
How to use
To use mcp-tools-cli, install it via pip with ‘pip install mcp-tools-cli’. Configure the connection details in a JSON file named ‘mcp_config.json’. Then, execute commands using the syntax: ‘mcp-tools-cli
Key features
Key features of mcp-tools-cli include the ability to list available tools on MCP servers, call specific tools with arguments, and manage multiple MCP server configurations through a single configuration file.
Where to use
mcp-tools-cli can be used in various fields that require interaction with MCP servers, such as data processing, automation tasks, and integration with other software systems.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
mcp-tools-cli
This is a command-line client for interacting with Model Context Protocol (MCP) servers.
Installation
You can install mcp-tools-cli using pip:
pip install mcp-tools-cli
Configuration
The client uses a configuration file named mcp_config.json to store the connection details for MCP servers. Create a file named mcp_config.json with the following content:
{
"mcpServers": {
"time": {
"command": "python",
"args": [
"-m",
"mcp_server_time",
"--local-timezone=America/New_York"
]
}
}
}
Replace the values with your own MCP server configurations.
Usage
mcp-tools-cli <action> --mcp-name <mcp_name> [options]
Arguments
action(required): The action to perform. Must be one of:list-tools: Lists the available tools on the MCP server.call-tool: Calls a specific tool on the MCP server.
--mcp-name(required): The name of the MCP server to connect to, as defined inmcp_config.json.--tool-name(required forcall-toolaction): The name of the tool to call.--tool-args(optional): Arguments for the tool. Can be a JSON string or a single string value. If a single string value is not a valid JSON, it will be passed as thequeryargument to the tool.--config-path(optional): Path to themcp_config.jsonfile. Defaults tomcp_config.jsonin the current directory.
Configuration
The client uses a configuration file named mcp_config.json to store the connection details for MCP servers. The file should be in the following format:
Replace <mcp_name> with the name of your MCP server (e.g., time). The command, args, and env fields specify how to run the server.
Examples
A sample using the Time MCP Server is provided in mcp_config.sample.json. If you want to use this, please execute
pip install mcp-server-timebeforehand.
- List available tools:
mcp-tools-cli list-tools --mcp-name time --config-path mcp_config.sample.json
- Call the
get_current_timetool with a query:
mcp-tools-cli call-tool --mcp-name time --tool-name get_current_time --config-path mcp_config.sample.json
Error Handling
The client will print error messages to the console if any errors occur, such as:
- FileNotFoundError: If the config file is not found.
- json.JSONDecodeError: If the config file is not a valid JSON file.
- ValueError: If the MCP server is not found in the config file, or if the command is missing.
- argparse.ArgumentError: If there are invalid command-line arguments.
- Other exceptions during tool execution.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










