mcphost  by mark3labs

CLI tool for LLMs to interact with external tools via Model Context Protocol (MCP)

created 7 months ago
1,228 stars

Top 32.7% on sourcepulse

GitHubView on GitHub
Project Summary

MCPHost is a CLI application designed to bridge Large Language Models (LLMs) with external tools and data sources via the Model Context Protocol (MCP). It serves as a host in the MCP client-server architecture, enabling LLMs to interact with tools, maintain consistent context, and execute commands safely. The project targets developers and researchers working with LLMs who need to integrate them with external functionalities.

How It Works

MCPHost acts as an intermediary, managing connections to MCP-compatible servers that expose tools. It supports a range of LLMs, including Anthropic Claude, Ollama models, Google Gemini, and OpenAI-compatible APIs. The core advantage lies in its unified interface for interacting with diverse LLM providers and its dynamic tool discovery, allowing LLMs to leverage external capabilities seamlessly.

Quick Start & Requirements

  • Install: go install github.com/mark3labs/mcphost@latest
  • Prerequisites: Go 1.23+, API keys for Claude/Google, local Ollama installation, and at least one MCP-compatible tool server.
  • Setup: Environment variables for API keys (e.g., export ANTHROPIC_API_KEY='your-api-key'). Configuration for MCP servers is managed via ~/.mcp.json.
  • Docs: MCP Servers Repository

Highlighted Details

  • Supports multiple LLM providers: Anthropic Claude, Ollama, Google Gemini, OpenAI.
  • Dynamic tool discovery and integration via MCP servers.
  • Configurable message history window for context management.
  • Interactive CLI commands for managing tools, servers, and conversation history.

Maintenance & Community

  • Active development with contributions welcome.
  • Discussion channel available on Discord.

Licensing & Compatibility

  • MIT License.
  • Compatible with commercial and closed-source applications.

Limitations & Caveats

The project requires Go 1.23+, which may be a recent requirement for some development environments. While it supports various LLMs, specific model compatibility (e.g., function calling support for Ollama/Gemini) is dependent on the underlying LLM provider.

Health Check
Last commit

5 days ago

Responsiveness

1 day

Pull Requests (30d)
9
Issues (30d)
11
Star History
484 stars in the last 90 days

Explore Similar Projects

Starred by Didier Lopes Didier Lopes(Founder of OpenBB), Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), and
2 more.

fastmcp by jlowin

2.1%
15k
Pythonic SDK for building Model Context Protocol (MCP) servers/clients
created 8 months ago
updated 1 day ago
Feedback? Help us improve.