You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@mcp-use/cli

Package Overview
Dependencies
Maintainers
2
Versions
382
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mcp-use/cli

A CLI tool for interacting with Model Context Protocol (MCP) servers using natural language

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
15K
-28.65%
Maintainers
2
Weekly downloads
 
Created
Source
Terminal

A CLI tool for interacting with Model Context Protocol (MCP) servers using natural language. Built with mcp-use and powered by OpenAI's GPT models.

Features

  • 🤖 Natural language interface for MCP servers
  • 🔧 Built-in filesystem MCP server support
  • 💬 Interactive chat interface with tool call visualization
  • ⚡ Direct integration with mcp-use (no API layer needed)
  • 🚀 Single command installation
  • 🔄 Multiple LLM providers (OpenAI, Anthropic, Google, Mistral)
  • ⚙️ Slash commands for configuration (like Claude Code)
  • 🔑 Smart API key prompting - automatically asks for keys when needed
  • 💾 Persistent secure storage - encrypted keys and settings saved across sessions

Install

$ npm install --global mcp-use-cli

Quick Start

  • Install and run:

    $ npm install --global mcp-use-cli
    $ mcp-use-cli
    
  • Choose your model (CLI handles API key setup automatically):

    # Just pick a model - that's it!
    /model openai gpt-4o-mini
    /model anthropic claude-3-5-sonnet-20241022
    /model google gemini-1.5-pro
    
    # CLI will prompt: "Please enter your OPENAI API key:"
    # Paste your key and start chatting immediately!
    
  • Get API keys when prompted from:

Keys are stored securely encrypted in ~/.mcp-use-cli/config.json and persist across sessions.

Alternative Setup

If you prefer environment variables:

export OPENAI_API_KEY=your_key_here
export ANTHROPIC_API_KEY=your_key_here
# Then just run: mcp-use-cli

Usage

$ mcp-use-cli --help

  Usage
    $ mcp-use-cli

  Options
    --name        Your name (optional)
    --config      Path to MCP configuration file (optional)

  Examples
    $ mcp-use-cli
    $ mcp-use-cli --name=Jane
    $ mcp-use-cli --config=./mcp-config.json

  Environment Variables
    OPENAI_API_KEY    Required - Your OpenAI API key

  Setup
    1. Set your OpenAI API key: export OPENAI_API_KEY=your_key_here
    2. Run: mcp-use-cli
    3. Start chatting with MCP servers!

Configuration

By default, the CLI connects to a filesystem MCP server in /tmp. You can provide a custom configuration file:

{
  "servers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/directory"],
      "env": {}
    },
    "other-server": {
      "command": "your-mcp-server-command",
      "args": ["--arg1", "value1"],
      "env": {}
    }
  }
}

Slash Commands

Switch LLM providers and configure settings using slash commands (similar to Claude Code):

# Set API keys (stored securely)
/setkey openai sk-1234567890abcdef...
/setkey anthropic ant_1234567890abcdef...
/clearkeys  # Clear all stored keys

# Switch models
/model openai gpt-4o
/model anthropic claude-3-5-sonnet-20241022
/model google gemini-1.5-pro
/model mistral mistral-large-latest

# List available models
/models
/models anthropic

# Configuration
/config temp 0.5
/config tokens 4000

# Status and help
/status
/help

Chat Examples

  • "List files in the current directory"
  • "Create a new file called hello.txt with the content 'Hello, World!'"
  • "Search for files containing 'TODO'"
  • "What's the structure of this project?"

Architecture

This CLI uses:

  • Frontend: React + Ink for the terminal UI
  • Agent: mcp-use MCPAgent for LLM + MCP integration
  • LLM: OpenAI GPT-4o-mini
  • Transport: Direct TypeScript integration (no API layer)

License

MIT

Keywords

mcp

FAQs

Package last updated on 27 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts