mcp-client-cli
A simple CLI to run LLM prompt and implement MCP client.
claude mcp add --transport stdio adhikasp-mcp-client-cli uvx mcp-server-fetch
How to use
This MCP client acts as a command-line interface to run LLM prompts while interacting with MCP-compatible servers. It lets you route prompts through various MCP-backed tools (such as a web search or other specialized services) and combine them with your preferred LLM provider (OpenAI, Groq, local models, etc.) to produce final responses. Use the included configuration to specify which MCP servers you want to consult, how to invoke them, and whether certain tools require user confirmation before execution. The client can pipe input, handle prompts via templates, and support multimodal inputs like images depending on the configured tools.
How to install
Prerequisites:
- Python 3.8+ installed on your system
- Access to install Python packages (pip)
- Optional: a configured ~/.llm/config.json or $PWD/.llm/config.json as described
Install the MCP client CLI via pip:
pip install mcp-client-cli
Optionally verify installation:
llm --version
Configure your MCP servers by creating a config file at ~/.llm/config.json or ./llm/config.json with your preferred servers and tools (as shown in the README example). After configuring, you can run the CLI with a prompt, for example:
llm "What is the capital city of North Sumatra?"
Additional notes
Tips and caveats:
- The configuration file supports commenting with // and can be placed at ~/.llm/config.json or $PWD/.llm/config.json.
- You can supply your LLM API key via environment variables LLM_API_KEY or OPENAI_API_KEY.
- Use requires_confirmation in your config to prompt before executing certain tools, e.g., the Brave Search tool.
- The Brave Search server requires a BRAVE_API_KEY in the env.
- The CLI is designed to work with any MCP-compatible server; if you add new servers, ensure the command and args match how the server is started (e.g., uvx for Python/uv, npx for Node-based servers).
- When piping input or using templates, be mindful of shell quoting and character escaping.
Related MCP Servers
mcp-agent
Build effective agents using Model Context Protocol and simple workflow patterns
open-ptc-agent
An open source implementation of code execution with MCP (Programatic Tool Calling)
mcp-reddit
A Model Context Protocol (MCP) server that provides tools for fetching and analyzing Reddit content.
mcp-ical
A Model Context Protocol Server that allows you to interact with your MacOS Calendar through natural language.
mcp -odoo
A Model Context Protocol (MCP) server that enables AI assistants to securely interact with Odoo ERP systems through standardized resources and tools for data retrieval and manipulation.
lc2mcp
Convert LangChain tools to FastMCP tools