Connect Clam to OpenClaw
OpenClaw connects to Clam from the terminal: stop its Gateway, add your Shell, sign in through the link OpenClaw prints, and start the Gateway again. From then on, OpenClaw's email requests follow your Shell's rules.
Before you start
You need a Clam account with a Shell; the Quickstart sets up both. Everything here starts on your Shell's Install tab in the Clam console, under OpenClaw. Copy the commands from there rather than retyping them.
OpenClaw talks to Clam over MCP, the standard way an AI agent plugs into an outside tool: each Shell is an MCP server, and its email tools go through your rules before they reach Gmail.
OpenClaw only saves a server while its Gateway is stopped, so every method here starts with openclaw gateway stop and ends with openclaw gateway start.
Connect OpenClaw
Three ways in. Start with the first; the others are for when it doesn't fit.
The simplest path: OpenClaw prints a sign-in link, so there is no key to handle.
-
Stop the Gateway
OpenClaw won't save a server while it runs.
Terminalopenclaw gateway stop -
Paste this in your terminal
Copy the add command from the Install tab. Then press Enter. OpenClaw checks the connection and saves it.
Terminalopenclaw mcp add <server name> --url <your Shell's address> --transport streamable-http --auth oauth -
Log in, then sign in to Clam and Allow
OpenClaw prints a sign-in link. Open it, and Clam asks to connect your Shell to OpenClaw. Click Allow.
Terminalopenclaw mcp login <server name> -
Start the Gateway again
Your server shows up in the list.
Terminalopenclaw gateway start openclaw mcp list
Try a prompt below, then click Check connection on the Install tab.
For a machine with no browser, like a server you reach over SSH. The key works only for OpenClaw.
-
Stop the Gateway
OpenClaw won't save a server while it runs.
Terminalopenclaw gateway stop -
Paste this in your terminal
Copy the command under Use a key on the Install tab. Copying creates the key and fills it in. Then press Enter. OpenClaw checks the connection and saves it.
openclaw mcp doctormay point out the key sitting in your config. That is expected for a key.Terminalopenclaw mcp add <server name> --url <your Shell's address> --transport streamable-http --header "Authorization: Bearer <your key>" -
Start the Gateway again
Your server shows up in the list.
Terminalopenclaw gateway start openclaw mcp list
Try a prompt below, then click Check connection on the Install tab.
For anyone who keeps the file by hand. OpenClaw reads its servers from mcp.servers. The key works only for OpenClaw.
-
Stop the Gateway
It loads the new server on start.
Terminalopenclaw gateway stop -
Merge this block into mcp.servers
In
~/.openclaw/openclaw.json. Comments and trailing commas are fine there. Createmcpandserversif they aren't there yet. Keeptransportset tostreamable-http, or OpenClaw falls back to SSE, which Clam doesn't support.JSON{ "mcp": { "servers": { "<server name>": { "url": "<your Shell's address>", "transport": "streamable-http", "headers": { "Authorization": "Bearer <your key>" } } } } } -
Start the Gateway again
Your server shows up in the list.
Terminalopenclaw gateway start openclaw mcp list
Try a prompt below, then click Check connection on the Install tab.
Try it
With the starter policy from the Quickstart, ask OpenClaw:
If OpenClaw has other mail tools, start with "Use <your Shell's name>". Change what's allowed in How rules work.
Remove access
In OpenClaw, stop the Gateway and run openclaw mcp unset <server name>.
The removal that counts is Clam's: on the Shell's Install tab, under Connected agents, choose Remove access next to OpenClaw. A key stops working at once; a sign-in stops at OpenClaw's next request. Remove access
If it doesn't work
More in Common issues & solutions.
OpenClaw refuses to save the server
The Gateway is still running. Stop it, add Clam again, then start it.
The add never completes
The --transport streamable-http flag is missing. Use the Install tab's command.
Connected? Write your own rules.