mcp-tools-cli

The mcp-tools-cli repository provides a command-line interface for interacting with Model Context Protocol (MCP) servers, allowing users to list available tools and call specific tools with optional arguments using a configuration file.

1
0

mcp-tools-cli

This is a command-line client designed for interacting with Model Context Protocol (MCP) servers.

Installation

Install mcp-tools-cli using pip:

pip install mcp-tools-cli

Configuration

The client relies on a mcp_config.json file to store MCP server connection details. This file defines the servers, their execution commands, arguments, and environment variables. An example configuration is:

{
  "mcpServers": {
    "time": {
      "command": "python",
      "args": ["-m", "mcp_server_time", "--local-timezone=America/New_York"]
    }
  }
}

Usage

mcp-tools-cli <action> --mcp-name <mcp_name> [options]

The client supports two primary actions: list-tools to discover available tools on an MCP server, and call-tool to execute a specific tool. The --mcp-name argument specifies the target server from the configuration. For call-tool, the --tool-name is required, and --tool-args allows passing arguments as a JSON string or a simple query. The --config-path option specifies the location of the configuration file.

Examples include listing tools and calling the get_current_time tool on a Time MCP Server. Error handling covers scenarios like missing configuration files, invalid JSON, and command-line argument errors.

Repository

MO
moritalous

moritalous/mcp-tools-cli

Created

March 23, 2025

Updated

March 23, 2025

Language

Python

Category

Developer Tools