Agent quickstart
Go from zero to an agent that can search, clone, render, and send RCS templates in a few minutes.
1. Mint a scoped key
As an org admin, mint an API key. For a discovery + send agent,
grant templates:read, marketplace:clone, and messages:send. Copy the
plaintext rcsk_live_… once.
export RCS_GATEWAY_URL=https://your-server
export RCS_AGENT_KEY=rcsk_live_…2. Register the MCP server
claude mcp add rcs-templates \
--env RCS_GATEWAY_URL=$RCS_GATEWAY_URL \
--env RCS_AGENT_KEY=$RCS_AGENT_KEY \
-- npx -y -p @rcs-templates/agent-toolkit rcs-mcpPrefer a shell or CI loop? Use the CLI instead — same env vars, same verbs.
3. Let the agent work
Once registered, the nine tools appear natively. A typical loop:
capabilities→ confirm the key’s scopes.search_templates→ find a marketplace template by query/channel/category.clone_template→ deep-copy it into your org as a private draft.render_template→ preview with sample variables; check the SMS fallback.send_message→ broadcast to an E.164 list (clears the provider-approval gate).
Always start with capabilities. It returns the scopes your key actually
holds, so the agent plans around what it’s allowed to do instead of failing
mid-task.
Embed it in your own code
Skip the packaged surfaces and call the gateway directly with the typed client.
Import GatewayClient and the shared TOOLS catalog from
@rcs-templates/agent-toolkit — the same client powers the MCP server and the CLI:
import { GatewayClient, TOOLS } from "@rcs-templates/agent-toolkit";
const client = new GatewayClient({
baseUrl: process.env.RCS_GATEWAY_URL!,
apiKey: process.env.RCS_AGENT_KEY!,
});
// Discover, then render before you send
const { templates } = await client.searchTemplates({
channel: "rcs",
category: "hospitality",
});
const preview = await client.renderTemplate({
id: templates[0].id,
variables: { first_name: "Sam" },
});
console.log(preview.payload, preview.fallback);TOOLS is the declarative catalog the gateway, MCP server, and CLI all share —
use it to expose the same verbs to your own model.
Next
- API keys — scopes, rotation, and security model.
- API reference — every tool’s contract.