Skip to main content
The Offline Protocol CLI (@offline-protocol/cli 0.3.3) installs the offline command and a local MCP server. Use them to find packages, read integration guidance, plan an application and scaffold project files. Hosted MCP provides the same registry and planning context without a local installation, but cannot write files. Neither MCP mode runs the mesh or communicates with peers. Build and test device communication with the Mesh SDK. This page covers the Offline Protocol MCP server; the separate docs MCP server at https://www.offlineprotocol.com/docs/mcp only searches and reads these documentation pages.

Install

Requires Node.js 18 or later. Prebuilt binaries cover macOS arm64 and x64, Linux x64 and arm64, and Windows x64. npm installs only the binary for your machine, from a per-platform optional dependency such as @offline-protocol/cli-darwin-arm64, so keep optional dependencies enabled: do not install with --omit=optional or --no-optional.
Without a global installation:
Use npx -y @offline-protocol/cli <command> for any command below. Install through npm; the crates.io package is a placeholder, not the released CLI.

Changes in 0.3.3

  • offline create, offline add and the MCP tools resolve SDK 0.33.0, so new scaffolds install @offline-protocol/mesh-sdk 0.33.0, and the registry covers requestMeshPermissions, the development warnings and 0.33.0 mesh delivery. Hosted MCP serves it too.
  • offline init and new scaffolds start the local MCP server with @offline-protocol/cli@0.3.3.

Changes in 0.3.2

  • offline create, offline add and the MCP tools resolve SDK 0.32.0, so scaffolds install @offline-protocol/mesh-sdk 0.32.0. The registry covers service subscriptions, adds the C# binding (offline-protocol-csharp, a preview from the SDK repository) and the Bluetooth LE changes in 0.32.0, and hosted MCP serves the same registry.
  • offline orgs use <org> sets the default organization by ID or name, and the global --org <org> overrides it for one command. At login the CLI picks your only organization, or asks once when you have several. Switching organization clears the stored App ID and key.
  • setup and apply reuse the API key this machine created for an application instead of creating another; keys create --set-default records it too.
  • offline whoami names the stored credential, a developer session or an app key (--json adds credential).
  • offline login prints the approval URL instead of opening a browser over SSH or on Linux with no display.
  • offline init and new scaffolds start the local MCP server with @offline-protocol/cli@0.3.2.

Changes in 0.3.1

  • offline create, offline add and the MCP tools resolve @offline-protocol/id-react-native 0.4.0, @offline-protocol/id-react 0.3.0 and @offline-protocol/pol 0.1.2. In these releases sendCode resolves to true and throws OfflineIdError when the server refuses the request; id-react-native 0.4.0 also attests every code request and sign-in.
  • The React Native starters react-native-id-only and react-native-social include a native module for iOS App Attest and Android hardware key attestation, passed to OfflineAppProvider, and offline create adds the App Attest entitlement to the iOS target.
  • The identity skill covers attestation for Expo and bare React Native, development mode for simulators and emulators, which Android devices sign in with degraded trust and which are refused, and OfflineIdError handling. Searches for attestation, App Attest or development mode find it.
  • offline init and new scaffolds start the local MCP server with @offline-protocol/cli@0.3.1.

Changes in 0.3.0

  • Every developer portal setup step has a command: offline apps status, offline apps native (register iOS and Android apps, detect them from the project, development builds, development mode, production mark, Android policy, history, Expo setup), offline apps origins, offline apps features and offline apply, which converges the application to the app block of offline.config.json. offline login --email accepts --code.
  • Local MCP adds 16 tools that set up the application with the developer session; see setup tools. Hosted MCP adds app_status.

Changes in 0.2.9

  • offline create, offline add and the MCP tools resolve SDK 0.31.0, so scaffolds install @offline-protocol/mesh-sdk 0.31.0.
  • offline init and new scaffolds start the local MCP server with @offline-protocol/cli@0.2.9.

Changes in 0.2.8

  • offline create, offline add and the MCP tools resolve the SDK release that was current when 0.2.8 shipped, 0.30.0, so its scaffolds install @offline-protocol/mesh-sdk 0.30.0.
  • The registry adds the three bindings that 0.30.0 ships: offline-protocol-java on Maven Central, offline-protocol-c (the C API in the GitHub release archives) and the offline-protocol-flutter preview, from a checkout of the SDK. Flutter and Java prompts are answered with that package rather than a React Native plan.
  • The registry notes cover the 0.30.0 telemetry fix: apps that call enableTelemetry on 0.26.0 to 0.29.0 should update.
  • offline init and new scaffolds start the local MCP server with @offline-protocol/cli@0.2.8.

Changes in 0.2.7

  • offline create, offline add and the MCP tools resolve the SDK release that was current when 0.2.7 shipped, 0.29.0 (0.2.6 resolved 0.27.0). The registry covers 0.28 and 0.29: Python on PyPI with the HTTP front, the Rust crates, the Swift and Android previews, the local API and the leaf node. Later SDK releases, starting with 0.30.0, reach the CLI with its next release, and hosted MCP serves them once that release is deployed.
  • offline create --template offers three starter apps: orderup, stocksync and cowrite.
  • offline init and new scaffolds start the local MCP server with @offline-protocol/cli@0.2.7.

Changes in 0.2.6

  • The npm package metadata and README list support@offlineprotocol.com as the help contact.
  • offline init and new scaffolds start the local MCP server with @offline-protocol/cli@0.2.6.

Changes in 0.2.5

  • npm installs one platform binary, about 10 MB, instead of all five, about 50 MB. Keep optional dependencies enabled.
  • The developer session from offline login --email renews while you use the CLI, and offline logout signs it out.
  • On macOS and Linux, credentials are written atomically and owner-only. The local login callback limits request size and time.
  • Starter templates are licensed under MIT-0, and each generated README lists the license of every Offline Protocol package the project uses.
  • New scaffolds use @offline-protocol/id-react 0.2.0.
Run offline update to check for a newer release; it prints the upgrade command.

Login and logout

Login prints a confirmation code and opens https://dev.offlineprotocol.com/cli-auth. Choose the application, enter the code exactly as the terminal shows it and approve. Only approve a login you started yourself; after five wrong codes the login is cancelled. Each login creates a new app API key for that terminal. Organization keys are not accepted. The CLI receives the approval on a local callback at 127.0.0.1, on a free port chosen at login (set OFFLINE_CALLBACK_PORT to pin one), and also polls for it, so login completes even when the browser cannot reach the callback. Credentials are stored in ~/.offline/config.json; see what the CLI stores and sends. Use offline login --no-browser on a headless machine and complete approval from another browser. For CI, supply OFFLINE_API_KEY through your secret manager, or use offline login --api-key <app-api-key>. Keep keys out of source control and logs. offline login --email signs in with a one-time code in the terminal instead. It stores a developer session rather than an API key, and it is required for setup, orgs, apps and keys.
Logout clears local credentials and revokes the key that login created. Keys you created in the portal, including one supplied with --api-key, stay active; delete them in the portal when they are no longer needed. After offline login --email, logout also signs out the developer session. That session lasts 30 days, renews while you use the CLI, and ends 90 days after sign-in at the latest.

What the CLI stores and sends

On your computer. offline login and offline login --email write ~/.offline/config.json (or $OFFLINE_CONFIG_DIR/config.json): the app API key, the developer session token from email sign-in, your email address, and your developer, organization and application IDs. The file is plain JSON, not encrypted and not in the system keychain. On macOS and Linux it is created owner-only (0600) and replaced atomically, ~/.offline is kept owner-only (0700), and a symlinked file or a directory other users can write to is refused. On Windows the file keeps the default permissions of your user profile folder. Anyone who can read the file can use the key. offline logout deletes it. To Offline Protocol. Sign-in requests, including this computer’s hostname as the device name shown when you approve the sign-in, and the developer API calls each command makes with your key or session. Hosted MCP receives the tool arguments your agent sends; it keeps rate-limit counters, keyed by a hash of the credential or by network address, in memory for about 90 seconds. Elsewhere. offline update asks the public npm registry for the latest version, only when you run it. Scaffolding and the local MCP tools that write projects run npm install and similar package-manager commands against the registries you have configured. Your MCP client receives tool inputs and results under its own terms. The CLI and the local MCP server send no usage analytics and no crash reports. Local MCP tools can write files in your project and run package-manager commands with your permissions, subject to your agent client’s approval settings; they are not sandboxed. The privacy policy covers the same points for every Offline Protocol service.

Initialize a project

From an existing JavaScript or TypeScript application directory containing package.json:
For a new application, start with offline create; offline init requires an existing package manifest. This writes offline.config.json, an AGENTS.md section and, when the project has none, a .mcp.json that starts the local MCP server with npx -y @offline-protocol/cli@0.3.3 mcp serve. Review the generated changes with the rest of your application code. The configuration references the live JSON Schema. The App ID is public metadata; keep API keys outside these files. Use offline <command> --help for command options. There is no offline link command; project initialization uses --app-id, not --project-id.

Start from a workflow

offline plan "<what you are building>" recommends a workflow, the packages it needs and the exact offline create command. Three workflows cover common enterprise integrations. Each scaffolds a React Native app on the @offline-protocol/mesh-sdk release your CLI resolves and needs no login: Run offline registry list workflows for every workflow and offline registry list templates for the templates behind them.

Local MCP

The offline-protocol server uses stdio and requires no login or API key. The first launch downloads that release from npm; later launches use the npm cache. Let your MCP client launch it. It provides 34 tools: 18 for packages, capabilities, workflows, examples, skills, templates, planning and scaffolding, and 16 that set up your application with the developer session from offline login --email (see setup tools). Run offline mcp tools to inspect the list. scaffold_project, integrate_packages and init_project write local project files. These tools are available only in local mode. offline mcp install <client> prints configuration; it does not edit your client files. Supported names are claude-code, claude-desktop, codex, cursor and vscode. In 0.3.3 its output starts the server with offline mcp serve, which needs the global installation and the offline command on the PATH your client uses. The configurations below use the pinned npx command instead and need no installation.

Hosted MCP

Endpoint: https://mcp.offlineprotocol.com/mcp. Create an app API key in the application’s API keys tab and send both headers:
The App ID must match the key. Organization keys are rejected. Hosted mode offers the 15 read-only registry tools and app_status, which reads the key’s application setup, and cannot write files; use local MCP when your agent needs to scaffold or modify a project. Requests are limited to 60 per minute per key and 600 per minute per network address; a limited request receives 429 with Retry-After. Claude Desktop and Claude.ai cannot send these headers, so this endpoint does not work there. Use the public read-only endpoint as a custom connector, or local MCP in Claude Desktop to scaffold or edit projects. The MCP endpoint only accepts POST requests from MCP clients. Opening https://mcp.offlineprotocol.com in a browser shows a short page explaining how to connect an agent; GET /mcp answers 405. The health endpoint reports service status.

Public read-only endpoint

Endpoint: https://mcp.offlineprotocol.com/public/mcp. It needs no account, API key or headers and uses streamable HTTP. It offers 15 read-only tools for package, workflow, guide and template lookup, package resolution, architecture planning and scaffold preview: list_packages, get_package, search_packages, search_capabilities, search_workflows, search_examples, search_skills, list_workflows, get_workflow, list_skills, get_skill, resolve_packages, get_template, generate_architecture and preview_scaffold. When the setup tools are enabled on the server, three more read an application’s setup after you approve a sign-in: start_setup_login, finish_setup_login and app_status (see setup tools). Nothing is written to your project or account. Scaffolding, installing packages or editing files needs local MCP. Requests are limited to 120 per minute per network address; a limited request receives 429 with Retry-After. In Claude.ai or Claude Desktop, open the Offline Protocol connector in Claude’s directory and choose Connect. Or add it yourself: Settings, Connectors, Add custom connector, paste the URL. No sign-in is needed.

Setup tools

Local MCP sets up an application; hosted MCP reads its setup. Local account tools use the developer session from offline login --email. The hosted credential works only with the hosted MCP server and cannot change anything. The agent quickstart maps each tool to its CLI command.

Connect your agent

For per-client steps that run the pinned CLI through npx without a global installation, and for plugin availability, see Use Offline Protocol from your coding agent. Choose local or hosted mode for the same server name; do not configure both under offline-protocol in one client. Hosted examples use an app API key supplied through the client’s environment, a secure prompt, or its private user configuration.
Local:
Hosted, with OFFLINE_API_KEY set in your environment:
The command expands the key into the client configuration. Keep that configuration private. For a project .mcp.json that retains an environment reference, use:

Give the agent current instructions

Use the live agent setup prompt rather than a copied version. Then provide your application, platform and intended workflow using Build with an AI agent. The documentation page menu shares reading context; it is separate from the Offline Protocol MCP server.