Skip to content

jonpspri/fastmcp-tool

Repository files navigation

fastmcp-tool

A command line tool for interacting with MCP (Model Context Protocol) servers.

Installation

pip install fastmcp-tool

Or with uv:

uv pip install fastmcp-tool

Usage

Connecting to a Server

Use the --server option to specify an MCP server. This can be either:

  • An HTTP/HTTPS URL for streamable HTTP transport
  • A shell command for stdio transport
# HTTP server
fastmcp-tool --server https://mcp.example.com/sse <command>

# Stdio server (runs command via bash)
fastmcp-tool --server "python my_mcp_server.py" <command>

Commands

List Tools

List all available tools on the MCP server:

fastmcp-tool --server https://mcp.example.com/sse tools

Call a Tool

Call a specific tool with optional JSON parameters:

# Pass parameters as a JSON string
fastmcp-tool --server https://mcp.example.com/sse call my_tool --params '{"key": "value"}'

# Or read parameters from a JSON file
fastmcp-tool --server https://mcp.example.com/sse call my_tool --params-file params.json

The --params and --params-file options are mutually exclusive.

List Resources

List all available resources:

fastmcp-tool --server https://mcp.example.com/sse resources

List Prompts

List all available prompts:

fastmcp-tool --server https://mcp.example.com/sse prompts

Options

Option Description
--server MCP server URL or stdio command
--debug Enable debug logging
--bearer-token Bearer token for HTTP server authentication
--help Show help message

Call Options

Option Description
--params JSON string of parameters to pass to the tool
--params-file Path to a JSON file containing parameters

Examples

# List tools from a local stdio server
fastmcp-tool --server "uv run my_server.py" tools

# Call a tool with parameters
fastmcp-tool --server https://api.example.com/mcp call search --params '{"query": "hello"}'

# Call a tool with parameters from a file
fastmcp-tool --server https://api.example.com/mcp call search --params-file search_params.json

# List resources with debug output
fastmcp-tool --server "python server.py" --debug resources

License

Apache License 2.0 - see LICENSE for details.

About

A tool built with FastMCP

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages