Skip to content
All documentation

Import and sync

The command line tool onlymcp connects a machine to your account, registers OnlyMCP in the clients that have a configuration file, and moves your content in and out. It runs through npx, there is nothing else to install first.

Prerequisite: Node.js 22 or newer.

Connect this machine

npx onlymcp login

The command opens your browser on a page with the code already filled in, and also prints the code, the address and a QR code in case no browser opens. Sign in and confirm: this machine is now one of your devices and appears in your device list, where you can revoke it at any time. Right after that, login writes the stub files described below.

The token is kept in the keychain of your operating system, not in a file, and both the command line tool and the local package read it only from there. On a machine without a keychain, such as some servers without a desktop, use the remote route with a token instead, see supported clients. npx onlymcp status shows whether this machine is logged in. npx onlymcp logout ends this machine’s session on the server, which then no longer counts it as a device, and removes the login and the cache from this machine.

Register OnlyMCP in a client

npx onlymcp install --client claude-code npx onlymcp install --client codex npx onlymcp install --client gemini-cli

These commands register the local onlymcp package in the client: the client starts it on this machine over stdio, and it signs in with the login above, not with a token. --all writes every configuration file of these clients that already exists on this machine, and --print only shows what would be written. An existing configuration is read and merged, never replaced. For every other client, supported clients lists the command or configuration to paste.

Import what you already have

npx onlymcp import --dry-run npx onlymcp import

By default the import reads skills from ~/.claude/skills and agents from ~/.claude/agents. --skills <dir> and --agents <dir> point it elsewhere, and a plugin cache works as a skills folder too. Memory is only imported when you name a folder with --memory <dir>: there is no default, because a default aimed at somebody’s notes would be the worst thing this command could do. --dry-run shows what would be uploaded and stops.

The import never reads files such as .env or private keys, holds back any other file whose content looks like a credential and lists it with the line that matched, and asks before anything is uploaded; a held-back file goes up only if you release it there. --yes uploads without asking, for unattended runs, and leaves held-back files behind; without --yes and without a terminal, the import refuses.

--prune also removes from your account what the source no longer has. It lists everything it would delete and then asks once. It only touches your own entries that are not archived, never team entries, and only the kinds of content this run read: without --memory, your memory stays untouched. There is no --yes for it, and without a terminal it deletes nothing.

Keep clients in step

npx onlymcp sync

Some clients find skills and agents by scanning a folder. sync writes a small stub file there for every skill and agent, carrying its own description, so the client can offer it at the right moment; login does the same right after connecting. The stubs go to skills/<name>/SKILL.md and agents/<name>.md inside ~/.claude and inside ~/.codex, each only if it already exists, and inside every folder listed in the ONLYMCP_STUB_DIRS variable, separated by colons. If there is none of these, they go to ~/.claude/onlymcp/plugin.

The text of a skill or agent stays in OnlyMCP and is loaded when the client calls for it, but the supporting files of a skill are copied in full, so a skill that refers to one of its files works unchanged. A skill folder or agent file of your own that is already there is never overwritten, and sync lists it instead. sync adds and updates, it does not delete: the stub of a skill or agent removed in OnlyMCP stays on disk until you remove it yourself. --memory <dir> also writes your memory as files into the folder you name, and replaces a file there that has the same path.

Import and sync run in the command line, and the dashboard does not start them. The devices page shows for each device when it last ran an import and a sync, and how many files each run covered.

Take everything out

npx onlymcp export --zip onlymcp-export.zip

The export holds memory, skills, agents and connections, including anything archived after a plan change. Connections are listed without their credentials: no token and no OAuth sign-in is in the archive. A quota never blocks it: a full account stops growing, it never stops you from taking your content out. The one limit is 3 exports per hour. --out <dir> unpacks the archive into a folder instead, and --scope and --types narrow it down.

Where to go next