/ratel-local:ratel-localfrom Ratel Local
Configures, uses, and debugs the Ratel Local MCP gateway plugin and CLI. Manages upstream MCP servers, config scopes (user/project/local), daemon status, and troubleshooting.
Ships in Ratel Local. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Ratel Local sits between a host agent and upstream MCP servers:
Codex / Claude Code -> Ratel gateway -> upstream MCP servers
The plugin starts a small stdio connector; one persistent local daemon owns the
gateway instances. Keep upstream MCP definitions in Ratel config files, not in
the plugin .mcp.json.
The plugin .mcp.json runs npx -y @ratel-ai/[email protected] connect.
The connector sends its resolved project root to the authenticated loopback
daemon, which loads the appropriate config chain and shares upstream
connections only within that canonical project scope. Do not replace the
connector with a direct daemon HTTP URL or duplicate upstream MCP definitions
into the plugin .mcp.json.
Stable packages install the Ratel marketplace from the repository's default
main branch. Only prerelease package versions reconcile the marketplace to an
immutable matching Git tag. Never add an RC branch or ref for stable 0.9.0.
Run the setup wizard once from a terminal:
npx -y @ratel-ai/[email protected] setup
This is the default onboarding path: it makes the daemon ready, detects Claude Code and Codex, connects selected agents through the plugin-first link flow, then separately offers a previewed and confirmed MCP/skill import.
When the daemon is unavailable or the connector is temporarily detached, it exposes
ratel_daemon_status, ratel_daemon_start, and ratel_daemon_setup. The
start tool checks health and attaches without restarting an already-running
daemon. The setup tool returns the terminal command; interactive setup must
never be run on MCP stdio.
For human CLI work, install the package globally and use the ratel-local bin:
pnpm add -g @ratel-ai/[email protected]
ratel-local --version
Node 20.6 or newer is required.
Ratel config is layered from broad to narrow:
user: ~/.ratel/config.jsonproject: <project>/.ratel/config.jsonlocal: <project>/.ratel/config.local.jsonPrefer project for team-shared tools, local for machine-specific tools or secrets, and user for personal tools used across projects.
connect resolves the project root from --project-root,
RATEL_PROJECT_ROOT, CLAUDE_PROJECT_DIR, then its working directory. The
daemon loads user config plus project and local configs for that root. If
project tools are missing inside a host, check the resolved working directory
or set RATEL_PROJECT_ROOT explicitly.
When adding, removing, or changing upstream MCP server entries, use the
ratel-local mcp CLI by default. Do not edit Ratel config JSON files directly
unless one of these is true:
If falling back to direct JSON edits, state why the CLI was not used, preserve the existing config shape, and validate the JSON afterwards.
Top-level commands:
ratel-local setup performs complete daemon and agent onboarding. Repeat --agent for explicit agent automation; use --daemon-only to skip agent onboarding.ratel-local traces inspects or changes native Claude Code and Codex trace exporters through the daemon control plane.ratel-local connect bridges one agent session to its scoped daemon gateway.ratel-local daemon provides lower-level install, start, stop, restart, status, uninstall, and foreground run controls.ratel-local serve starts the MCP gateway over stdio.ratel-local import migrates agent MCP entries and native skills into Ratel.ratel-local link points an agent at the Ratel gateway without removing native MCP entries.ratel-local mcp manages upstream MCP server entries.ratel-local retrieval inspects and configures scoped BM25, semantic, or hybrid capability search.ratel-local backup manages backup snapshots.ratel-local project manages registered project roots.ratel-local skill manages Claude Code and Codex skills through Ratel.ratel-local doctor recovers interrupted mutations and diagnoses scoped config/OAuth state.ratel-local daemon open opens the persistent daemon UI with live client and gateway state.ratel-local ui opens the persistent daemon UI.ratel-local statusline renders or manages the Claude Code Ratel statusline.ratel-local --version or ratel-local version prints the CLI version.ratel-local help prints top-level usage.ratel-local mcp verbs:
add adds an upstream MCP server entry.remove removes an upstream from a Ratel scope.list lists configured upstreams across Ratel scopes.get shows one entry's resolved details.edit edits fields on an existing entry; it is interactive when no edit flags are supplied.auth runs OAuth for HTTP/SSE upstreams or checks stored auth state.ratel-local retrieval verbs:
status shows each scoped override and the effective retrieval mode.configure writes one atomic scoped retrieval override.reset removes one override so the earlier scope is inherited again.prepare downloads or verifies a dense model, or checks an Ollama/endpoint source.ratel-local skill verbs:
import imports discovered skills into a user, project, or local registration.add-scope adds another scoped reference or owned copy for a skill.remove-scope removes only the selected registration.remove removes a registration and its owned copy when applicable.list shows effective, configured, or discovered scoped skills.suggest ranks skills for a prompt.preload-hook is the UserPromptSubmit hook entrypoint.install-hook registers the preload hook in settings.json.uninstall-hook removes the preload hook from settings.json.ratel-local statusline verbs:
install writes the user-scope Claude Code ~/.claude/settings.json statusLine.uninstall removes only a Ratel-owned statusLine.install --force replaces another configured statusLine.Run complete interactive onboarding:
ratel-local setup
setup is idempotent. It installs, updates, or starts the daemon; detects
Claude Code and Codex; asks which agents to connect through the plugin-first
link flow; and separately offers native MCP servers and skills for preview and
confirmation.
Safe automation:
# Preserve the historical daemon-only --yes behavior
ratel-local setup --yes
ratel-local setup --daemon-only --yes
# Explicitly connect one or more agents; imports are still skipped
ratel-local setup --yes --agent claude-code --agent codex
ratel-local setup --yes --agent auto
# First installation on a custom daemon port
ratel-local setup --daemon-only --yes --port 7331
Never assume setup --yes imports native configuration. Use the expert
ratel-local import --yes --agent <agent> command only when automated migration
was explicitly requested. ratel-local daemon, ratel-local link, and
ratel-local import remain available for targeted workflows.
Manage native trace and structured-log export through the CLI, never by directly editing Claude Code or Codex configuration:
Cloud telemetry ships off by default. Before offering setup or changing an
exporter, check ratel-local traces status. If the feature is off, explain that
the user must start a foreground daemon with
RATEL_FEATURE_CLOUD_TELEMETRY=1, or restart the background service with that
environment present so the installed service definition is updated. Do not treat
saved Cloud credentials as an enablement signal. daemon start does not rewrite
an installed service.
# Enable an existing background service
RATEL_FEATURE_CLOUD_TELEMETRY=1 ratel-local daemon restart
# Keep enabled (flag absent)
ratel-local daemon restart
# Disable
RATEL_FEATURE_CLOUD_TELEMETRY=0 ratel-local daemon restart
# Fallback: reinstall with the environment persisted
ratel-local daemon uninstall
RATEL_FEATURE_CLOUD_TELEMETRY=1 ratel-local daemon install
These lifecycle commands preserve Ratel configuration and saved Cloud settings.
For a new interactive installation that should offer telemetry onboarding, run
RATEL_FEATURE_CLOUD_TELEMETRY=1 ratel-local setup.
# Always inspect semantic state first
ratel-local traces status
ratel-local traces status --agent codex --json
# Mutations require explicit host selection
ratel-local traces enable --agent claude-code --agent codex
ratel-local traces enable --agent claude-code --level tool-details
ratel-local traces enable --agent codex --level tool-activity
ratel-local traces disable --agent codex
Plain traces enable selects Redacted. Claude Code also supports
--level tool-details and --level full-content. Codex supports
--level tool-activity and --level prompt-content; Tool activity includes
structured codex.tool_result output snippets even with prompt logging off.
Treat all enhanced levels as content-bearing. Interactive runs must confirm the
privacy warning, and automation must pass the explicit level with both
--confirm-content and --yes. Never enable OTEL_LOG_RAW_API_BODIES.
If status reports stale, enable safely repairs the old Ratel daemon port. If
it reports conflict, explain that replacement is irreversible because Ratel
does not retain the displaced exporter, and request the user's approval before
using --overwrite. Non-interactive replacement requires both --overwrite
and --yes; never infer that approval. Do not request, read, or pass a Ratel
Cloud API key for agent exporter setup. The agent config contains only the
daemon-derived loopback route, and the daemon owns Cloud credentials.
When interactive trace setup reports that Ratel Cloud is not configured, let
the user enter the key directly into the CLI's masked prompt or Agent Setup's
password field. Never ask the user to disclose the key in chat or place it in a
command. If the user needs a key, direct them to
https://cloud.ratel.sh/settings. Non-interactive --yes runs never prompt for
or consume a Cloud API key.
Plain setup --yes deliberately skips traces. Automated setup must be explicit:
ratel-local setup --yes --traces --agent claude-code --agent codex
Inspect configured upstreams:
ratel-local mcp list
Inspect or opt into dense retrieval:
# BM25 is the model-free default.
ratel-local retrieval status
# Opt one project into the pinned built-in model, then prepare it.
ratel-local retrieval configure --scope project --method hybrid --source built-in
ratel-local retrieval prepare --scope project
Treat retrieval as an atomic scoped setting: a narrower scope replaces the
entire earlier retrieval block. Dense configuration is opt-in. After
configure, reset, prepare, or dense OAuth changes, reconnect the affected
agent/context so it acquires the new immutable gateway generation. Use the
Settings page in the daemon UI for the same validated flow and consult
docs/retrieval.md in the repository for model, memory, and privacy details.
Run a one-off gateway from the current project without the daemon:
ratel-local serve --auto-config
Open the local UI:
ratel-local daemon open
ratel-local ui --no-open prints a persistent daemon UI session URL without
opening a browser.
Required workflow for adding a stdio upstream:
ratel-local mcp add --scope project github -- npx -y @modelcontextprotocol/server-github
Required workflow for adding a stdio upstream with local secrets:
ratel-local mcp add --scope local github --env GITHUB_TOKEN=... -- npx -y @modelcontextprotocol/server-github
Required workflow for adding an HTTP or SSE upstream:
ratel-local mcp add --scope project docs https://example.com/mcp --transport http
ratel-local mcp add --scope project docs https://example.com/sse --transport sse
Required workflow for adding headers to an HTTP/SSE upstream:
ratel-local mcp add --scope local docs https://example.com/mcp --header "Authorization: Bearer ..."
Import existing host MCP servers into Ratel:
ratel-local import --agent codex
ratel-local import --agent claude-code
If the selected agent is not linked, interactive import first offers to link and continue, continue without linking, or cancel. Import then resolves selected MCP entries against the matching Ratel scopes: the conflict strategy decides whether to add the incoming definition, replace the Ratel definition, or keep the existing Ratel definition. Entries covered by the resulting plan are removed from the source agent, and selected native skills are managed as invoke-only.
Preview or automate an import:
ratel-local import --agent codex --dry-run
ratel-local import --agent codex --yes --conflict-strategy add-missing-only
Supported conflict strategies are add-missing-only, replace-selected, and
replace-from-agent. --dry-run performs no writes. --yes accepts the
non-interactive defaults; do not combine replace-selected with --yes or
--dry-run because per-conflict choices require interaction.
Link a host to the Ratel gateway without importing or removing native MCP entries:
ratel-local link --agent codex
ratel-local link --agent claude-code
ratel-local link changes only the gateway configuration; it never installs the
Claude Code statusline. After a successful Claude Code import, import offers a
separate, skippable statusline step when the Ratel statusline is not already
installed. With --yes, import installs a missing statusline automatically but
leaves an existing non-Ratel statusline unchanged. Manage it directly with:
ratel-local statusline install
ratel-local statusline install --force
ratel-local statusline uninstall
Claude Code plugins cannot currently set top-level statusLine defaults
directly; use the standalone statusline CLI, the optional import step, or the
Claude Code agent page in ratel-local daemon open. The statusline reports
Ratel as on when Claude Code starts Ratel via a linked MCP entry or an enabled
ratel-local@... plugin.
Authorize HTTP/SSE upstreams:
ratel-local mcp auth
ratel-local mcp auth <name>
ratel-local mcp auth --check
Inspect backups:
ratel-local backup list
npx are available..mcp.json starts @ratel-ai/[email protected] with connect.ratel-local daemon status; if needed, run ratel-local setup.ratel-local mcp list to verify Ratel config has upstreams.ratel-local connect from the relevant project to reproduce the scoped bridge outside the host, or ratel-local serve --auto-config to isolate the gateway itself.ratel-local mcp auth --check or ratel-local mcp auth <name>./mcp and /reload-plugins after plugin changes.Common findings:
ratel_daemon_status first. When it reports running, ratel_daemon_start safely reattaches without restarting the daemon. When it reports stopped, call ratel_daemon_start; when it reports not-installed, use the command returned by ratel_daemon_setup.RATEL_FEATURE_CONNECTOR_RECOVERY=1 on the connector process to opt into bounded automatic reattachment. The feature is off by default while it rolls out.mcpServers.ratel-local retrieval status, then ratel-local retrieval prepare in the affected project. Reset that scope to BM25 when the configured model or endpoint should not be used.RATEL_PROJECT_ROOT or run from the project directory.npx may need network access to resolve the pinned npm package version.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub ratel-ai/ratel-local --plugin ratel-local2 skills in this plugin
Other plugins' skills for the same job