Read my Blog Post about MCP Tools
A command-line interface for interacting with MCP (Model Context Protocol) servers using stdio transport.
mcp shell npx -y @modelcontextprotocol/server-filesystem ~/Code
This will open a shell as following:
We welcome contributions! Please see our Contributing Guidelines for details on how to submit pull requests, report issues, and contribute to the project.
brew tap f/mcptools
brew install mcp
go install github.com/f/mcptools/cmd/mcptools@latest
MCP is a command line interface for interacting with MCP servers.
It allows you to discover and call tools, list resources, and interact with MCP-compatible services.
Usage:
mcp [command]
Available Commands:
call Call a tool, resource, or prompt on the MCP server
help Help about any command
prompts List available prompts on the MCP server
resources List available resources on the MCP server
shell Start an interactive shell for MCP commands
tools List available tools on the MCP server
version Print the version information
Flags:
-f, --format string Output format (table, json, pretty) (default "table")
-h, --help Help for mcp
-p, --params string JSON string of parameters to pass to the tool (default "{}")
MCP currently supports one transport method for communicating with MCP servers:
Uses stdin/stdout to communicate with an MCP server via JSON-RPC 2.0. This is useful for command-line tools that implement the MCP protocol.
mcp tools npx -y @modelcontextprotocol/server-filesystem ~/Code
MCP supports three output formats:
Displays the output in a table-like view for better readability.
mcp tools npx -y @modelcontextprotocol/server-filesystem ~/Code
Displays the output as compact JSON.
mcp tools --format json npx -y @modelcontextprotocol/server-filesystem ~/Code
Displays the output as indented JSON.
mcp tools --format pretty npx -y @modelcontextprotocol/server-filesystem ~/Code
mcp tools npx -y @modelcontextprotocol/server-filesystem ~/Code
mcp resources npx -y @modelcontextprotocol/server-filesystem ~/Code
mcp prompts npx -y @modelcontextprotocol/server-filesystem ~/Code
mcp call read_file --params '{"path": "https://laurenancona.me/eks/zITbvNmLiVHa0l2Z6MHc0/path/to/file"}' npx -y @modelcontextprotocol/server-filesystem ~/Code
mcp call resource:my-resource npx -y @modelcontextprotocol/server-filesystem ~/Code
mcp call prompt:my-prompt npx -y @modelcontextprotocol/server-filesystem ~/Code
Start an interactive shell for executing multiple MCP commands:
mcp shell npx -y @modelcontextprotocol/server-filesystem ~/Code
This opens an interactive shell where you can run MCP commands:
mcp > connected to MCP server over stdio
mcp > Type '/h' for help or '/q' to quit
mcp > tools
NAME DESCRIPTION
---- -----------
read_file Reads a file from the filesystem
...
mcp > call read_file --params '{"path": "README.md"}'
...content of README.md...
# Direct tool calling is supported
mcp > read_file {"path": "README.md"}
...content of README.md...
mcp > /h
MCP Shell Commands:
tools List available tools
resources List available resources
prompts List available prompts
call <entity> [--params '{...}'] Call a tool, resource, or prompt
format [json|pretty|table] Get or set output format
Special Commands:
/h, /help Show this help
/q, /quit, exit Exit the shell
mcp > /q
Exiting MCP shell
List tools from a filesystem server:
mcp tools npx -y @modelcontextprotocol/server-filesystem ~/Code
Call the read_file tool with pretty JSON output:
mcp call read_file --params '{"path": "README.md"}' --format pretty npx -y @modelcontextprotocol/server-filesystem ~/Code
Using the interactive shell mode:
mcp shell npx -y @modelcontextprotocol/server-filesystem ~/Code
The following features are planned for future releases:
- HTTP Transport: Add support for connecting to MCP servers over HTTP
- Authentication: Support for secure authentication mechanisms
This project is licensed under MIT