Skip to main content
Glama
ML Intern MCP

ML Intern MCP

Official
by candacelabs

ML Intern MCP

Use HuggingChat’s ML Intern tools from GitHub Copilot or Codex to read papers, inspect model checkpoints and datasets, and run Hugging Face Jobs.

Bring your own sandbox (BYOS). Run commands and work with files on an existing Hugging Face sandbox, exe.dev VM, or Modal Sandbox. You control its lifetime and cost. Disconnecting leaves it running.

Install

Run the command for your client in a macOS or Linux terminal. It downloads the server and a private runtime, then registers it with the client. The second line opens a chat and asks it to read a public model config. The expected answer is 12 layers.

GitHub Copilot CLI

curl -fsSL https://github.com/candacelabs/ml-intern-mcp/releases/latest/download/install.sh | sh -s -- copilot
copilot -i 'Use ML Intern to read google-bert/bert-base-uncased/config.json. How many transformer layers does it have?'

GitHub Copilot in VS Code

curl -fsSL https://github.com/candacelabs/ml-intern-mcp/releases/latest/download/install.sh | sh -s -- vscode
code chat --mode agent 'Use ML Intern to read google-bert/bert-base-uncased/config.json. How many transformer layers does it have?'

Codex

curl -fsSL https://github.com/candacelabs/ml-intern-mcp/releases/latest/download/install.sh | sh -s -- codex
codex 'Use ML Intern to read google-bert/bert-base-uncased/config.json. How many transformer layers does it have?'

Client

Check

Install

Copilot CLI

copilot --version

curl -fsSL https://gh.io/copilot-install | bash

Codex

codex --version

curl -fsSL https://chatgpt.com/codex/install.sh | sh

VS Code on macOS with Homebrew

code --version

brew install --cask visual-studio-code

VS Code on Linux with Snap

code --version

sudo snap install --classic code

If a freshly installed CLI is outside this shell’s path, use export PATH="$HOME/.local/bin:$PATH". For an existing macOS VS Code app, use export PATH="/Applications/Visual Studio Code.app/Contents/Resources/app/bin:$PATH". The CLI sign-in commands are copilot login and codex login. Copilot installation · Codex installation · VS Code on Linux

Related MCP server: hf-mcp-server

Work with an existing sandbox

This example connects Copilot to an existing exe.dev VM. In Bash or Zsh, the first prompt reads your token without displaying it. The installer saves the variable name, and Copilot passes its value when starting the server.

printf 'exe.dev token: '; IFS= read -rs EXE_TOKEN; printf '\n'; export EXE_TOKEN
printf 'VM name: '; IFS= read -r EXE_VM
curl -fsSL https://github.com/candacelabs/ml-intern-mcp/releases/latest/download/install.sh | sh -s -- copilot exe.dev
copilot -i "Use ML Intern to run pwd on my exe.dev VM named $EXE_VM."

Installer argument

Existing sandbox

Credentials

hf

Dedicated Hugging Face sandbox Job you own or created, identified by NAMESPACE/JOB_ID

Its original HF_TOKEN

exe.dev

VM name, such as my-research-vm

EXE_TOKEN with ssh <vm-name> permission

modal

Modal Sandbox ID beginning with sb-

MODAL_TOKEN_ID, MODAL_TOKEN_SECRET

These Bash/Zsh examples register the client and launch it with the credentials for that provider.

Hugging Face with Copilot CLI

printf 'Original HF sandbox token: '; IFS= read -rs HF_TOKEN; printf '\n'; export HF_TOKEN
printf 'Namespace/job ID: '; IFS= read -r HF_SANDBOX_ID
curl -fsSL https://github.com/candacelabs/ml-intern-mcp/releases/latest/download/install.sh | sh -s -- copilot hf
copilot -i "Check the status of my Hugging Face sandbox $HF_SANDBOX_ID."

Modal with Codex

printf 'Modal token ID: '; IFS= read -r MODAL_TOKEN_ID; export MODAL_TOKEN_ID
printf 'Modal token secret: '; IFS= read -rs MODAL_TOKEN_SECRET; printf '\n'; export MODAL_TOKEN_SECRET
printf 'Modal sandbox ID: '; IFS= read -r MODAL_SANDBOX_ID
curl -fsSL https://github.com/candacelabs/ml-intern-mcp/releases/latest/download/install.sh | sh -s -- codex modal
codex "Check the status of my Modal sandbox $MODAL_SANDBOX_ID."

One registration can forward multiple providers’ credentials.

curl -fsSL https://github.com/candacelabs/ml-intern-mcp/releases/latest/download/install.sh | sh -s -- copilot hf exe.dev modal

For an existing Hugging Face app connection in Codex, this companion adds public reads while the connected app handles identity and Jobs.

curl -fsSL https://github.com/candacelabs/ml-intern-mcp/releases/latest/download/install.sh | sh -s -- codex public-files

Provider examples and client settings

Public preview. All three providers passed fixture tests. Live sandbox execution still needs verification.

The installer supports Apple Silicon and Intel Macs, and x64 and ARM64 Linux with glibc. It also supports x64 Linux with musl. It verifies the downloads and installs under $XDG_DATA_HOME/ml-intern-mcp, defaulting to ~/.local/share/ml-intern-mcp. The same install command upgrades the client’s registration. For another stdio client, the standalone installer prints the executable path. These commands display its version and run it in BYOS mode.

ml_intern=$(curl -fsSL https://github.com/candacelabs/ml-intern-mcp/releases/latest/download/install.sh | sh -s -- standalone)
"$ml_intern" --version
"$ml_intern" --byos

For an existing shared MCP endpoint, this registers its HTTPS URL with Copilot CLI.

printf 'MCP endpoint URL: '; IFS= read -r MCP_URL
copilot mcp add --transport http ml-intern-remote "$MCP_URL"

Shared endpoint examples for Copilot and Codex · Installer source · Release downloads

Sandbox tools

Every call takes a provider and sandboxId and returns both in the result. Files persist between calls in the same running sandbox. Each command starts a fresh shell.

Tool

What you supply

What you get back

sandbox_status

Just the provider and ID

state (running, stopped, or unknown)

sandbox_exec

A command, optionally cwd, stdin, and timeoutSeconds

stdout, stderr, exitCode, and timedOut

sandbox_read_file

An absolute path, optionally maxBytes

UTF-8 text, byte count, and truncated

sandbox_write_file

An absolute path and UTF-8 text

Number of bytes written

The example runner sends a tools/call request like this one.

{
  "name": "sandbox_exec",
  "arguments": {
    "provider": "exe.dev",
    "sandboxId": "my-research-vm",
    "command": "printf ml-intern-ok",
    "timeoutSeconds": 10
  }
}

A successful response has this structuredContent.

{
  "provider": "exe.dev",
  "sandboxId": "my-research-vm",
  "stdout": "ml-intern-ok",
  "stderr": "",
  "exitCode": 0,
  "timedOut": false
}
  • Commands have a 30-second default timeout, a 55-second maximum, and a 1 MiB limit on each output stream. A nonzero exit code is part of the result. Provider failures return MCP tool errors.

  • Reads default to 20,000 bytes. Each file call can transfer up to 100,000 UTF-8 bytes. The following command writes hello\n to the scratch file and reads it back. It replaces any existing file at that path. It uses the exe.dev token and VM name from the example above.

ml_intern="${XDG_DATA_HOME:-$HOME/.local/share}/ml-intern-mcp/current/ml-intern-mcp"
"$ml_intern" example exe.dev "$EXE_VM" --write-path /tmp/ml-intern-example.txt

Sandbox input and output schemas

Deployment and development

Mode

Tools available

Default, anonymous

hf_fs, hub_repo_details, hf_whoami

Default, verified Hub credential

The public tools plus hf_fs_write, create_repo, hf_jobs, hf_sandbox, hf_sandbox_exec, and hf_sandbox_fs

--public-files

hf_fs for public file and paper reads

--byos

The caller’s Hub tools plus the four sandbox tools above

The standalone executable serves stdio by default. This starts Streamable HTTP with BYOS on loopback.

ml_intern="${XDG_DATA_HOME:-$HOME/.local/share}/ml-intern-mcp/current/ml-intern-mcp"
"$ml_intern" --http --byos

In another terminal, these commands check listener health and probe an existing sandbox. The probe uses the same EXE_TOKEN and EXE_VM as the exe.dev example above.

curl -fsS http://127.0.0.1:8787/healthz
"${XDG_DATA_HOME:-$HOME/.local/share}/ml-intern-mcp/current/ml-intern-mcp" example exe.dev "$EXE_VM" --url http://127.0.0.1:8787/mcp

On the gateway host, this starts the backend for a public HTTPS origin. The origin is the scheme and hostname clients use, such as https://mcp.example.com.

printf 'Public HTTPS origin: '; IFS= read -r MCP_ORIGIN
"${XDG_DATA_HOME:-$HOME/.local/share}/ml-intern-mcp/current/ml-intern-mcp" --http --byos \
  --host 127.0.0.1 --port 8787 --public-origin "$MCP_ORIGIN"

The gateway supplies TLS and authentication, preserves Host, Origin, and streaming responses, and keeps credential headers out of logs. Gateway Authorization and per-caller provider headers serve different purposes. A gateway that injects credentials must overwrite client-supplied values. The MCP listener checks host and browser origin and drains active requests for up to 15 seconds on SIGTERM. Client connection commands

The server runs Hugging Face’s pinned intern handlers. Both transports use the same generated tool definitions. The generated client factories are createMlInternClient for Hub tools and createByosClient for sandbox tools. Hub contract · Sandbox contract · Generated clients

Source development uses Git and Node.js 22.14 or newer. With the nvm version manager, the command for the Node 22 development toolchain is nvm install 22.

git clone https://github.com/candacelabs/ml-intern-mcp.git
cd ml-intern-mcp
npm ci

A Linux maintainer can build the release assets with scripts/build-release.sh ./dist.

Command

Checks

npm test

Generated bindings and types, stdio and HTTP, caller isolation, provider fixtures, and runnable examples

npm run check:drift

HuggingChat’s current preset, live public tool schemas and a pinned BERT file, plus nine tool schemas and 15 Jobs operations from the pinned package

npm run check:sandbox -- "$HF_SANDBOX_ID"

Health, shell, and root directory metadata on your existing sandbox via Hugging Face’s native tools

node examples/run.mjs exe.dev "$EXE_VM"

Your provider’s status and command execution on an existing sandbox

Verified in v0.3.1. On Linux x64, all three clients registered the public release in an environment without Node.js, npm, or Git on the path. Copilot CLI discovered the installed tools and read the live public BERT checkpoint using a test model to request the call. Provider sandbox operations passed against fixtures. Live sandbox execution and installation on macOS and ARM remain unverified.

After a pin change, these commands capture the schemas, show the changes, regenerate the clients, and verify the result.

npm run capture
git diff -- openapi.yaml byos.openapi.yaml
npm run generate && npm test && npm run check:drift

HuggingChat preset · Upstream Hub tools · License notices

License

The project’s original code is licensed under Apache 2.0. Third-party components retain their own licenses. Project license · Upstream notices

Available Tools

3 tools
hf_fsHugging Face Hub: Find, use and view models, datasets, spaces, buckets, papers, documentation and collections. Get daily papers reports, and browse trending content. A
Read-only

When to use: Hugging Face Hub models, datasets, Spaces, collections, papers, daily papers, today's trending models, current paper leaderboard, docs; list and read repository files, model and dataset cards (README, license).

Examples: {"operations":[{"cmd":"ls","args":["hf://models/trending","--limit","10"]}]} {"operations":[{"cmd":"ls","args":["hf://papers/trending"]}]} {"operations":[{"cmd":"ls","args":["hf://papers/daily/latest"]}]} {"operations":[{"cmd":"cat","args":["hf://papers/2501.00001/paper.md"]}]} {"operations":[{"cmd":"search","args":["hf://models","--tag","base_model:finetune:org/repo"]}]}

Use hf_fs for Hugging Face Hub filesystem operations. Call it with operations, an array of {cmd, args} items; multiple operations may be submitted together.

Usage: {"operations":[{"cmd":"ls","args":["hf://models/org/repo"]}]}

Grammar; each string below is one args array item: ls URI [--recursive] [--glob GLOB] [--type TYPE] [--sort SORT] [--limit N] cat URI [--offset N] [--max-bytes N] attach URI [--max-bytes N] stat URI find URI [--name GLOB] [--path GLOB] [--type TYPE] [--limit N] search URI [QUERY] [--type TYPE] [--sort SORT] [--tag TAG] [--kind mcp] [--limit N]

COMMAND = ls|cat|attach|stat|find|search. TYPE = file|dir|repo|bucket|collection|paper|link. SORT = createdAt|downloads|likes|lastModified|likes30d|trendingScore|mainSize|id|trending|upvotes. URI is a canonical hf:// URI. QUERY and GLOB are each one string.

Use search for resource discovery, not repository-content search; ls for a known directory, find for recursive file discovery by name/path (not file contents), stat for filesystem metadata or an uncertain target type, cat for text contents, and attach for a complete JPEG, PNG, or WebP image. When the request gives an exact text-file URI, use cat directly; do not add ls or stat first. stat does not read the contents of JSON, Markdown, or other text files.

Search scopes: hf://models[/OWNER], hf://datasets[/OWNER], hf://spaces[/OWNER], hf://collections[/OWNER], hf://papers, and hf://docs[/...]. Repository and repository-file scopes are not supported: search a resource root or owner scope to discover resources; use find for file discovery within a repository or cat for a known text file. Paper and documentation search require QUERY. --tag filters models, datasets, and Spaces by Hub tag (repeatable; all must match) and applies only to hf://models|datasets|spaces[/OWNER]; omit QUERY when the tag already identifies the target, because QUERY also filters repository names. Derived models carry base_model:ID and base_model:RELATION:ID tags, where RELATION is finetune, adapter, merge, or quantized. --kind applies only to hf://spaces[/OWNER]; the only valid --kind value is mcp, which selects MCP Spaces. Tag families are documented at hf://README.md. Use ls hf://models/trending, hf://datasets/trending, hf://spaces/trending, or hf://papers/trending for trending listings. hf://papers/ID is a paper directory, not paper text. Use cat hf://papers/ID/paper.md for paper text and cat hf://papers/ID/metadata.json for metadata. No preliminary listing is needed for these known paths. Use ls hf://papers/ID to discover other resources. Omit --limit, --sort, and --type unless the request requires them. Limits and path-specific behavior are documented at hf://README.md. Issue one hf_fs call.

Links: hf://models|datasets|spaces/OWNER/NAME/PATH maps to https://huggingface.co[/datasets|/spaces]/OWNER/NAME/resolve/main/PATH (buckets: https://huggingface.co/buckets/OWNER/NAME/resolve/PATH); URL-encode each path segment. arXiv ids (for example 2502.16161) link papers, models and datasets.

Inputs: operations (required). Returns: results, truncated, truncation_reason

hf_whoamiHugging Face User InfoA
Read-only

Inspect the current Hugging Face authentication context, including the account, visible organization memberships, and credential access details. Read-only and never returns credential values.

Inputs: no named parameters. Returns: object

hub_repo_detailsHub Repository DetailsA
Read-only

Get details for one or more Hugging Face repos (model, dataset, or space): card metadata, license, downloads, files, Space hardware/status, dataset configs, splits, columns and preview rows. Auto-detects type unless specified. For datasets, use operations: overview, dataset_structure, dataset_preview. Use dataset_structure first to discover configs, splits, sizes, and schema. Use dataset_preview only when config and split are known, unless the dataset has a single config/split.

Inputs: repo_ids (required), limit, split, config, +3 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 3 tools

    Disambiguation4/5

    The three tools have mostly distinct high-level roles: auth inspection, structured repo/dataset details, and generic Hub filesystem operations. There is some overlap because hf_fs can also list/read repo files and cards, which hub_repo_details also exposes, but the descriptions make the intended split reasonably clear.

    Naming Consistency3/5

    All names use snake_case, but the conventions are mixed: hf_whoami is an action, hub_repo_details is a noun phrase with a different prefix, and hf_fs is an abbreviated noun. The set is readable but does not follow a single predictable pattern.

    Tool Count4/5

    Three tools is within the reasonable range and each has a clear role. However, hf_fs is very broad with many commands and scopes, so the surface feels somewhat collapsed into one mega-tool rather than cleanly separated capabilities.

    Completeness4/5

    The read-only Hugging Face Hub surface is strong: auth context, repo metadata, dataset structure/preview, filesystem browsing, search, papers, docs, and trending listings are covered. Minor gaps remain around write/upload operations and deeper dataset querying beyond preview, but core exploration workflows are covered.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Connects LLMs to the Hugging Face Hub and thousands of Gradio AI applications, enabling repository search, file access, Space interaction, jobs, and sandbox tools through MCP. Supports STDIO and Streamable HTTP transports with optional Hugging Face authentication.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables local AI agents to manage GitHub Codespaces workspaces and execute remote tasks by checking out exact commits, running builds, tests, scripts or temporary services, downloading logs and artifacts, and stopping or exporting managed environments.
      12
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables Codex conversations to delegate tasks to persistent worker subagents backed by models configured in VS Code, including BYOK endpoints. Provides workspace inspection and controlled editing tools, approval-gated shell commands, transcripts, and worker lifecycle management.
      1
      MIT