Add your description here
Project description
MCPCLIHost 🤖
A CLI host application that enables Large Language Models (LLMs) to interact with external tools through the Model Context Protocol (MCP). Currently supports Openai, Azure Openai, Deepseek and Ollama models.
English | 简体中文
What it looks like: 🤠
Features ✨
- Interactive conversations with multipe LLM models
- Support for multiple concurrent MCP servers
- Dynamic tool discovery and integration
- Tool calling capabilities for both model types
- Configurable MCP server locations and arguments
- Configurable message history window for context management
- Monitor/trace error from server side
- Support sampling, Roots, Resource, Prompts
- Support runtime exclude specific tool
- Show MCP server card when connected
Latest Update 💌
- [2025-06-27] Deal with
Promptsin MCP server: Link - [2025-06-20] Deal with
Resourcesin MCP server: Link
Environment Setup 🔧
- For Openai and Deepseek:
export OPENAI_API_KEY='your-api-key'
By default for Openai the base_url is "https://api.openai.com/v1"
For deepseek it's "https://api.deepseek.com", you can change it by --base-url
- For Ollama, need setup firstly:
- Install Ollama from https://ollama.ai
- Pull your desired model:
ollama pull mistral
- Ensure Ollama is running:
ollama serve
- For Azure Openai:
export AZURE_OPENAI_DEPLOYMENT='your-azure-deployment'
export AZURE_OPENAI_API_KEY='your-azure-openai-api-key'
export AZURE_OPENAI_API_VERSION='your-azure-openai-api-version'
export AZURE_OPENAI_ENDPOINT='your-azure-openai-endpoint'
Installation 📦
pip install mcp-cli-host
Configuration ⚙️
MCPCLIHost will automatically find configuration file at ~/.mcp.json. You can also specify a custom location using the --config flag:
{
"mcpServers": {
"sqlite": {
"command": "uvx",
"args": [
"mcp-server-sqlite",
"--db-path",
"/tmp/foo.db"
]
},
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/tmp"
]
}
}
}
Each MCP server entry requires:
command: The command to run (e.g.,uvx,npx)args: Array of arguments for the command:- For SQLite server:
mcp-server-sqlitewith database path - For filesystem server:
@modelcontextprotocol/server-filesystemwith directory path
- For SQLite server:
Usage 🚀
MCPCLIHost is a CLI tool that allows you to interact with various AI models through a unified interface. It supports various tools through MCP servers.
Available Models
Models can be specified using the --model (-m) flag:
- Deepseek:
deepseek:deepseek-chat - OpenAI:
openai:gpt-4 - Ollama models:
ollama:modelname - Azure Openai:
azure:gpt-4-0613
Examples
# Use Ollama with Qwen model
mcpclihost -m ollama:qwen2.5:3b
# Use Deepseek
mcpclihost -m deepseek:deepseek-chat
Flags
--config string: Config file location (default is $HOME/mcp.json)--debug: Enable debug logging--message-window int: Number of messages to keep in context (default: 10)-m, --model string: Model to use (format: provider:model) (default "anthropic:claude-3-5-sonnet-latest")--base-url string: Base URL for OpenAI API (defaults to api.openai.com)
Interactive Commands
While chatting, you can use:
/help: Show available commands/tools: List all available tools/servers: List configured MCP servers/history: Display conversation history/exclude_tool tool_name: Exclude specific tool from the conversationCtrl+C: Exit at any time
MCP Server Compatibility 🔌
MCPCliHost can work with any MCP-compliant server. For examples and reference implementations, see the MCP Servers Repository.
License 📄
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_cli_host-0.1.9.tar.gz.
File metadata
- Download URL: mcp_cli_host-0.1.9.tar.gz
- Upload date:
- Size: 26.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02f0e3508f6466aec47f91fc434c112fbb420f010588bd19bf46089668fa7491
|
|
| MD5 |
d6e4f3345f17ff653422591f66203896
|
|
| BLAKE2b-256 |
77915111da1170b793bb488b2da093a179c431dec06a919bb96f4125fc93a6c8
|
File details
Details for the file mcp_cli_host-0.1.9-py3-none-any.whl.
File metadata
- Download URL: mcp_cli_host-0.1.9-py3-none-any.whl
- Upload date:
- Size: 33.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec89bc66e60d58497c7d69a8b1834e0bd29824e6e8941408bbc28ad62e073933
|
|
| MD5 |
e1175bad5b92cbc38b67773a3f3aea6c
|
|
| BLAKE2b-256 |
4b1a215b9a4a7ad5a4272f11e15992035f69b04a1cbe5f368f6d74858ff601ba
|