command-line client for interacting with Model Context Protocol (MCP) servers.
Project description
mcp-tools-cli
This is a command-line client for interacting with Model Context Protocol (MCP) servers.
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:
{
"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-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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_tools_cli-0.1.0.tar.gz.
File metadata
- Download URL: mcp_tools_cli-0.1.0.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3a178e4150c4b98241ea93534d757d49fa12d2a82bd6fa7bf6f0ce3c69e305f
|
|
| MD5 |
24bd836623231f31e7910773f3560dd4
|
|
| BLAKE2b-256 |
2f884690db62ff8d945c2888dde02f54ec012f5d2d50b7c320362621d1d80e40
|
Provenance
The following attestation bundles were made for mcp_tools_cli-0.1.0.tar.gz:
Publisher:
python-publish.yml on moritalous/mcp-tools-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_tools_cli-0.1.0.tar.gz -
Subject digest:
a3a178e4150c4b98241ea93534d757d49fa12d2a82bd6fa7bf6f0ce3c69e305f - Sigstore transparency entry: 186745626
- Sigstore integration time:
-
Permalink:
moritalous/mcp-tools-cli@1ed0c8c1f9b8412d0d42e7a420db337e96b73260 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/moritalous
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@1ed0c8c1f9b8412d0d42e7a420db337e96b73260 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcp_tools_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_tools_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0eafdbe9cb9e0bac7d150e4e5571f5b10eb4d8423f0a29c59d22186ff98c34de
|
|
| MD5 |
39a717bf8c7cd3a39414a29939c6467e
|
|
| BLAKE2b-256 |
0ca4eeb7fedae5e20c6fbe6fb6528bf3ad428d48f9e38b74c42ed0345d974451
|
Provenance
The following attestation bundles were made for mcp_tools_cli-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on moritalous/mcp-tools-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_tools_cli-0.1.0-py3-none-any.whl -
Subject digest:
0eafdbe9cb9e0bac7d150e4e5571f5b10eb4d8423f0a29c59d22186ff98c34de - Sigstore transparency entry: 186745627
- Sigstore integration time:
-
Permalink:
moritalous/mcp-tools-cli@1ed0c8c1f9b8412d0d42e7a420db337e96b73260 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/moritalous
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@1ed0c8c1f9b8412d0d42e7a420db337e96b73260 -
Trigger Event:
release
-
Statement type: