mcphost
A CLI host application that enables Large Language Models (LLMs) to interact with external tools through the Model Context Protocol (MCP).
claude mcp add --transport stdio mark3labs-mcphost bash -lc echo 'Filesystem server placeholder' && sleep 1
How to use
To get started, install the MCPHost CLI and run mcphost to load your configuration. MCPHost supports multiple types of MCP servers and providers, including local command-based servers, remote API endpoints, and built-in tooling for common tasks. You can configure per-server tool access through allowedTools and excludedTools, enabling fine-grained control over what the model can call. Use environment variable substitution in your configuration to keep sensitive keys out of config files, and leverage the Hooks system to enforce security policies or to integrate custom behavior. The CLI also supports non-interactive scripting and script-based automation, making it suitable for automated workflows and batch prompts.
How to install
Prerequisites:
- Go 1.23 or later
- Access to a compatible MCP model provider (OpenAI, Anthropic, Google Gemini, Ollama, etc.)
- If using external services, corresponding API keys or local runtimes as required
Install the MCPHost CLI:
# Install the latest MCPHost CLI (Go tool install)
go install github.com/mark3labs/mcphost@latest
Verify installation:
mcphost --version
Create or edit your MCPHost configuration (default location is ~/.mcphost.yml or ~/.mcphost.json). You can start the server with:
mcphost
If you need to run a specific build or a development version, you can build from source and run the binary directly from the repo:
git clone https://github.com/mark3labs/mcphost.git
cd mcphost
go build ./...
./mcphost
Configure environment variables for API keys and models as needed prior to starting mcphost, or use the provided environment substitution features in the config file.
Additional notes
Tips and common issues:
- Environment variable substitution allows sensitive data to be kept out of config files. Use ${env://VAR} for required variables or ${env://VAR:-default} for optional ones with defaults.
- If you connect to services with self-signed TLS certificates, you can disable TLS verification for development with the tls-skip-verify flag, but do not use this in production.
- MCPHost can run multiple servers concurrently; ensure each server has a unique name and a valid command configuration (for local servers, the command should execute the tool you want to expose).
- For Google/Gemini or other providers, ensure you have the appropriate API keys configured and accessible to mcphost via environment variables or provider flags.
- The included SDK mirrors CLI behavior, so you can switch between programmatic and CLI usage without changing your configuration approach.
Related MCP Servers
trpc-agent-go
trpc-agent-go is a powerful Go framework for building intelligent agent systems using large language models (LLMs) and tools.
station
Station is our open-source runtime that lets teams deploy agents on their own infrastructure with full control.
tiger-cli
Tiger CLI is the command-line interface for Tiger Cloud. It includes an MCP server for helping coding agents write production-level Postgres code.
gopls
MCP server for golang projects development: Expand AI Code Agent ability boundary to have a semantic understanding and determinisic information for golang projects.
kubernetes
A Model Context Protocol (MCP) server for the Kubernetes API.
gcp-cost
💰 An MCP server that enables AI assistants to estimate Google Cloud costs, powered by Cloud Billing Catalog API and built with Genkit for Go