prefecthq/fastmcp
Overview
This skill provides a fast, Pythonic CLI for discovering and invoking tools exposed by MCP servers using the fastmcp list and fastmcp call commands. It lets you inspect tool signatures, schemas, prompts, and resources, and invoke tools with automatic type coercion and JSON output for scripting. Use it to integrate MCP servers into automation, debugging, and local development workflows.
How this skill works
fastmcp list queries a target MCP server (HTTP URL, Python file, MCPConfig, or stdio command) and returns available tools, optional input/output JSON schemas, prompts, and resources. fastmcp call invokes a specific tool with key=value args or a single JSON object, auto-coercing types from the tool schema, and can return machine-readable JSON. Targets can be named discoveries from editor/project configs, or explicit endpoints, and SSE transport and auth modes are supported.
When to use it
- You need to discover what tools a remote or local MCP server exposes before integration.
- You want to call a tool from the command line or a script and capture structured JSON output.
- You are debugging or documenting tool input/output shapes and want full JSON schemas or prompts.
- You need to integrate MCP servers into CI, automation, or shell-based workflows.
- You want to run local Python server files or stdio-based servers without manual HTTP setup.
Best practices
- Run fastmcp discover first to list configured servers and use source:name to target a specific source.
- Use --input-schema and --output-schema when designing integrations to ensure correct typing and payload shape.
- Prefer JSON input for complex nested arguments and use key=value for quick scalar calls.
- Use --json for machine-readable output in scripts and CI pipelines.
- When calling SSE servers, pass --transport sse and test with list before calling to confirm behavior.
Example use cases
- Inspect a local Python server: fastmcp list server.py --input-schema to validate required fields.
- Invoke a tool from a build script and capture JSON: fastmcp call server.py add a=3 b=4 --json.
- Discover editor-configured servers and call by name: fastmcp discover && fastmcp call weather get_forecast city=London.
- Run a stdio-hosted MCP server via an npm command and list its tools: fastmcp list --command 'npx -y @modelcontextprotocol/server-github'.
- Override parts of a JSON payload: fastmcp call server.py search --input-json '{"query":"hello","limit":5}' limit=10.
FAQ
Targets include HTTP/HTTPS URLs, local Python files, MCPConfig JSON, stdio commands, and discovered names from editor or project configs.
How does type coercion work for arguments?
Key=value args are auto-coerced to the types defined in the tool's input schema (integers, booleans, arrays, etc.). Use JSON input for complex structures.