You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: classify OpenClaw gateway calls as gateway calls by URL (#8569)
### DNO-1502: OpenClaw gateway calls land as Local Tools
With #8585, OpenClaw gateway calls show as Shadow MCP calls to a server
named "speakeasy", a name any third-party server can share, and a call
that fails early stays a local tool. Calls now match a gateway by URL
and show as Gateway calls.
[DNO-1502](https://linear.app/speakeasy/issue/DNO-1502)
https://github.com/user-attachments/assets/11c1e2de-d04c-47a0-b4bb-64d1ac303410
**How a call maps to its gateway**
1. **Plugin:** each tool frame carries `mcpServers: [{name, url}]` from
the live `mcp.servers` config. URLs lose userinfo, query and fragment;
headers, env and command are never read.
2. **Relay:** finds the call's server name (`details.mcpServer` on the
result, or the `<name>__` tool prefix before the call), looks up its
URL, sends both as `data.mcp`. The stored raw payload drops the list.
3. **Storage:** ingest writes the URL to `gram.mcp.server_url` on the
ClickHouse `telemetry_logs` row.
4. **Query:** Postgres supplies matchers per request: `/agent-mcp/<agent
id>`, `/mcp/gateway/<org slug>`, `.../projects/<project slug>`. A URL
ending in one is a Gateway call.
**Notes**
- Pre-calls now name their MCP server, so shadow MCP block policies
apply to them.
- Needs the plugin (generator version 59) and the next `speakeasy-hooks`
pin. Until an OpenClaw updates, it keeps #8585's view. Stacked on #8585.
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Fixes OpenClaw MCP call classification so calls to a Speakeasy gateway
show as Gateway calls instead of Shadow MCP or Local Tools. OpenClaw
names MCP tools `<server>__<tool>`, so a gateway configured as
"speakeasy" was indistinguishable from any third-party server of that
name.
- The OpenClaw shim now sends each configured MCP server's name and
redacted URL on tool frames, never its headers, env, or command, and the
relay resolves the call's server from the `details.mcpServer` result
marker or the sanitized tool-name prefix; the raw echo drops the server
list only for OpenClaw frames.
- Tool-usage classification matches agent gateways
(`/agent-mcp/<agent>`), the organization gateway, and project gateways
by URL and names them after the agent, organization, or project; a
same-named server at another URL stays a shadow MCP server. A deleted
project's URL keeps naming its gateway until a live project reuses the
slug, and a slug two deleted projects shared names none. The matchers,
labels, and filter options share one per-request read of the
organization's gateway owners, and a gateway the caller cannot read
shows as "Gateway in another project".
- The raw tool-usage path carries tool source, match, and server URL
across a call's rows so an unattributed pre-call row, even for a call
blocked before it ran, no longer splits the call, while the summary path
keeps tracking the populated source with `max`.
- The relay half takes effect with the next `speakeasy-hooks` release
pin.
<sup>Written for commit 8fd0eba3f2319f7e85e8c85a57f9dffda6eae168.
Summary will update on new commits.</sup>
<a
href="https://cubic.dev/pr/speakeasy-api/gram/pull/8569?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/speakeasy-api/gram/8569?returnTo=https%3A%2F%2Fgithub.com%2Fspeakeasy-api%2Fgram%2Fpull%2F8569&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>