Get the FREE Ultimate OpenClaw Setup Guide →

mcphost

A CLI host application that enables Large Language Models (LLMs) to interact with external tools through the Model Context Protocol (MCP).

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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

Sponsor this space

Reach thousands of developers