wong2/mcp-cli logo

wong2/mcp-cli

Free

用于测试 MCP 服务器的 CLI 工具 (另一版本)。

FreeFree tier
Type
Open Source

About wong2/mcp-cli

A CLI inspector for the Model Context Protocol (MCP) that allows developers to test and interact with MCP servers. It supports running servers from various sources including NPM packages, local scripts, and config files, and can connect to running servers via SSE or Streamable HTTP. Features include listing and calling tools, reading resources and prompts, OAuth support, and a non-interactive mode for scripting and automation.

Key Features

Run MCP servers from config files, NPM packages, or local scripts
List Tools, Resources, and Prompts available on a server
Call Tools, Read Resources, and Read Prompts interactively or non-interactively
OAuth support for SSE and Streamable HTTP servers
Non-interactive mode for scripting and automation
Purge stored data (e.g., OAuth tokens)

Pros & Cons

Pros
  • Supports multiple ways to run and connect to MCP servers
  • Provides both interactive and non-interactive modes
  • Includes built-in OAuth support for secure connections
  • Open source under GPL-3.0 license
  • Easy to run with npx without installation
Cons
  • Requires Node.js environment
  • Limited to the Model Context Protocol only
  • Command-line only, no graphical interface

Best For

Testing MCP servers during developmentDebugging interactions with MCP serversScripting and automating MCP server workflowsInspecting available tools, resources, and prompts on a server

FAQ

What is mcp-cli?
mcp-cli is a CLI inspector for the Model Context Protocol that lets you test and interact with MCP servers.
How do I run a server from an NPM package?
Run `npx @wong2/mcp-cli npx package-name args`. Add `--pass-env` if the server needs environment variables from your current shell.
Can I use mcp-cli non-interactively?
Yes. Use the non-interactive mode by specifying a command like `call-tool`, `read-resource`, or `get-prompt` with the server name and target, bypassing all interactive prompts.
How do I connect to a running server over SSE?
Use `npx @wong2/mcp-cli --sse http://localhost:8000/sse` to connect to a server already running with Server-Sent Events.