Skip to main content

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 | 简体中文

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
  • Consistent command interface across model types
  • Configurable message history window for context management

Environment Setup 🔧

  1. 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

  1. For Ollama, need setup firstly:
ollama pull mistral
  • Ensure Ollama is running:
ollama serve
  1. 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 📦

TODO

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-sqlite with database path
    • For filesystem server: @modelcontextprotocol/server-filesystem with directory path

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
mcphost -m ollama:qwen2.5:3b

# Use Deepseek
mcphost -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
  • Ctrl+C: Exit at any time

MCP Server Compatibility 🔌

MCPHost 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_cli_host-0.1.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_cli_host-0.1.0-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file mcp_cli_host-0.1.0.tar.gz.

File metadata

  • Download URL: mcp_cli_host-0.1.0.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for mcp_cli_host-0.1.0.tar.gz
Algorithm Hash digest
SHA256 439c1bf7a289561b74e0610a0654f717800a935c37ff7cc1aa8b31964000df01
MD5 3b811deeb1e0a2dd3d15c4e256189dd7
BLAKE2b-256 7dc9ac3be1e8bc03c1257ce4d8d193ed3904eb43c8c94082575c8e0d8b97c2c0

See more details on using hashes here.

File details

Details for the file mcp_cli_host-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_cli_host-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62ff7eb36ffa9251ab9f8b8ad75bf91059620ad7079ae1994c122bac1382bb27
MD5 7b6b9b79aea9ff9b1ff6be0f523c50ef
BLAKE2b-256 a7b0692c93a759e5a19d5a9241ab83f0873f3e0ee9a89660f2af62ee73b4fc5b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page