Skip to content

MCP Tool Reference

MCP Tool Reference

RemoteClaw exposes 50 MCP tools across 8 handler groups. These tools allow CLI agents (Claude, Gemini, Codex, OpenCode) to interact with RemoteClaw infrastructure: session management, cross-channel messaging, cron scheduling, gateway administration, paired-node execution, canvas collaboration, browser proxy, and text-to-speech.

RemoteClaw only provides tools that require RemoteClaw infrastructure. Generic capabilities (web search, file I/O, shell exec) are left to each CLI agent’s own MCP ecosystem.


Permission Model

Tools are divided into two permission tiers based on the senderIsOwner flag (set via REMOTECLAW_SENDER_IS_OWNER=true):

TierGroupsTool CountAccess
BaselineSession, Message17All agents
Owner-onlyCron, Gateway, Nodes, Canvas, Browser, TTS33Owner only

Owner-only tools are not registered at all for non-owner sessions, so they do not appear in the agent’s tool list.

Plugin tools are always registered (availability depends on gateway plugin configuration).


Lifecycle

The MCP server runs as a per-invocation stdio process (src/middleware/mcp-server.ts). Each agent run spawns a fresh instance, which:

  1. Reads context from environment variables set by ChannelBridge
  2. Registers tools via registerAllTools (src/middleware/mcp-tools.ts)
  3. Wraps every tool with before/after hook firing (fire-and-forget gateway RPC)
  4. Connects via StdioServerTransport

Hook wrapper: Every tool invocation fires hooks.tool.before (with { toolName, params }) and hooks.tool.after (with { toolName, params, durationMs, error? }) via gateway RPC. Both are fire-and-forget. On unhandled errors, the wrapper returns { isError: true, content: [{ type: "text", text: "Tool error (name): ..." }] }.

Gateway transport: All tools call the gateway using least-privilege operator scopes, 30-second timeout, and mode: BACKEND.

Side effects: Tools that send messages or create cron jobs write NDJSON records to REMOTECLAW_SIDE_EFFECTS_FILE.

Return format: All tools return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] } where result is the gateway’s JSON response. Individual tool sections below note return shapes only when they differ from or extend this default.


Context

Every tool handler receives a shared McpHandlerContext populated from environment variables:

FieldEnv VarDescription
gatewayUrlREMOTECLAW_GATEWAY_URLGateway WebSocket URL
gatewayTokenREMOTECLAW_GATEWAY_TOKENGateway auth token
sessionKeyREMOTECLAW_SESSION_KEYCurrent session key
sideEffectsREMOTECLAW_SIDE_EFFECTS_FILENDJSON side-effects writer
channelREMOTECLAW_CHANNELOriginating channel (e.g. telegram)
accountIdREMOTECLAW_ACCOUNT_IDOriginating account ID
toREMOTECLAW_TODelivery target
threadIdREMOTECLAW_THREAD_IDThread/topic ID
senderIsOwnerREMOTECLAW_SENDER_IS_OWNERWhether sender is bot owner
toolProfileREMOTECLAW_TOOL_PROFILETool profile (default: full)

Session Tools (7 tools)

Source: src/middleware/mcp-handlers/session.ts Permission: All agents

sessions_list

List active sessions with optional filters.

ParameterTypeRequiredDescription
filterstringnoSearch string; when set, limit is ignored
limitnumbernoMax results (only used when filter is absent)

Always includes global and unknown sessions in results.

sessions_history

Get chat history for a session.

ParameterTypeRequiredDescription
sessionKeystringyesTarget session key
limitnumbernoMax messages to return

sessions_send

Send a message to another session. Use sessionKey or label to identify the target.

ParameterTypeRequiredDescription
sessionKeystringnoTarget session key
labelstringnoAlternative target identifier (used if sessionKey absent)
messagestringyesMessage text
timeoutnumbernoWait timeout in seconds (default: 30; pass 0 for fire-and-forget)

Behavior: Sends the message, then waits for the target session’s reply (fetches last 5 messages from history). With timeout: 0, returns immediately with { runId, status: "accepted" }.

Returns:

  • Fire-and-forget: { runId, status: "accepted" }
  • With wait: { runId, status, reply }
  • On error: { runId, status: "error", error }

Records a message_sent side effect.

sessions_spawn

Spawn a sub-agent session to handle a delegated task.

ParameterTypeRequiredDescription
taskstringyesTask description for the sub-agent
agentIdstringnoSpecific agent to spawn
labelstringnoLabel for the new session

Passes the current session key as the parent.

session_status

Get the current status of a session.

ParameterTypeRequiredDescription
sessionKeystringnoDefaults to current session if omitted

agents_list

List all configured agents.

No parameters.

subagents

Manage sub-agents (list, status, cancel, etc.).

ParameterTypeRequiredDescription
actionstringyesSub-agent action to perform
paramsobjectnoAdditional parameters for the action

The params object is spread into the gateway call alongside action and the current sessionKey.


Message Tools (10 tools)

Source: src/middleware/mcp-handlers/message.ts Permission: All agents

All message tools inject channel and accountId from context. Tools that send messages record a message_sent side effect.

message_send

Send a message to a target channel or user.

ParameterTypeRequiredDescription
targetstringyesRecipient identifier
messagestringyesMessage text
mediastringnoMedia URL to attach

message_reply

Reply to a message in the current conversation.

ParameterTypeRequiredDescription
messagestringyesReply text
replyToIdstringnoMessage ID to reply to

Always targets the current conversation (ctx.to).

message_thread_reply

Reply to a message within a specific thread.

ParameterTypeRequiredDescription
messagestringyesReply text
threadIdstringyesThread identifier

message_broadcast

Broadcast a message to multiple targets.

ParameterTypeRequiredDescription
targetsstring[]yesArray of recipient identifiers
messagestringyesMessage text

message_react

React to a message with an emoji.

ParameterTypeRequiredDescription
emojistringyesEmoji to react with (empty string removes reaction)
messageIdstringyesTarget message ID

See Reaction semantics for channel-specific behavior.

message_delete

Delete a message.

ParameterTypeRequiredDescription
messageIdstringyesID of message to delete

message_send_attachment

Send a file attachment to a target.

ParameterTypeRequiredDescription
targetstringyesRecipient identifier
filestringyesFile URL or path
captionstringnoAttachment caption

message_send_with_effect

Send a message with a visual effect.

ParameterTypeRequiredDescription
targetstringyesRecipient identifier
messagestringyesMessage text
effectIdstringyesEffect identifier

message_pin

Pin a message in a channel.

ParameterTypeRequiredDescription
messageIdstringyesID of message to pin

message_read

Read messages from a channel.

ParameterTypeRequiredDescription
channelIdstringnoChannel to read from (defaults to current conversation)
limitnumbernoMax messages to return

Cron Tools (7 tools)

Source: src/middleware/mcp-handlers/cron.ts Permission: Owner-only

cron_status

Check cron scheduler status.

No parameters.

cron_list

List cron jobs.

ParameterTypeRequiredDescription
filterstringnoFilter string

Always includes disabled jobs in results.

cron_add

Create a new cron job.

ParameterTypeRequiredDescription
jobobjectyesFull cron job definition (shape determined by gateway)

The job object is passed directly as gateway params (not nested). Records a cron_added side effect with the created job ID.

cron_update

Update a cron job.

ParameterTypeRequiredDescription
jobIdstringyesID of the job to update
patchobjectyesPartial update fields

cron_remove

Remove a cron job.

ParameterTypeRequiredDescription
jobIdstringyesID of the job to remove

cron_run

Trigger a cron job immediately.

ParameterTypeRequiredDescription
jobIdstringyesID of the job to run

Always uses force mode.

cron_runs

Get run history for a cron job.

ParameterTypeRequiredDescription
jobIdstringyesID of the job
limitnumbernoMax run records to return

Gateway Tools (5 tools)

Source: src/middleware/mcp-handlers/gateway.ts Permission: Owner-only

gateway_restart

Restart the gateway process.

No parameters. Destructive — restarts the running gateway.

gateway_config_get

Get gateway configuration, optionally filtered by key.

ParameterTypeRequiredDescription
keystringnoSpecific config key to retrieve

gateway_config_apply

Apply a full gateway configuration object, replacing the current configuration.

ParameterTypeRequiredDescription
configobjectyesComplete configuration object (any shape accepted)

Full replacement, not a partial update.

gateway_config_patch

Patch the gateway configuration with a partial update.

ParameterTypeRequiredDescription
patchesobjectyesPartial configuration patches (any shape accepted)

gateway_config_schema

Get the JSON schema for gateway configuration.

No parameters.


Node Tools (7 tools)

Source: src/middleware/mcp-handlers/nodes.ts Permission: Owner-only

node_list

List connected and paired nodes.

No parameters.

node_describe

Get detailed information about a specific node.

ParameterTypeRequiredDescription
nodeIdstringyesNode identifier

node_invoke

Execute a command on a connected node.

ParameterTypeRequiredDescription
nodeIdstringyesTarget node
commandstringyesCommand name to execute
paramsanynoCommand parameters
timeoutMsnumbernoExecution timeout in milliseconds

Auto-generates a UUID idempotency key on every call.

node_rename

Rename a paired node.

ParameterTypeRequiredDescription
nodeIdstringyesNode identifier
displayNamestringyesNew display name

node_pair_list

List pending and completed node pairing requests.

No parameters.

node_pair_approve

Approve a pending node pairing request.

ParameterTypeRequiredDescription
requestIdstringyesPairing request ID

node_pair_reject

Reject a pending node pairing request.

ParameterTypeRequiredDescription
requestIdstringyesPairing request ID

Canvas Tools (7 tools)

Source: src/middleware/mcp-handlers/canvas.ts Permission: Owner-only

All canvas tools are thin wrappers around node_invoke with pre-filled canvas-specific commands. Each call auto-generates a UUID idempotency key.

canvas_present

Show the canvas on a node, optionally with a target URL and placement.

ParameterTypeRequiredDescription
nodeIdstringyesTarget node
urlstringnoURL to load in the canvas
xnumbernoX position
ynumbernoY position
widthnumbernoCanvas width
heightnumbernoCanvas height

Placement is only sent if at least one position/dimension value is a finite number.

canvas_hide

Hide the canvas on a node.

ParameterTypeRequiredDescription
nodeIdstringyesTarget node

canvas_navigate

Navigate the canvas to a URL.

ParameterTypeRequiredDescription
nodeIdstringyesTarget node
urlstringyesURL to navigate to

canvas_eval

Evaluate JavaScript in the canvas.

ParameterTypeRequiredDescription
nodeIdstringyesTarget node
javaScriptstringyesJavaScript code to evaluate

canvas_snapshot

Capture a snapshot of the canvas.

ParameterTypeRequiredDescription
nodeIdstringyesTarget node
format"png" | "jpg" | "jpeg"noImage format
maxWidthnumbernoMax width of the snapshot
qualitynumbernoImage quality

canvas_a2ui_push

Push A2UI JSONL content to the canvas.

ParameterTypeRequiredDescription
nodeIdstringyesTarget node
jsonlstringyesA2UI JSONL payload string

canvas_a2ui_reset

Reset the A2UI renderer state on a node.

ParameterTypeRequiredDescription
nodeIdstringyesTarget node

Browser Tools (1 tool)

Source: src/middleware/mcp-handlers/browser.ts Permission: Owner-only

browser_request

Proxy an HTTP request through a browser-capable node.

ParameterTypeRequiredDescription
method"GET" | "POST" | "DELETE"yesHTTP method
pathstringyesRequest path
queryobjectnoQuery parameters
bodyanynoRequest body
timeoutMsnumbernoRequest timeout in milliseconds

TTS Tools (6 tools)

Source: src/middleware/mcp-handlers/tts.ts Permission: Owner-only

tts_status

Get current TTS status (enabled, provider, fallbacks).

No parameters.

tts_convert

Convert text to speech audio.

ParameterTypeRequiredDescription
textstringyesText to synthesize
channelstringnoTarget channel for delivery format negotiation

tts_providers

List available TTS providers and their configuration.

No parameters.

tts_set_provider

Set the active TTS provider.

ParameterTypeRequiredDescription
providerstringyesProvider name (openai, elevenlabs, or edge)

tts_enable

Enable text-to-speech.

No parameters.

tts_disable

Disable text-to-speech.

No parameters.


Plugin Tools (dynamic)

Source: src/middleware/mcp-plugin-tools.ts Permission: All agents (availability depends on gateway plugin configuration)

Plugin tools are not statically defined. At server startup, registerPluginTools calls plugin:tools:list on the gateway. Each returned tool entry includes a name, description, and JSON Schema input definition, which is converted to Zod for MCP registration.

When invoked, each plugin tool calls plugin:tools:invoke on the gateway with { toolName, params, sessionKey }. The response content is mapped: image entries (with base64 data) become MCP image content; everything else becomes MCP text content.

If the gateway does not have plugins enabled, registerPluginTools silently skips registration.


Tool Summary

GroupSourcePermissionCountTools
Sessionmcp-handlers/session.tsAll7sessions_list, sessions_history, sessions_send, sessions_spawn, session_status, agents_list, subagents
Messagemcp-handlers/message.tsAll10message_send, message_reply, message_thread_reply, message_broadcast, message_react, message_delete, message_send_attachment, message_send_with_effect, message_pin, message_read
Cronmcp-handlers/cron.tsOwner7cron_status, cron_list, cron_add, cron_update, cron_remove, cron_run, cron_runs
Gatewaymcp-handlers/gateway.tsOwner5gateway_restart, gateway_config_get, gateway_config_apply, gateway_config_patch, gateway_config_schema
Nodesmcp-handlers/nodes.tsOwner7node_list, node_describe, node_invoke, node_rename, node_pair_list, node_pair_approve, node_pair_reject
Canvasmcp-handlers/canvas.tsOwner7canvas_present, canvas_hide, canvas_navigate, canvas_eval, canvas_snapshot, canvas_a2ui_push, canvas_a2ui_reset
Browsermcp-handlers/browser.tsOwner1browser_request
TTSmcp-handlers/tts.tsOwner6tts_status, tts_convert, tts_providers, tts_set_provider, tts_enable, tts_disable
Pluginmcp-plugin-tools.tsAlldynamicRegistered from gateway at startup
Total50