Skip to Content
DocumentationConnect an AgentOverview

Connect an existing agent

If you already run OpenClaw, Hermes, Claude Code, or any other MCP-capable client, it can connect to your Companion Hub and Companion Memory directly β€” no Companion-built agent required.

Neither packaged agent app is a fork. The Companion OpenClaw app installs stock OpenClaw from npm, and the Companion Hermes app builds on the official Hermes Agent image β€” so the MCP surface they use is the same one your install can reach.

What the images add on top is a memory-slot provider plus some appliance plumbing. That provider is published separately for OpenClaw and Hermes, so your own install can have it too β€” see Beyond MCP: first-class memory.

The short version

Connecting takes four steps. Each links to the section with the details.

  1. Find both addresses. In the Hub dashboard, Settings β†’ MCP shows Hub’s endpoint with a copy button. On the Companion Memory app page, the Access points card lists its addresses. See Before you start.
  2. Mint a key on each server. Hub: Settings β†’ Security β†’ Create key, scope MCP. Memory: Settings β†’ API Keys, tick MCP and Intents. Choose Read-only unless the agent must change things. See Get your API keys.
  3. Register both servers in your client. Use the page for OpenClaw, Hermes, or Claude Code, Cursor, and others.
  4. Check the tool count. A working Hub key lists tools such as hub_list_installed_apps, and a working Memory key lists tools such as memory_recall. A server that connects but lists nothing is almost always a Memory key without the Intents scope. Then ask the agent a question that needs the server, such as β€œWhich apps are installed on my Hub?” or β€œWhat do you remember about my projects?”. A new Companion Memory with nothing imported has nothing to recall, so an empty answer is not a fault. To prove the write path, use a Read & write key and ask the agent to remember a fact, then ask for it back.

What connecting gives you

Companion Hub and Companion Memory each expose a Model Context Protocol server over Streamable HTTP. Registering them gives your agent tools it can call β€” appliance management from Hub, and recall and capture from Memory.

Two servers, two keys, and the same path on both:

MCP gives your agent tools. It does not give it a memory slot β€” passive turn capture and automatic context injection are a separate mechanism. With MCP alone, memory is something your agent calls, not something that happens in the background. OpenClaw and Hermes can have both: see Beyond MCP: first-class memory.

Before you start

You need three things.

1. A reachable address for each server. Both endpoints sit at the path /api/mcp. What comes before that path is not a fixed value for either server β€” it depends on how you reach your appliance, and for Companion Memory also on how it was installed.

Every example in this section writes those two origins as <hub-url> and <memory-url>. Work out yours before you start:

  • Companion Hub β€” on the LAN or over a VPN it is port 5002. By public URL or tunnel there is no port at all. Settings β†’ MCP in the Hub dashboard shows the endpoint with a copy button.
  • Companion Memory β€” a Hub install publishes it on host port 8642 when that port is free, and on a port in the 10000–60000 range otherwise. The Access points card on the Companion Memory app page shows the real address for each route. The desktop app, which has no public download yet, always serves http://127.0.0.1:8642 on its own computer.

Each server’s page above also covers its tools, scopes, and quirks.

If you have seen HUB_MCP_URL injected into an app’s environment, that value is the complete internal Docker address, path included β€” http://ci-hub:5002/api/mcp (http://ci-os-hub:5002/api/mcp on an appliance that was installed before the container was renamed). It resolves only inside the appliance’s container network. From your own machine, use the LAN address of the appliance or a tunnel origin.

2. Two API keys. They come from different places and are not interchangeable. See Get your API keys.

3. Hub’s MCP server running. It is on by default β€” it loads unless someone has explicitly set MCP_ENABLED=false. Settings β†’ MCP in the Hub dashboard shows Enabled or Disabled, and cihub mcp config on the appliance host prints the same setting.

Settings, MCP tab: a Server status card reading Enabled with server ci-hub 1.0.0, protocol versions 2026-07-28 and 2025-11-25, 76 tools, 0 connected sessions, and the endpoint http://localhost:5002/api/mcp; an Installed MCP servers card reading No MCP server apps installed yet; an API keys card showing 2 active keys and a Manage API keys button; and the top of a Tool catalog cardSettings, MCP tab: a Server status card reading Enabled with server ci-hub 1.0.0, protocol versions 2026-07-28 and 2025-11-25, 76 tools, 0 connected sessions, and the endpoint http://localhost:5002/api/mcp; an Installed MCP servers card reading No MCP server apps installed yet; an API keys card showing 2 active keys and a Manage API keys button; and the top of a Tool catalog card
Settings β†’ MCP in the Hub dashboard: the server status, the endpoint, the tool count, and the number of active API keys.

On Windows, install where the agent actually runs. Both OpenClaw and Hermes can run natively or inside WSL2, and the two have separate homes: a ~ typed in PowerShell is C:\Users\<you>, while a ~ inside the distro is the Linux home, and neither agent treats a missing directory as an error β€” it loads nothing. Native Hermes is the one to watch, because its home is %LOCALAPPDATA%\hermes rather than ~/.hermes. Each page below gives the Windows form of its commands alongside the bash one.

Pick your client

What each client gets, as the pages in this section describe it:

CapabilityOpenClawHermesClaude CodeOther MCP clients
Hub and Memory tools over MCPβœ“βœ“βœ“βœ“
Transport declared astransport: streamable-httpomit the fieldtype: httpStreamable HTTP, in the client's own spelling
Registers a server withopenclaw mcp addhermes mcp addclaude mcp addThe client's config file
Checks the connection withopenclaw mcp probehermes mcp testclaude mcp listA curl handshake
First-class memory (passive capture)openclaw-memoryhermes-memory––
cihub connect on the Hub hostβœ“βœ“
Used from a phoneOfficial iOS and Android appsWeb dashboard in the browser
Phone access refers to the Hub-hosted app, not your own install β€” see Agents on your phone.

Reaching an agent from a phone is a different job. Those pages point an agent at your MCP servers. If the agent already runs on your Hub and you want to use it from iOS or Android, that is pairing a mobile client to the agent β€” see Agents on your phone.

Or let your agent do it

If the client you are connecting is itself a capable agent, it can read the setup and wire itself up. The ci-connect skill is this whole section written for a model rather than a person β€” every endpoint, both first-class-memory routes, and the traps below.

https://docs.ci.computer/connect/SKILL.md

Two ways to use it, and the difference matters:

HowWhen
OncePaste that URL and ask the agent to connect itselfA one-off setup, or a client you are trying out
InstalledSave it to a skills directory the agent scansYou want it available whenever the task comes up again β€” including on a machine you set up later

Installing takes one file and one config line, and a single directory serves both OpenClaw and Hermes: see installing the skillΒ .

Installing a skill does not run anything. Both agents load skills as guidance consulted when a task matches, so this is about the instructions being available later, not about a setup step happening now.

It cannot mint your API keys β€” nothing can, that path needs a browser or the appliance host β€” so have both ready before you start, exactly as above.

Know before you wire it up

Three things account for nearly every failed setup. Each has a full explanation on the Troubleshooting page, but they are worth knowing in advance.

This is the handshake every client performs, sessionful as most agents do it today, with the answers each mistake produces:

The path is /api/mcp, not /mcp

The two servers report this mistake differently: Companion Memory answers 405 Method Not Allowed and Companion Hub answers 404 Not Found. Neither reads like β€œwrong path”, which is why this is worth knowing before you start. See 405 or 404.

Both servers take Authorization: Bearer

Hub accepts only that header. Memory accepts either Authorization: Bearer or x-api-key. Use Authorization: Bearer for both and you have one pattern to remember instead of two.

Every client names the transport differently

All three speak the same protocol. They disagree only on how you declare it, and one of them fails silently when you get it wrong.

ClientFieldValue
OpenClawtransportstreamable-http
Hermesomit the field entirelyβ€”
Claude Codetypehttp

Security

The key you paste into a third-party client can do everything that key is permitted to do, and it lives in that client’s config file until you revoke it.

  • Mint a key per client, so you can revoke one without disturbing the others.
  • Choose the lowest capability that works. A key for memory recall does not need permission to uninstall your apps. See Choosing a capability.
  • Prefer an environment-variable reference over pasting the key into a config file, wherever your client supports it.
  • Browser-based MCP clients cannot connect to Companion Memory. The blocker is headers rather than origins: its CORS config allows only Content-Type, Authorization, X-CSRF-Token and X-API-Key, and exposes only X-Thread-Id β€” so from any origin a browser can neither send nor read the Mcp-Session-Id that Streamable HTTP needs after initialize. The origin allowlist is narrow on top of that: the native webview origins plus bare http(s)://localhost, so a browser page on an origin carrying a port is refused (an operator can extend it with CORS_ALLOWED_ORIGINS, which widens origins only β€” not headers). Hub allows only its own port on localhost, the domains you configured, and origins an operator lists in CI_HUB_EXTRA_CORS_ORIGINS, and it refuses other localhost ports. Treat both as server-side and CLI endpoints.

If you lift a config file out of the packaged OpenClaw app, drop its gateway.controlUi block first. The packaged app sets gateway.controlUi.allowedOrigins so its own authenticated proxy can reach the Control UI, and that list has no meaning in a standalone install.

Beyond MCP: first-class memory

MCP alone gives your agent memory it can query, not memory that accumulates on its own. An agent connected only over MCP has to call a memory tool during a conversation for anything to be stored β€” telling it so in your system prompt is usually enough.

Passive capture, and bootstrap context injected at the start of a session, come from a memory provider registered in the agent’s native memory slot. That is a different mechanism from MCP, and for OpenClaw and Hermes it is published separately:

With a memory provider in the slot, memory accumulates in the background and the agent reads from it β€” nothing has to call a tool.
AgentProviderSet up
OpenClaw@companionintelligence/openclaw-memoryFirst-class memory
Hermes@companionintelligence/hermes-memoryFirst-class memory

Each page documents two routes: the official commands for that ecosystem, and a cihub connect command if you are working on the Hub host (for Hermes it finishes by handing off to the official wizard). The two are independent of the MCP setup above β€” you can do either, both, or neither.

One thing to know before minting the key: the provider talks REST, not MCP, so its key needs the Memory scope at capability Read & write β€” a key minted for the MCP sections alone cannot store anything, and the failure is silent. Each page spells this out; so does Get your API keys.

Other MCP clients have no equivalent mechanism to plug into, so for Claude Code, Cursor, and others memory stays something the agent calls.

Last updated on