mcp-use client to test or automate an HTTP MCP server from the terminal. Save a server under a name, then use that name for every tool, resource, prompt, and auth command.
For the complete command and flag catalog, see the CLI reference.
Connect and call a tool
Run the CLI withnpx, or install mcp-use in your project.
connect supports HTTP and HTTPS MCP URLs. It verifies the connection before saving it. The CLI stores saved server metadata under ~/.mcp-use/client/.
List or remove saved servers with these commands:
Choose a protocol mode
The default--protocol auto mode prefers the modern MCP wire and falls back
to the legacy wire when the server does not support modern negotiation.
Use legacy or modern when you need strict compatibility testing:
legacy uses only the legacy wire. modern uses the stateless, sessionless
modern wire with no fallback.
Authenticate with OAuth
When a server requires OAuth in an interactive terminal, the CLI displays this prompt:Mixed auth
A mixed-auth server letsconnect succeed anonymously, then protects only some
operations. When the server advertises OAuth through protected-resource
metadata, the CLI saves it normally and prints:
isError results or error text.
Use --no-open to authenticate without launching a browser:
--no-open or non-interactive human output, the CLI never prompts or opens a browser. It prints a state-free local loopback launcher URL and continues waiting for the callback. Open that local URL yourself; it redirects to the provider without putting the provider URL or OAuth state in terminal output.
Under --json, the CLI never prints the authorization URL or OAuth state and never waits for consent. If fresh authorization is required, it exits with oauth_interaction_required and provides an interactive retry command in error.details.nextSteps.
Use --no-oauth for a public server or when an authorization challenge should fail instead of starting OAuth. Repeated -H or --header options add static request headers.
auth login starts OAuth for a saved server. auth logout removes OAuth
material but keeps the saved server and its non-OAuth connection metadata.
Connection URLs are stored exactly for transport use, but CLI results redact URL userinfo, query values, and fragments so signed URLs and embedded credentials are not copied into logs.
Call tools
List tools, inspect a tool schema, then call the tool with its required inputs.key=value pairs. Use key:=<json> for typed or nested values, or pass one JSON object.
--timeout <ms> for slow tools. The default is 30000 milliseconds.
Read resources
Resources are server-provided content identified by URI. List resources, then read the URI you need.Get prompts
Prompts are reusable message templates exposed by the server. Prompt arguments use the same forms as tool arguments.Produce parseable JSON
Every client command documented with--json accepts it anywhere after client. The following forms are equivalent:
--json.
Troubleshoot commands
Unknown saved server: <name>: runnpx mcp-use client list, or reconnect withnpx mcp-use client connect <name> <url>.Tool not found: <name>: runtools listagainst the same saved server.protocol_mismatch: reconnect with--protocol auto, or choose the protocol mode the server supports.- An OAuth command waits without opening a browser: open the authorization URL printed to stderr, then complete authorization before the configured timeout.
- A tool returns an error: under
--json, inspecterror.detailsfor the original MCP tool result.