# Fastmcp Client CLI

Query and invoke tools on MCP servers using fastmcp list and fastmcp call.

- Repository: https://github.com/PrefectHQ/fastmcp (28267 stars)
- Category: AI and agents
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add PrefectHQ/fastmcp --skill fastmcp-client-cli -g -a claude-code -y`
Codex: `npx skills add PrefectHQ/fastmcp --skill fastmcp-client-cli -g -a codex -y`
Cursor: `npx skills add PrefectHQ/fastmcp --skill fastmcp-client-cli -g -a cursor -y`
Gemini CLI: `npx skills add PrefectHQ/fastmcp --skill fastmcp-client-cli -g -a gemini-cli -y`

## Description

Query and invoke tools on MCP servers using fastmcp list and fastmcp call. Use when you need to discover what tools a server offers, call tools, or integrate MCP servers into workflows.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# FastMCP CLI: List and Call

Use `fastmcp list` and `fastmcp call` to interact with any MCP server from the command line.

## Listing Tools

```bash
# Remote server
fastmcp list http://localhost:8000/mcp

# Local Python file (runs via fastmcp run automatically)
fastmcp list server.py

# MCPConfig with multiple servers
fastmcp list mcp.json

# Stdio command (npx, uvx, etc.)
fastmcp list --command 'npx -y @modelcontextprotocol/server-github'

# Include full input/output schemas
fastmcp list server.py --input-schema --output-schema

# Machine-readable JSON
fastmcp list server.py --json

# Include resources and prompts
fastmcp list server.py --resources --prompts
```

Default output shows tool signatures and descriptions. Use `--input-schema` or `--output-schema` to include full JSON schemas, `--json` for structured output.

## Calling Tools

```bash
# Key=value arguments (auto-coerced to correct types)
fastmcp call server.py greet name=World
fastmcp call server.py add a=3 b=4

# Single JSON object for complex/nested args
fastmcp call server.py create_item '{"name": "Widget", "tags": ["a", "b"]}'

# --input-json with key=value overrides
fastmcp call server.py search --input-json '{"query": "hello", "limit": 5}' limit=10

# JSON output for scripting
fastmcp call server.py add a=3 b=4 --json
```

Type coercion is automatic: `limit=5` becomes an integer, `verbose=true` becomes a boolean, based on the tool's input schema.

## Server Targets

All commands accept the same server targets:

| Target | Example |
|--------|---------|
| HTTP/HTTPS URL | `http://localhost:8000/mcp` |
| Python file | `server.py` |
| MCPConfig JSON | `mcp.json` (must have `mcpServers` key) |
| Stdio command | `--command 'npx -y @mcp/server'` |
| Discovered name | `weather` or `source:name` |

The rest: https://github.com/PrefectHQ/fastmcp/blob/HEAD/docs/.mintlify/skills/fastmcp-client-cli/SKILL.md
