Hugging Face リモートMCPを OpenAI Codex CLI にMCP接続する方法(設定手順)

Hugging Face のリモートMCPサーバーを OpenAI Codex CLI に約1分でMCP接続。OAuth / 401 の問題は先に OAuth 2.1 デバッガーで確認できます。

🛡️ Official✓ VerifiedStreamable HTTPBearer Token🛡️ A+~369 tok12 tools
Streamable HTTPhttps://huggingface.co/mcp

🔒 Client-side only — never leaves your browser.

Add to ~/.codex/config.toml — Codex reads remote HTTP servers from [mcp_servers.*] tables:

[mcp_servers.huggingface]
url = "https://huggingface.co/mcp"
bearer_token_env_var = "HUGGINGFACE_TOKEN"

接続手順

  1. TOML を編集 — ~/.codex/config.toml に [mcp_servers.huggingface] と url = "https://huggingface.co/mcp" を追記します。
  2. 資格情報を設定 — bearer_token_env_var = "HUGGINGFACE_TOKEN" を追加し、同名の環境変数にキーを export します。
  3. 検証 — オンライン Inspector に https://huggingface.co/mcp を貼り付け、initialize と tools/list を実行して接続を確認します。

🧰 ツール一覧(12)

ToolSafetyDescriptionParameters
hf_doc_search
~31 tok
🟢 ReadSearch Hugging Face documentation.—
hf_doc_fetch
~30 tok
🟢 ReadFetch a Hugging Face docs page.—
model_search
~29 tok
🟢 ReadSearch models on the Hub.—
dataset_search
~30 tok
🟢 ReadSearch datasets on the Hub.—
space_search
~29 tok
🟢 ReadSearch Spaces on the Hub.—
paper_search
~29 tok
🟢 ReadSearch papers on the Hub.—
hub_repo_details
~31 tok
🟢 ReadGet details of a Hub repository.—
hf_whoami
~29 tok
🟢 ReadGet the authenticated HF user.—
space_info
~28 tok
🟢 ReadGet details of a Space.—
use_space
~28 tok
🟠 WriteCall a Hugging Face Space.—
model_info
~27 tok
🟢 ReadGet model card info.—
dataset_info
~28 tok
🟢 ReadGet dataset card info.—

その他の接続ガイド