Get the FREE Ultimate OpenClaw Setup Guide →

mcpli

A command-line interface for interacting with MCP (Model Context Protocol) servers

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio juanibiapina-mcpli go install github.com/juanibiapina/mcpli/cmd/mcpli@latest \
  --env GOBIN="Directory to install binaries; optional if GOPATH/bin is in PATH"

How to use

mcpli is a command-line tool that turns MCP servers and their available tools into a native CLI experience with tab completion and built-in help. It discovers servers you’ve added, caches their tool definitions locally, and exposes each server as a subcommand with its own set of tools. You can list all configured servers, inspect the tools for a specific server, and invoke a tool directly with JSON-encoded arguments when required. The tool-level help describes each command, its options, and usage details, enabling a discoverable, self-documented workflow similar to other CLIs you already know.

To start, install mcpli, add a server by providing its URL, and then explore the available tools. Once cached, you can invoke any tool via a simple command like mcpli <server> <tool> [json-arguments]. Completion will help you discover servers and tools as you type, and each tool supports a --help flag to reveal its full description and usage right in the CLI.

How to install

Prerequisites:

  • A machine with Go installed and configured in your PATH to install the mcpli binary.
  • (Optional) Homebrew if you prefer the quick install path on macOS/Linux.

Installation steps:

  1. Install via Go (recommended):
# Installs the mcpli CLI from the repository
go install github.com/juanibiapina/mcpli/cmd/mcpli@latest
  1. Verify installation:
mcpli --version
  1. (Optional) If you use macOS/Linux and prefer Homebrew:
brew install juanibiapina/taps/mcpli
  1. Add a server (example URL) to fetch and cache its tools:
mcpli add myserver https://example.com/mcp/
  1. List servers and explore tools:
mcpli --help
mcpli myserver --help

Additional notes

  • mcpli caches tool definitions locally to avoid server round-trips for discovery.
  • Server headers can reference environment variables using the ${VAR} syntax when adding a server.
  • Ensure the server URL you add is the MCP endpoint exposing tools you want to use.
  • If you run into completion issues, reload your shell or re-source the completion script as described in the Completion setup section of the README.
  • The configuration file is stored at ~/.config/mcpli/config.json and contains server URLs, headers, and cached tool definitions.

Related MCP Servers

Sponsor this space

Reach thousands of developers