Open5

docker mcp gateway経由のMCPをClaude Codeで利用する

tomonr1984tomonr1984

go製のアプリ。
リリースページからバイナリを1ファイルだけダウンロードして使う
MシリーズのMacなら docker-mcp-darwin-arm64.tar.gz を選ぶ
以下を実施すると docker mcpコマンドが使えるようになる

tar zxvf docker-mcp-darwin-arm64.tar.gz
mv docker-mcp ~/.docker/cli-plugins
chmod +x ~/.docker/cli-plugins/docker-mcp

❯ docker mcp --version
v0.10.0

https://github.com/docker/mcp-gateway/releases/tag/v0.10.0
https://docs.docker.com/ai/mcp-gateway/#install-a-pre-release-version-of-the-mcp-gateway

tomonr1984tomonr1984

Claude CodeへのMCP追加コマンド

claude mcp add -s user mcp-docker docker mcp gateway run
  • -s: スコープ。local, project, user
  • mcp-docker: MCPサーバーの名称。なんでもいい
  • docker: コマンド。dockerコマンドを使いますよの意味
  • mcp gateway run: args dockerコマンドの引数
❯ claude mcp add -h                                       
Usage: claude mcp add [options] <name> <commandOrUrl> [args...]

Add a server

Options:
  -s, --scope <scope>          Configuration scope (local, user, or project) (default: "local")
  -t, --transport <transport>  Transport type (stdio, sse, http) (default: "stdio")
  -e, --env <env...>           Set environment variables (e.g. -e KEY=value)
  -H, --header <header...>     Set HTTP headers for SSE and HTTP transports (e.g. -H "X-Api-Key: abc123" -H "X-Custom: value")

https://docs.anthropic.com/ja/docs/claude-code/mcp#mcpサーバースコープの理解

tomonr1984tomonr1984

MCPの追加

docker Desktop

MCP Toolkit機能からGUIで追加できる

CLI

docker mcp catalog show | head -n 4
Ref: Ref powerful search tool connets your coding tools with documentation context. It includes an up-to-date index of public documentation and it can ingest your private documentation (eg. GitHub repos, PDFs) as well.
SQLite: Database interaction and business intelligence capabilities.
arxiv-mcp-server: The ArXiv MCP Server provides a comprehensive bridge between AI assistants and arXiv's research repository through the Model Context Protocol (MCP).   Features: • Search arXiv papers with advanced filtering • Download and store papers locally as markdown • Read and analyze paper content • Deep research analysis prompts • Local paper management and storage  Perfect for researchers, academics, and AI assistants conducting literature reviews and research analysis.
astra-db: An MCP server for Astra DB workloads.
docker mcp server enable -h  
Flag shorthand -h has been deprecated, use --help
Docker MCP Toolkit's CLI - Manage your MCP servers and clients.

Usage: docker mcp server enable
tomonr1984tomonr1984

desktopアプリからの接続

docker desktop

MCP Toolkit > Clientsタブから接続できる

Claude Desktop

tool名だけ表示されるので、見てもよくわからない

tomonr1984tomonr1984

起動コマンドを設定しているはずだが、起動していない状態でclaude codeを起動すると接続に失敗することがあった
docker mcp gateway run で起動したり、desktopアプリから一度利用すると接続できた