.do
Execution

rpc

Remote Procedure Call framework for service-to-service communication

rpc

Remote Procedure Call framework enabling type-safe, distributed communication between services with automatic serialization and error handling.

Overview

RPC enables you to call functions on remote services as if they were local, with full TypeScript type safety, automatic retries, and service discovery.

Quick Example

import { rpc } from 'sdk.do'

// Call remote procedure
const user = await rpc.call('user-service', 'getUser', {
  userId: '123',
})

// Result is type-safe
console.log(user.email)

Core Capabilities

  • Type-Safe Calls - Full TypeScript type safety across service boundaries
  • Service Discovery - Automatic service registry and load balancing
  • Service Bindings - Zero-hop Worker-to-Worker RPC on Cloudflare
  • Streaming Support - Unidirectional and bidirectional streaming
  • Error Handling - Automatic retries, timeouts, and circuit breakers

Access Methods

SDK

TypeScript/JavaScript library for type-safe RPC

await rpc.call('user-service', 'getUser', { userId: '123' })

SDK Documentation

CLI

Command-line tool for calling and testing RPC services

do rpc call user-service getUser --userId 123

CLI Documentation

API

REST gateway to RPC services

curl -X POST https://api.do/v1/rpc/user-service/getUser -d '{"userId":"123"}'

API Documentation

MCP

Model Context Protocol for AI-driven RPC calls

Call the getUser procedure on user-service with userId 123

MCP Documentation