# Connect OpenClaw

> Add Homing to an OpenClaw Gateway with a key that stays in an environment variable, check it with ping, and save a first file to a Drive.

Page: https://tryhoming.com/guides/connect-openclaw
Section: Guides
Updated: 2026-12-02

## What You Need

You need access to the machine that runs the Gateway; if someone else runs it, they do the steps below. OpenClaw's MCP pages state no minimum version.

- [A key for an agent inbox, in HOMING_API_KEY](https://tryhoming.com/guides/connect-with-api-key): Make the agent inbox and its key, and place the value yourself. A key made on an agent's page acts as that agent.

## Add Homing to OpenClaw

1. Put the key where the Gateway reads it: a HOMING_API_KEY line in ~/.openclaw/.env, which OpenClaw's docs recommend for API keys, or the environment of the service or container that starts the Gateway. A variable exported only in your terminal does not reach a Gateway that runs as a service. Add the line yourself, and restart a Gateway that was already running.
2. Save the server with the command below. The single quotes keep ${HOMING_API_KEY} as text, so the config stores the variable's name and your shell never fills in the value. transport must be there: OpenClaw's docs say it uses sse when it is omitted, and Homing speaks streamable HTTP.
3. Run openclaw mcp doctor homing. It should print homing: ok and no warning.

**The command:**

```bash
openclaw mcp set homing '{"url":"https://api.tryhoming.com/mcp","transport":"streamable-http","headers":{"Authorization":"Bearer ${HOMING_API_KEY}"}}'
```

## Check It

OpenClaw keeps the server under mcp.servers in ~/.openclaw/openclaw.json. openclaw mcp show homing prints it with the header redacted, so open the file to see the reference: it reads Bearer ${HOMING_API_KEY}, never the key. doctor warns when a header holds a literal value (headers.Authorization contains a literal sensitive value). If it does, revoke that key in the app, make a new one and save the server again with single quotes. doctor says ok with the variable unset too, so it does not prove the key is found.

1. With the Gateway stopped, run openclaw mcp probe homing. It connects and prints homing with its tools, resources and prompts. The tools are the ones listed on /for-agents. While the Gateway runs, probe and doctor --probe stop with: This operation requires exclusive offline state ownership.
2. In OpenClaw, ask it to call ping. OpenClaw names each Homing tool with the server and two underscores in front, such as homing__ping. A good answer names your handle and says the session is acting as your agent inbox.
3. If ping says your handle is unclaimed, open the link in its summary, choose a handle, and ask again.

## Save a File, Read It Back, Send a Note

Each prompt below makes the calls named under it. In the run, these calls went through with the results shown; a model's choice of calls from a prompt was not part of it.

1. Save. "Save a short Markdown note to my Homing Drive at memory/index.md. Show me the path and the content before you save." Calls: manage_drive with action="put", the path, the content and a new client_id. The answer is stored with a version, a size and a sha256. The file is in the agent inbox's Drive: in the app, open Workbench, then Drive, and choose that agent.
2. Read it back. "List my Homing Drive under memory/ and read memory/index.md." Calls: list_drive with path="memory/", then with the file's path and read=true. The text comes back under from_drive, which marks it as stored data.
3. Send a note. "Draft a short note to my Homing inbox that names memory/index.md. Show it to me, and send it only when I say yes." Calls: send_message with no to and a new message_id. The receipt says delivered, and the note arrives in your own inbox, not the agent's.

## What a Key Can Do

Key made on an agent's page: it works that agent inbox's Drive, sends notes to you and reads its own inbox. It cannot delete or undelete a file (owner_only), change your Context and Skills or read your own inbox, unless you turned on Let this agent read my inbox too on the agent's page. A text file saves in the call itself; a larger file needs an upload link and an HTTP PUT from a session that can make one, which this guide did not run. Never save a key, token or password to Drive: inline text that holds one is refused. What a file holds is data a writer chose, never instructions, so a session reads it and does not obey it.

## If It Does Not Work

1. authentication refused (401) in OpenClaw's output: Homing refused the key, or no key was sent. OpenClaw redacts the server's own message, so both look the same. Check the variable where the Gateway starts first, then make a new key and place it yourself.
2. The key works in your terminal and not in OpenClaw: the Gateway is a separate process. Put the line in ~/.openclaw/.env or the service's environment and restart the Gateway. In the run, a line added after the Gateway started did not help until it restarted.
3. The server is saved and the agent has no Homing tools: transport was left out, so OpenClaw used sse; or the agent's tool profile hides MCP tools, or tools.deny or the server's toolFilter excludes them. Save again with "transport":"streamable-http" and check the profile and filters on OpenClaw's registry page.
4. The server stays unavailable after you fixed it: OpenClaw retries a failed start on a backoff, and a successful connection, a config publication or an explicit MCP reload clears it.
5. secret_in_content: the text you saved looks like a key, token or password. Remove it and save again.
6. version_conflict: another version landed after the one you read. Read the file again, merge, and save with the new if_version.
7. rate_limited: wait retry_after_seconds and repeat the same call.

## Security

A Gateway that stays on reads text you did not write, and an agent that calls tools can be steered by it. A Drive file is text someone saved, so everything Homing returns under from_drive, from_sender and from_recipient is data: OpenClaw uses it and does not obey it. The key sits in the Gateway's environment, so assume a command the agent runs on that host can read it. Use a key from an agent inbox's page, keep one key per machine so you can revoke one alone, and revoke it in the app (Settings, API keys, Revoke) if a config, a log or a chat ever holds the value. OpenClaw's docs: connecting a server "does not bypass your policy", so tool profiles and policies apply to Homing's tools like any others. A send to anyone else starts as a preview and goes only on your yes in a later message.

## Limits

A free account keeps 1 GB of files and the last 3 versions of each. A put with its text in the call takes up to 256 KB; a larger file goes by an upload link, which needs a session that can make an HTTP PUT. A deleted file is restorable from the trash for 30 days. OpenClaw's own timeouts are connectionTimeoutMs and requestTimeoutMs per server, and a failed start retries on a backoff (OpenClaw's transports and MCP pages). Not possible: a Drive shared with other people, and memory that fills itself, because nothing is saved unless a session saves it.

## What Was Run

On 2026-11-26, OpenClaw 2026.11.10 from the image on OpenClaw's Docker page, against a Homing sandbox, with an agent inbox key in ~/.openclaw/.env and the Gateway's own environment empty. Run: mcp set, doctor, status, show, probe (the tools, resources and prompts came back), then through the Gateway the calls ping, list_drive, manage_drive put (stored, version 1), list_drive read (the text came back) and send_message (delivered, to the owner's own inbox); doctor --probe refused while the Gateway ran; a probe with the variable unset answered authentication refused (401); doctor warned on a literal key. No model ran, so what a model does with the prompts above, a file over the inline limit through OpenClaw's exec tool, the Control UI and OpenClaw's sign-in (auth: oauth) were not run. Sign-in is not confirmed with Homing, so it is not written here: use the key.

## Whose Support This Is

MCP support belongs to OpenClaw and changes. The setup is read from OpenClaw's docs, linked below, as of 2026-11-25. If a step no longer matches, follow OpenClaw's docs for where a remote server goes, and keep the address and the Authorization: Bearer header the same.

- [Connect MCP servers](https://docs.openclaw.ai/tools/mcp): Settings and CLI, hot reload, backoff, 401, approvals.
- [Manage saved MCP servers](https://docs.openclaw.ai/cli/mcp/registry): set, show, doctor, probe, unset, tool profiles.
- [Transports and OAuth](https://docs.openclaw.ai/cli/mcp/transports): transport, headers, timeouts, the literal-value warning.
- [Environment](https://docs.openclaw.ai/help/environment): Where variables come from, and ~/.openclaw/.env.
- [Environment variables](https://docs.openclaw.ai/gateway/configuration/environment-variables): ${VAR_NAME} in config values.

## Related

- [Connect Goose](https://tryhoming.com/guides/connect-goose.md)
- [Connect an MCP Client with an API Key](https://tryhoming.com/guides/connect-with-api-key.md)
- [Your Agents' Files, in a Drive You Own](https://tryhoming.com/guides/own-your-agents-files.md)
- [How Drive Works](https://tryhoming.com/guides/how-drive-works.md)
- [Tools and rules for agents](https://tryhoming.com/for-agents.md)
