Cover image
Try Now
2025-03-23

command-line client for interacting with Model Context Protocol (MCP) servers.

3 years

Works with Finder

1

Github Watches

1

Github Forks

1

Github Stars

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 in mcp_config.json.
  • --tool-name (required for call-tool action): 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 the query argument to the tool.
  • --config-path (optional): Path to the mcp_config.json file. Defaults to mcp_config.json in 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:

{
  "mcpServers": {
    "<mcp_name>": {
      "command": "<command to run the server>",
      "args": ["<argument1>", "<argument2>", ...],
      "env": {
        "<environment variable name>": "<environment variable value>",
        ...
      }
    },
    ...
  }
}

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-time beforehand.

  1. List available tools:
mcp-tools-cli list-tools --mcp-name time --config-path mcp_config.sample.json
  1. Call the get_current_time tool 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.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Lists Tailwind CSS classes in monospaced font

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • Discover the most comprehensive and up-to-date collection of MCP servers in the market. This repository serves as a centralized hub, offering an extensive catalog of open-source and proprietary MCP servers, complete with features, documentation links, and contributors.

  • ShrimpingIt
  • Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx

  • huahuayu
  • A unified API gateway for integrating multiple etherscan-like blockchain explorer APIs with Model Context Protocol (MCP) support for AI assistants.

  • deemkeen
  • control your mbot2 with a power combo: mqtt+mcp+llm

  • jae-jae
  • MCP server for fetch web page content using Playwright headless browser.

    Reviews

    1 (1)
    Avatar
    user_oF76JCkq
    2025-04-16

    The Vibe-Coder MCP Server by crazyrabbitLTC has revolutionized my coding experience! It's user-friendly and offers robust features that cater to all my development needs. The seamless integration and efficient performance make it a must-have for any serious coder. Highly recommend checking it out at https://mcp.so/server/mcp-vibecoder/crazyrabbitLTC!