MCPCLIHost is an MCP host and runtime application that connects multiple Large Language Model providers to external tools and services using the Model Context Protocol. It is designed for developers and command-line users who want to run MCP-driven AI workflows outside of graphical IDEs or desktop assistants. The tool connects to models from OpenAI, Azure OpenAI, DeepSeek, Google Gemini, and local instances run via Ollama, while interfacing with local STDIO servers or remote Streamable HTTP MCP endpoints. MCPCLIHost enables dynamic tool discovery, image rendering from tool outputs, MCP resource retrieval, prompt execution, and runtime exclusions of specific tools. Users can run conversations directly in their terminal while managing context through configurable message history windows. It also supports core MCP protocol primitives such as Roots, Sampling, and Elicitation, allowing local agents to access local directory structures and execute coordinated multi-step tool calls directly through standard command-line flags and interactive slash commands.
Category: AI & LLM Tooling
Tags: cli, host, integration, runtime
bash pip install mcp-cli-host 2. Configure your environment variables for your chosen LLM provider, such as export OPENAI_API_KEY='your-api-key' or export GEMINI_API_KEY='your-gemini-api-token', or ensure a local Ollama instance is running with ollama serve. 3. Create a configuration file at ~/.mcp.json (or pass a path via --config) defining your servers in mcpServers with appropriate commands, arguments, or URLs. 4. Launch the host by specifying a model: bash mcpclihost -m openai:gpt-4 5. Interact using conversational prompts and slash commands like /tools, /resources, and /servers.Part of MCP Servers
MCPCLIHost is an interactive command-line host application that allows users to chat with large language models while connecting them to external tools, resources, and prompts via the Model Context Protocol. It bridges various LLM providers with MCP servers running over STDIO or Streamable HTTP.
MCPCLIHost supports multiple model providers including OpenAI, Azure OpenAI, DeepSeek, Google Gemini, and locally hosted models running via Ollama. You can switch models at startup using the model flag followed by the provider and model name.
MCP servers are defined inside a JSON configuration file located by default at ~/.mcp.json or provided via the --config flag. The configuration file contains a mcpServers dictionary defining STDIO commands, arguments, or remote HTTP URLs with authorization headers.
While chatting in MCPCLIHost, you can run slash commands including /help, /tools, /exclude_tool, /resources, /get_resource, /prompts, /get_prompt, /servers to list active connections, /history to view conversation logs, and /quit to close the program.
MCPCLIHost is an open source project licensed under the Apache 2.0 License, allowing users to modify, inspect, and integrate the tool into custom workflows in accordance with the repository license terms.