Claude Code
Use rstream as a connectivity layer for Claude Code.
Claude Code reaches local services, remote machines, device-local MCP servers, and private tunnels through the same rstream MCP tools that Codex uses. Both clients speak the Model Context Protocol, so the operator workflow, the access boundaries, and the safety rules are identical. Only the registration step differs, because Claude Code stores MCP servers in its own configuration and scopes.
This page covers what is specific to Claude Code. For the full workflow, including WebTTY, remote-local exposure, remote MCP bridging, tokens, and the SDK boundary, read Codex and treat every step there as applying to Claude Code without change. The broader discovery and authentication model lives in Agent Native.
Configure Claude Code
Start with a current CLI. Use rstream CLI 1.22.0 or later for the Claude Code setup command, local tunnel lifecycle tools, WebTTY filesystem access, remote exposure, and remote MCP calls.
rstream --version
rstream doctor -o jsonOn a configured workstation, register the local MCP server with Claude Code:
rstream claude setupThat runs claude mcp add so the registration lands in Claude Code's own configuration rather than being hand-edited. The registered server runs:
rstream mcp serveBy default the server is added at user scope, which makes rstream available in every project on the workstation. This matches the operator surface that Codex gets from ~/.codex/config.toml. When RSTREAM_CONFIG is set during setup, the generated entry preserves that config path, which is useful for isolated workspaces, CI-style test homes, or operators who keep multiple rstream configs.
To review the configuration before writing anything, or to copy it onto a machine that does not have the rstream CLI driving setup, use --print:
rstream claude setup --printThat prints both the project-scoped .mcp.json entry and the equivalent claude mcp add command, and writes nothing.
Scopes
Claude Code stores MCP servers at one of three scopes, and rstream maps to each through the --scope flag.
| Scope | Where it lives | Use it for |
|---|---|---|
user (default) | Claude Code user configuration | An operator surface available in every project on the workstation |
project | .mcp.json at the repository root | A shared, source-controlled entry that every collaborator on the repo gets |
local | Claude Code per-project user configuration | A private entry scoped to one project on this machine only |
For a checked-in project entry, the .mcp.json file is small and self-describing:
{
"mcpServers": {
"rstream": {
"type": "stdio",
"command": "rstream",
"args": ["mcp", "serve"]
}
}
}rstream claude setup --scope project produces the same entry through Claude Code, and rstream claude setup --print shows it so it can be added by hand. After setup, the /mcp command inside a Claude Code session lists the rstream server and its tools.
Local and Remote MCP Surfaces
rstream exposes the same three MCP surfaces to Claude Code, and Claude Code can attach to all of them because it speaks both local stdio and remote HTTP MCP transports.
| Surface | How Claude Code attaches | Boundary |
|---|---|---|
Local rstream mcp serve | rstream claude setup, or claude mcp add rstream -- rstream mcp serve | Runs on the operator machine and uses the local rstream config and private dialer |
Published rstream mcp publish | claude mcp add --transport http rstream-published <url> --header "Authorization: Bearer <token>" | The same local tools reached over an HTTP tunnel, token-protected at the rstream edge |
Hosted /api/mcp | claude mcp add --transport http rstream-hosted https://rstream.io/api/mcp --header "Authorization: Bearer <token>" | Control-plane discovery, identity, projects, logs, usage, and short-lived token minting; no shell |
Local MCP is the right default for workstation workflows because it operates through the user's private rstream dialer and cleanup registry. Published MCP is the path when a remote Claude Code runtime cannot spawn a local process and needs to reach the workstation tools over a tunnel. Hosted MCP is useful for control-plane automation when the caller already holds a bearer token.
For the published and hosted surfaces, attach the token with --header. When the endpoint advertises MCP authorization metadata, the /mcp command can complete the browser approval flow in-session instead of pasting a token. rstream already publishes the OAuth protected-resource and authorization-server metadata that this flow discovers, described in Agent Native.
Project Memory and Skills
Claude Code loads a CLAUDE.md file as project memory. A short pointer there keeps rstream context available without copying every rule into a prompt, the same layered model that Agent Native describes for Agent Skills.
# rstream
This project uses rstream for connectivity. The rstream MCP server exposes the
operator tools; prefer them over shell subprocesses for tunnels, WebTTY, and
remote exposure. Load the rstream docs for setup, tunnels, WebTTY, and
troubleshooting before acting, and stop for approval before paid actions,
public exposure, file writes, or credential creation.The rstream Agent Skills served from /.well-known/agent-skills are client-agnostic, so Claude Code can route to the same setup, API, CLI, tunnel, WebTTY, and troubleshooting instructions that Codex uses.
Shared Workflow
Everything past registration is identical to the Codex workflow, because the tools come from the same rstream mcp serve process. Use the Codex page for the details on local tunnel lifecycle tools, WebTTY command and filesystem access, remote-local service exposure, remote MCP discovery and calls, project preparation, plan-gated features, self-hosted Engine CE boundaries, the application SDK split, and the safety rules. Substitute role=claude for role=codex on the labels you use to select machines and tunnels by intent.
For a complete walkthrough, see Use rstream as a Connectivity Layer for Codex, which includes a Claude Code setup section. For remote terminal details, see WebTTY.