Skip to main content
Glama

mcp-bridge

Docker で MCP サーバを起動し、内部で llama.cpp の OpenAI 互換 API を呼び出す構成です。

セットアップ

  1. .env.example を .env にコピー

  2. MCP_API_TOKEN を 32 文字以上のランダム値に設定

    echo "MCP_API_TOKEN=$(openssl rand -hex 32)" >> .env
  3. 必要に応じて LLAMA_CPP_SERVER_URL をリモートの llama.cpp に向ける

Related MCP server: SwiftOpenAI MCP Server

起動

docker compose up -d --build

停止

docker compose down

接続先

  • MCP エンドポイント: http://localhost:8000/mcp

  • トランスポート: streamable-http

接続確認

認証が有効になっているため、Bearer トークンが必要です。 401 が返る場合は未認証、406 が返る場合は到達確認としては正常です (MCP エンドポイントは Accept ヘッダー前提のため)。

# 未認証 -> 401
curl -i http://localhost:8000/mcp

# 認証あり -> 406 (到達OK)
curl -i -H "Authorization: Bearer $MCP_API_TOKEN" http://localhost:8000/mcp

Claude Code 設定

Claude Code の MCP は ~/.claude.json で管理されます。

ローカルスコープ(特定プロジェクトのみ)で手動設定する場合は、 client-config.example.json の形式を ~/.claude.json に反映してください。

推奨: CLI で追加

claude mcp add --transport http local-agent-helper http://localhost:8000/mcp \
  --header "Authorization: Bearer $MCP_API_TOKEN"

設定確認

claude mcp list
claude mcp get local-agent-helper

補足

  • --scope user を付けると全プロジェクトで利用可能です。

  • --scope project を使うと、プロジェクト直下の .mcp.json に保存されます。

環境変数

.env.example を .env にコピーして利用できます。

  • MCP_TRANSPORT (既定: streamable-http)

  • FASTMCP_HOST (既定: 0.0.0.0)

  • FASTMCP_PORT (既定: 8000)

  • LLAMA_CPP_SERVER_URL

  • LLAMA_CPP_SERVER_MODEL

  • LLAMA_CPP_SERVER_TIMEOUT

  • MCP_API_TOKEN (必須・32文字以上)

  • MAX_INPUT_CHARS (既定: 200000)

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    F
    maintenance
    A lightweight bridge that wraps OpenAI's built-in tools (like web search and code interpreter) as Model Context Protocol servers, enabling their use with Claude and other MCP-compatible models.
    4
    12
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    A universal server that enables MCP-compatible clients (like Claude Desktop, Cursor, VS Code) to access OpenAI's APIs for chat completions, image generation, embeddings, and model listing through a standardized interface.
    17 npm
    7
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server that bridges MCP clients with local LLM services, enabling seamless integration with MCP-compatible applications through standard tools like chat completion, model listing, and health checks.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Bridges MCP tool calls with OpenAI-compatible HTTP endpoints, allowing MCP clients to forward chat completion requests through a unified FastAPI server that returns responses with MCP-specific headers.
    1
    -