mcp-cli-host is a command-line interface (CLI) host application designed to let large language models (LLMs) interact with external tools through the Model Context Protocol (MCP). It currently supports OpenAI, Azure OpenAI, DeepSeek, and Ollama models, and support for Google Gemini has been added.
In terms of purpose, this tool provides developers with a unified command-line interface for invoking various MCP-compatible external tools during chat, thereby extending the capabilities of language models. It is suitable for scenarios where multiple MCP servers need to be integrated in local or remote environments, and where users want to test or use these tools interactively.
Main capabilities include: interactive conversations with multiple LLM models; support for multiple concurrent MCP servers; dynamic tool discovery and integration; configurable MCP server locations and parameters; a configurable message history window to manage context; monitoring/tracing server-side errors; support for Sampling, Roots, Elicitation, retrieving Resources, and Prompts; support for excluding specific tools at runtime; displaying MCP server cards on connection; and displaying images in tool call output. The update history shows that on 2025-11-26, displaying images in tool call output was supported; on 2025-07-18, Streamable HTTP MCP servers were supported (the OAuth flow is not yet supported); on 2025-07-02, Elicitation was supported; on 2025-06-27, Prompts in MCP servers were handled; and on 2025-06-20, Resources in MCP servers were handled.
In terms of usage, users first need to set up the environment. For OpenAI and DeepSeek, the OpenAI default base_url is https://api.openai.com/v1,DeepSeek is changed with https://api.deepseek.com,可通过 --base-url. For Ollama, you first need to install Ollama from https://ollama.ai , pull the required model, and make sure it is running. There are also corresponding configurations for Azure OpenAI and Google Gemini. In terms of configuration, MCPCLIHost will automatically look for the configuration file at ~/.mcp.json, and the --config flag can also be used to specify a custom location. Each entry for a STDIO MCP server requires a command (such as uvx, npx) and an args array (for example, the SQLite server uses mcp-server-sqlite and the database path, and the filesystem server uses @modelcontextprotocol/server-filesystem and the directory path). Remote MCP servers currently only support Streamable HTTP. The model can be specified with the --model (-m) flag in the format provider:model, such as deepseek:deepseek-chat, openai:gpt-4, ollama:modelname, azure:gpt-4-0613, gemini:gemini-2.5-flash. Command-line options include --config string (configuration file location, default $HOME/mcp.json), --debug (enable debug logging), --message-window int (number of messages retained in context, default 10), -m/--model string (model to use, default "anthropic:claude-3-5-sonnet-latest"), --base-url string (base URL for the OpenAI API, default api.openai.com), --roots string (MCP client that exposes filesystem "roots" to the server), --sys-prompt string (system prompt). Interactive commands available during chat include: /help, /tools, /exclude_tool tool_name, /resources, /get_resource (get a specific resource by uri, such as /get_resource resource_uri), /prompts, /get_prompt (get a specific prompt by name, such as /get_prompt prompt_name), /servers, /history, /quit.
Applicable scenarios are any MCP-compatible server; refer to the MCP Servers Repository for reference implementations. In Sampling and Elicitation scenarios, pressing "Ctrl+c" will cause the process to crash, with an error similar to asyncio.exceptions.CancelledError; the official team says it will be resolved later. This project uses the Apache 2.0 license.