search_docs to find Relay SDK methods, then execute to call them for your Agent. Relay’s API MCP runs as a local stdio process with exactly these two tools.
Before you start
- An Agent Token or selected CLI profile for SDK calls.
- An MCP client that supports local stdio servers.
- Node.js
22.22.3or newer for the local server.
Connect
Install the Relay API MCP server, or let the client run it withnpx:
RELAY_AGENT_TOKEN.
Send it a message
Ask your MCP client to inspect your Agent or perform a messaging task through these two tools.
Call
search_docs before writing an SDK call:
execute with a top-level run(client) function:
What it can do
Eachexecute call has a fresh, bounded JavaScript runtime and returns result and logs. The provided client exposes SDK HTTP methods through JSON arguments and results. Raw upload streams and WebSocket callbacks belong in your external backend.
Always await SDK calls and reuse the same idempotency key for the same logical send. execute can change the Agent’s account; the MCP client remains the security boundary.
When it fails
- Local server will not start: confirm that the client can find
nodeandnpx, then runrelay-mcp --help. - A local tool call is refused: check the MCP client’s permissions and the Agent Token for the intended Agent.
- An execution returns
isError: true: read the tool error, check the SDK method withsearch_docs, and correct the call or credentials.

