skip to content

In OpenClaw's mcp.servers, how do you configure a hosted HTTP MCP server, and which transport does it get if you omit one?

level: middleimportance: should knowfreq 6%

answer

  1. url instead of command
  2. two HTTP transports
  3. the default is the older one
  4. streamable-http spelled out
  5. OAuth ignores the static header

basics

~20 s

Give the mcp.servers entry a url and set transport to streamable-http, because an entry with no transport uses sse. Authenticate with auth set to oauth plus openclaw mcp login, or with headers fed from an environment variable, then probe it.

solid answer

~40 s

A remote server's `mcp.servers` entry carries a `url` instead of a `command`, and `transport` picks `streamable-http` or `sse`; when it is omitted OpenClaw uses `sse`, so a Streamable HTTP endpoint needs `transport: "streamable-http"` spelled out. `type: "http"` is only a CLI-native alias that `openclaw mcp set` and `openclaw doctor --fix` normalise into that field. For auth, set `auth: "oauth"` and run `openclaw mcp login <name>`; while OAuth is on, a static `Authorization` header is ignored and doctor warns about it. Otherwise use `headers` backed by `${VAR}` substitution, never a literal token. `requestTimeoutMs` defaults to 60 seconds, `toolFilter` narrows the tools, and `openclaw mcp doctor <name> --probe` proves it answers.

go deeper

for a junior

Recall that a hosted server is an mcp.servers entry with a url, and that streamable-http has to be named because the default transport is sse.

for a middle

Explain the transport field, the type alias, OAuth login versus environment-backed headers, the 60-second request timeout and why add skips its probe for OAuth servers.

for a senior

Diagnose a hosted server that saves but never shows tools: wrong transport default, owed OAuth login, an ignored static header, or TLS settings, using status, login and doctor --probe in order.

for a principal

Decide a team rule for remote servers: OAuth over static tokens, no literal secrets, a tool filter on every entry and a probe in change review, and what each costs to maintain.

## What makes an entry an HTTP server OpenClaw keeps its MCP servers under **`mcp.servers`**, one named entry each. A **remote** server, such as a hosted issue tracker, is reached over HTTP rather than spawned locally, so its entry carries a **`url`** (http or https) instead of a `command`. If an entry has both, OpenClaw treats it as a stdio server and the `url` is not used. ```json { "mcp": { "servers": { "tracker": { "url": "https://mcp.example.com/mcp", "transport": "streamable-http", "auth": "oauth", "oauth": { "scope": "issues.read" }, "connectionTimeoutMs": 5000, "requestTimeoutMs": 20000, "toolFilter": { "include": ["search_issues", "get_issue"] } } } } } ``` ## The transport field and its default | Value | What it is | When you get it | |---|---|---| | `sse` | HTTP with Server-Sent Events, the older remote transport | When `transport` is omitted on a `url` entry | | `streamable-http` | HTTP streaming for bidirectional traffic | Only when you set it | | `stdio` | A local child process | Implied by `command` | The trap is the default: a URL that serves only Streamable HTTP, saved without `transport`, is spoken to as SSE. On the CLI the same choice is `--transport streamable-http`. Configs copied from other MCP clients often say `type: "http"`; that is a CLI-native alias, accepted by `openclaw mcp set` and repaired by `openclaw doctor --fix`, but `transport` is what embedded OpenClaw reads. ## Authentication - **OAuth.** Set `auth: "oauth"` (optionally `oauth.scope`) and run `openclaw mcp login <name>`. OpenClaw listens on a loopback callback, or prints a `--code` fallback for a browser on another machine. Shared credentials land in OpenClaw's owner-only state database. - **Static header ignored under OAuth.** While `auth: "oauth"` is on, a static `Authorization` header is not sent, and doctor warns about it. - **Headers.** For a server that takes a fixed token, use `headers` with `${VAR}` substitution so the secret stays in the environment. Doctor warns when an `Authorization` header or a key ending in `token`, `secret`, `password` or `api_key` holds a literal value. - **Until login happens,** OpenClaw omits only that server from the agent's runtime instead of failing the turn. ## Timeouts, TLS and tool selection - `requestTimeoutMs` defaults to 60 seconds; when it is unset, tool listing at session start uses 10 seconds. - `connectionTimeoutMs` bounds the connection. The CLI's `--timeout` and `--connect-timeout` take **seconds** and write milliseconds. - `sslVerify: false` is for explicitly trusted private endpoints only; `clientCert` and `clientKey` set up mutual TLS. - `toolFilter.include` and `toolFilter.exclude` take exact tool names or simple `*` globs. - `supportsParallelToolCalls: true` is a hint that concurrent calls are safe. ## Checking it 1. `openclaw mcp status --verbose` shows the resolved transport, auth and filters without connecting, and reports `authorization-required` when login is still owed. 2. `openclaw mcp login tracker` completes OAuth. 3. `openclaw mcp doctor tracker --probe` runs static checks, then connects and lists tools. If a legacy SSE endpoint returns 404 or a stateful Streamable HTTP session expires, OpenClaw retires the connection and reconnects on the next discovery. It reports the failed call rather than replaying it, because the tool may already have changed state. ## After it is saved - **Config changes are surgical.** With Gateway hot reload, a changed or removed server's connection retires and the next turn's discovery uses the new definition; unchanged servers keep their connections and cached tools, even for runs in progress. - **Catalogues refresh.** A tool-list change notification from the server drops its cached catalogue, and the next discovery fetches it again. - **Failures are contained.** Repeated tool-call failures pause that server briefly, so one broken remote server does not consume the whole turn. - **Runtimes live with the session.** Session-scoped MCP runtimes stay alive between turns until reset, deletion, compaction rollover, an explicit Stop or Gateway shutdown; `mcp.sessionIdleTtlMs` opts into idle eviction. - **There is a ceiling.** A Gateway admits at most 256 OpenClaw-managed MCP runtimes with server connections; at the limit new admissions fail until unused sessions are stopped or reset.

  • You saved a hosted server with --auth oauth and agents see none of its tools. Is it broken?
    Not necessarily. `openclaw mcp add` skips its probe for OAuth servers and prints the login command. Until shared credentials exist, OpenClaw leaves that one server out of the agent runtime rather than failing the turn. Run `openclaw mcp login <name>`, then `openclaw mcp status --verbose` should stop reporting `authorization-required`, and `doctor --probe` should list tools.
  • A Streamable HTTP session expires halfway through a tool call. Does OpenClaw retry the call?
    No. It retires the dead connection and reconnects on the next discovery, but reports the failed call without replaying it, because a tool such as one that files an issue may already have changed state before the connection dropped. The agent or the operator decides whether to try again.

  • A url entry without transport uses Streamable HTTP by default.
  • A static Authorization header is still sent when auth is oauth.
  • type http is the field embedded OpenClaw reads.
  • Set sslVerify to false to fix any certificate error on a public endpoint.
  • Give an entry both command and url so OpenClaw can fall back between them.