Import or link
Move native MCP entries behind Ratel Local or connect a host without migrating them.
Use import to move existing host servers behind Ratel Local. Use link when Ratel is
already configured and you only need to connect the host.
For first-time onboarding, run ratel-local setup. It prepares the daemon, links the
agents you select, then offers import as a separate reviewed step.
| Starting point | Command | Result |
|---|---|---|
| Native MCP servers or skills should move behind Ratel | import | Moves selected entries into Ratel and connects the agent when needed |
| Ratel scopes are already configured | link | Installs or enables the Ratel Local plugin; falls back to an MCP entry only when needed |
| First-time setup | setup | Prepares the daemon, links selected agents, and offers a reviewed import |
| Fresh Ratel configuration | mcp add | Adds upstreams directly to Ratel; no host rewrite |
The plugin is the preferred integration
Install the Ratel Local plugin for Claude Code or Codex. It bundles the gateway and
agent skills. Its MCP entry runs the lightweight connect bridge to the persistent
daemon. An enabled plugin is already a Ratel connection, so import does not add a
second gateway. link reconciles and reinstalls the stable plugin when needed; it also
re-enables a disabled Codex plugin MCP server.
Supported hosts and files
Import and link have native adapters for Claude Code and Codex only.
| Host scope | Claude Code | Codex |
|---|---|---|
| User | ~/.claude.json | ~/.codex/config.toml |
| Project | <projectRoot>/.mcp.json | <projectRoot>/.codex/config.toml |
| Local | projects[<absolute root>].mcpServers in ~/.claude.json | Not supported by the adapter |
Without --agent, auto-detection chooses the first supported host with native entries:
Claude Code, then Codex. Pass --agent when both are configured. Cursor and other MCP
clients use manual host configuration.
Import native servers
ratel-local import --agent claude-code imports selected Claude Code MCP servers and
native skills into matching Ratel scopes.
Run the wizard from the project where you use the native servers.
ratel-local import
ratel-local import --agent claude-code
ratel-local import --agent codex
ratel-local import --agent codex --dry-run--dry-run prints planned writes and does not change files. The interactive flow may
still start upstreams to read their instructions before it renders the plan. --yes
selects every candidate, skips those probes and prompts, and keeps existing Ratel entries
when names conflict.
If the source agent is not linked, the wizard first offers to link Ratel Local, continue without linking, or cancel. Linking installs the agent plugin when possible; only a failed plugin installation falls back to an explicit MCP gateway entry.
The import then has these stages:
- Select native MCP entries and move them into matching Ratel scopes.
- Select native skills to manage as invoke-only.
- Remove the selected MCP entries from the source agent.
The final import commit asks for confirmation. Claude Code then offers a separate, skippable statusline installation step.
If you continue without linking, imported MCPs and skills are not usable from that source
agent until you run link later.
Entries you do not select stay native. Claude Code scopes are preserved. Codex preserves user and project scopes; its adapter has no local scope.
When the same name appears at multiple scopes, the most specific candidate wins: local, then project, then user.
Resolve name conflicts
Choose how imports handle a server name that already exists in Ratel.
| Strategy | Behavior |
|---|---|
add-missing-only | Keep the Ratel entry and skip the incoming duplicate |
replace-selected | Ask which selected duplicates to replace |
replace-from-agent | Replace duplicates with the host versions |
ratel-local import --agent codex \
--conflict-strategy add-missing-onlyreplace-selected is interactive. It cannot be combined with --yes or --dry-run.
Review converted entries before committing
Ratel Local runs stdio, http, and sse. Claude Code's
streamable-http alias and helper-specific fields are not normalized during import.
Codex-only controls such as env_vars, timeouts, tool filters, approval modes, and
OAuth tokens are not migrated.
Inspect with mcp get, correct the entry, and reauthorize remote servers before
committing the import.
Before and after
Stage one copies the selected entry into the matching Ratel scope:
{
"mcpServers": {
"context7": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
}
}
}When plugin installation is unavailable, linking or importing with link enabled writes one reviewed fallback connector entry. The generated command and absolute path depend on your global installation and host scope.
{
"mcpServers": {
- "context7": {
- "type": "stdio",
- "command": "npx",
- "args": ["-y", "@upstash/context7-mcp"]
+ "ratel-local": {
+ "type": "stdio",
+ "command": "/absolute/path/to/ratel-local",
+ "args": ["connect", "--agent-host", "claude-code", "--link-scope", "user"]
}
}
}-[mcp_servers.context7]
-command = "npx"
-args = ["-y", "@upstash/context7-mcp"]
+[mcp_servers.ratel-local]
+command = "/absolute/path/to/ratel-local"
+args = ["connect", "--agent-host", "codex", "--link-scope", "user"]
+enabled = trueLink without migrating
ratel-local link --agent claude-code
ratel-local link --agent codexlink installs or reconciles the stable Ratel Local plugin first. A disabled Codex
plugin MCP server is re-enabled. If a new plugin installation fails, link writes a
ratel-local fallback connector entry. A failed reconciliation of an existing plugin
stops instead of silently replacing a working connection. Native MCP entries are not
moved or removed.
Stable releases follow the marketplace's default main branch. Do not add a branch, tag,
or --ref override to a stable link.
link supports --yes but has no dry-run mode. Use the interactive preview when you
want to inspect every planned host write.
Restart the host after an import or link. Then confirm the entry:
claude mcp get ratel-localcodex mcp get ratel-local --jsonBackups and rollback
add, edit, remove, import, and link snapshot every file they change under a
timestamped directory in ~/.ratel/backups/ before writing.
Scoped mutations are revision-checked and journaled. A failed multi-file commit restores the files written by that commit when restoration is supported.
ratel-local backup list
ls -1 ~/.ratel/backupsbackup list prints only the creation time, action, and file count. Open the matching
manifest.json to find each originalPath, hashed backupPath, and existedBefore
value. An import can create separate backup sets for its Ratel and host stages.
There is no restore command. To roll back, stop the host, save the current file elsewhere,
copy each required backupPath to its originalPath, and restart the host.
When existedBefore is false, no older body exists. Save the new file elsewhere, then
remove it to restore the original state. A failed multi-file stage restores files it
already wrote, but it does not reverse an earlier completed import stage.
Next steps
MCP servers
Inspect scopes, add upstreams, and run the gateway directly.
Quickstart
Follow the full Claude Code or Codex setup and verification path.
Cursor
Move Cursor entries manually and add one standard stdio gateway.
Troubleshooting
Recover from conversion, scope, duplicate-registration, or rollback problems.