MCP Client CLI

v1.0.0Developer Toolsstable

CLI chatbot client app that connects to a specified MCP server. Built using TypeScript, OpenAI SDK, and MCP SDK.

langchainllmmcpmodel-context-protocol
Share:
674
Stars
0
Downloads
0
Weekly
0/5

What is MCP Client CLI?

MCP Client CLI is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to cli chatbot client app that connects to a specified mcp server. built using typescript, openai sdk, and mcp sdk.

CLI chatbot client app that connects to a specified MCP server. Built using TypeScript, OpenAI SDK, and MCP SDK.

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • CLI chatbot client app that connects to a specified MCP serv

Use Cases

CLI chatbot for MCP servers
TypeScript and OpenAI SDK
Direct MCP server interaction
adhikasp

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedMay 15, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-client-cli

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use MCP Client CLI

mcp-client-cli is a terminal-based MCP client that lets you chat with any MCP-compatible server directly from your command line, using your choice of LLM provider (OpenAI, Groq, local Llama, and others). It serves as an alternative to Claude Desktop for developers who prefer the terminal, providing a simple llm command that sends prompts to an LLM equipped with the tools exposed by your configured MCP servers. It also supports piped input, image analysis, and reusable prompt templates.

Prerequisites

  • Python 3.10 or higher
  • pip package manager
  • An LLM API key: LLM_API_KEY or OPENAI_API_KEY for OpenAI, or equivalent for Groq/other providers
  • At least one MCP server installed and runnable (e.g. via uvx or npx)
  • A ~/.llm/config.json configuration file
1

Install via pip

Install the mcp-client-cli package from PyPI. This installs the llm command globally in your Python environment.

pip install mcp-client-cli
2

Create the configuration file

Create ~/.llm/config.json to configure your LLM provider and any MCP servers you want to connect. The config supports JSON with // comments for easy toggling.

mkdir -p ~/.llm
cat > ~/.llm/config.json << 'EOF'
{
  "systemPrompt": "You are a helpful assistant.",
  "llm": {
    "provider": "openai",
    "model": "gpt-4o",
    "api_key": "your-openai-api-key",
    "temperature": 0.7
  },
  "mcpServers": {
    "fetch": {
      "command": "uvx",
      "args": ["mcp-server-fetch"],
      "enabled": true
    }
  }
}
EOF
3

Set your API key via environment variable

As an alternative to embedding the key in config.json, set the LLM_API_KEY or OPENAI_API_KEY environment variable. The CLI checks both.

export OPENAI_API_KEY=sk-...
4

Send your first prompt

Run the llm command followed by your prompt. The CLI sends it to your configured LLM along with any tools from your MCP servers.

llm "What is the top article on Hacker News today?"
5

Use piped input and images

Pipe text files or images into llm for contextual analysis. The CLI passes piped content as additional context to the LLM.

# Pipe a file
cat error.log | llm "What is causing this error?"

# Pipe an image for vision analysis
cat screenshot.png | llm "Is there any error in this screenshot?"
6

Use and list prompt templates

The CLI supports reusable prompt templates accessible via the p prefix. List available templates and use them by name.

# List available templates
llm --list-prompts

# Use a template to review git changes
llm p review

# Generate a commit message
llm p commit

MCP Client CLI Examples

Client configuration

A complete ~/.llm/config.json with OpenAI as the LLM provider and two MCP servers configured.

{
  "systemPrompt": "You are an AI assistant helping a software engineer.",
  "llm": {
    "provider": "openai",
    "model": "gpt-4o",
    "api_key": "your-openai-api-key",
    "temperature": 0.7
  },
  "mcpServers": {
    "fetch": {
      "command": "uvx",
      "args": ["mcp-server-fetch"],
      "requires_confirmation": ["fetch"],
      "enabled": true
    },
    "brave-search": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-brave-search"],
      "env": {
        "BRAVE_API_KEY": "your-brave-api-key"
      },
      "requires_confirmation": ["brave_web_search"]
    }
  }
}

Prompts to try

Example CLI commands demonstrating the range of the mcp-client-cli capabilities.

- llm "What is the capital of North Sumatra?"
- cat package.json | llm "Summarize the dependencies in this file"
- llm "What are the latest AI news headlines?" (uses brave-search MCP server)
- llm p review (runs the built-in code review prompt template against git diff)
- llm --list-prompts (shows all available prompt templates)

Troubleshooting MCP Client CLI

Command 'llm' not found after pip install

The pip scripts directory may not be on your PATH. Run python -m mcp_client_cli directly, or add the pip scripts directory (e.g. ~/.local/bin on Linux/macOS) to your PATH environment variable.

MCP server tools are not invoked even though they are configured

Check that the server entry in mcpServers has "enabled": true (or omit it, as true is the default). Verify the command (uvx, npx, etc.) is installed and accessible in your PATH. Run the MCP server command manually to confirm it starts without errors.

Tool requiring confirmation blocks indefinitely in non-interactive mode

When piping input or running llm in a script, tools listed in requires_confirmation will prompt for [y/n] on stdin. Either remove the tool from requires_confirmation, or answer the prompt interactively when running the command directly.

Frequently Asked Questions about MCP Client CLI

What is MCP Client CLI?

MCP Client CLI is a Model Context Protocol (MCP) server that cli chatbot client app that connects to a specified mcp server. built using typescript, openai sdk, and mcp sdk. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install MCP Client CLI?

Follow the installation instructions on the MCP Client CLI GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with MCP Client CLI?

MCP Client CLI works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is MCP Client CLI free to use?

Yes, MCP Client CLI is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "mcp-client-cli": { "command": "npx", "args": ["-y", "mcp-client-cli"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use MCP Client CLI?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides