mcp-cli
- agent-framework
A CLI inspector for the Model Context Protocol
About
What is mcp-cli?
mcp-cli is a command-line inspector for the Model Context Protocol (MCP). It is run via npx and requires Node.js/npm.
How to use mcp-cli?
You can run npx @wong2/mcp-cli without arguments to use the Claude Desktop config file, or specify a config file with -c config.json. Servers can also be started from NPM packages, locally developed scripts, or connected to running Streamable HTTP or SSE servers.
Key features of mcp-cli
- Run MCP servers from various sources
- List Tools, Resources, and Prompts
- Call Tools, Read Resources, and Read Prompts
- OAuth support for SSE and Streamable HTTP servers
- Connect to running servers over SSE or Streamable HTTP
Use cases of mcp-cli
- Inspect and interact with MCP servers directly from the terminal
- Test locally developed MCP servers before integrating them into an application
- Debug existing MCP servers by listing available tools, resources, and prompts
FAQ from mcp-cli
What kinds of MCP servers can be used with mcp-cli?
mcp-cli supports servers defined in a Claude Desktop config file, NPM packages, local scripts (node path/to/server.js), and running servers over Streamable HTTP (--url) or SSE (--sse).
Does mcp-cli support OAuth?
Yes, mcp-cli has OAuth support for SSE and Streamable HTTP servers.
How do I clear stored data like OAuth tokens?
Run npx @wong2/mcp-cli purge to purge stored data.
Can I use mcp-cli without installing anything?
Yes, you can run it directly with npx @wong2/mcp-cli – no global install is required.
What is the connection format for a running server?
Use --url <endpoint> for Streamable HTTP servers or --sse <endpoint> for SSE servers, for example --url http://localhost:8000/mcp.
Details
- Author
- wong2
- GitHub stars
- 332
- Category
- agent-framework
- Repository
- wong2/mcp-cli
mcp-cli
A CLI inspector for the Model Context Protocol
https://github.com/user-attachments/assets/4cd113e9-f097-4c9d-b391-045c5f213183
Features
- Run MCP servers from various sources
- List Tools, Resources, Prompts
- Call Tools, Read Resources, Read Prompts
- OAuth support for SSE and Streamable HTTP servers
Usage
Run without arguments
npx @wong2/mcp-cli
This will use the config file of Claude Desktop.
Run with a config file
npx @wong2/mcp-cli -c config.json
The config file has the same format as the Claude Desktop config file.
Run servers from NPM
npx @wong2/mcp-cli npx <package-name> <args>
Run locally developed server
npx @wong2/mcp-cli node path/to/server/index.js args...
Connect to a running server over Streamable HTTP
npx @wong2/mcp-cli --url http://localhost:8000/mcp
Connect to a running server over SSE
npx @wong2/mcp-cli --sse http://localhost:8000/sse
Purge stored data (OAuth tokens, etc.)
npx @wong2/mcp-cli purge
Related
- mcpservers.org - A curated list of MCP servers
