Claude Connector & MCP Server
The RANDSUM connector gives Claude real dice in any chat: roll,
validate and roll_game as tools, backed by @randsum/roller and
@randsum/games. A Claude connector is a remote
Model Context Protocol server, so the same
URL works in every other MCP client too:
https://api.randsum.dev/mcp
It is public, keyless and stateless, served over Streamable HTTP. In Claude Code, the RANDSUM plugin connects it for you and adds skills on top. See RANDSUM for AI agents for every option.
Add the connector to Claude
Section titled “Add the connector to Claude”In claude.ai, Claude Desktop or mobile: open Settings → Connectors → Add custom connector, name it RANDSUM, and paste the URL above. The tools are then available in any chat; ask Claude to roll and it calls them.
Any other MCP client
Section titled “Any other MCP client”Point any client that takes a server URL at https://api.randsum.dev/mcp.
Claude Code (without the plugin):
claude mcp add --transport http randsum https://api.randsum.dev/mcpCursor, VS Code, ChatGPT, Codex and others: add a remote (HTTP) MCP server with that URL in the client’s MCP settings. No key or header is needed.
For plain HTTP without MCP, see the HTTP API.
Local stdio server
Section titled “Local stdio server”For offline use or a client that can only start a command, the same server
ships on npm as @randsum/mcp, a CLI (randsum-mcp) that speaks MCP over
stdio. A client can launch it with bunx or npx, with no global install.
The snippets below mirror
packages/mcp/README.md,
which is the source of truth for install and config.
Claude Code
Section titled “Claude Code”claude mcp add randsum -- bunx -y @randsum/mcpClaude Desktop
Section titled “Claude Desktop”Add the server to claude_desktop_config.json:
{ "mcpServers": { "randsum": { "command": "bunx", "args": ["-y", "@randsum/mcp"] } }}Any MCP client that can spawn a stdio server works: point it at the
randsum-mcp binary (or bunx @randsum/mcp / npx @randsum/mcp).
The server registers three tools:
| Tool | Input | Returns |
|---|---|---|
roll |
{ notation: string, seed?: number } |
total, per-pool pools, and a human-readable description |
validate |
{ notation: string } |
valid, description (when valid), suggestion/error (when not) |
roll_game |
{ game: GameShortcode, params: object } |
game-interpreted total, result, details, initialRolls and the kept rolls |
Every tool is annotated read-only and closed-world (readOnlyHint: true, openWorldHint: false), which clients may use to skip confirmation prompts, and the server sends instructions telling the model to call a tool for every roll instead of inventing one.
Rolls RANDSUM dice notation (e.g. 4d6L,
2d20+5, 1d100). Pass an integer seed for a deterministic, reproducible
roll. Invalid notation returns a tool error (isError: true) with the reason and an error code; call validate for a suggested fix.
{ "notation": "4d6L", "seed": 42 }The result carries the combined total, a pools array (one entry per dice
pool, each with its own initialRolls, rolls, total, and description), and a top-level
description string.
validate
Section titled “validate”Checks whether a notation string is valid, returning a description when it is
and a suggested fix when it is not (e.g. 2d6 + 3 → 2d6+3).
{ "notation": "4d6L" }roll_game
Section titled “roll_game”Rolls for one game system and interprets the dice per that game. game is one
of blades, daggerheart, fate, fifth, pbta, root-rpg, or
salvageunion. Only the params fields relevant to the chosen game are read;
a required field missing for its game returns a tool error.
| Game | Relevant params |
|---|---|
blades |
rating |
daggerheart |
modifier, amplifyHope, amplifyFear, rollingWith |
fate |
modifier |
fifth |
modifier, rollingWith, crit |
pbta |
stat (required), forward, ongoing, rollingWith |
root-rpg |
bonus (required), rollingWith |
salvageunion |
tableName (required) |
rollingWith is "Advantage" or "Disadvantage".
Each game’s ranges, enums and required fields come from its spec (the
inputs export of @randsum/games/<game>), and params is checked against
the chosen game before it rolls.
{ "game": "fifth", "params": { "modifier": 3, "rollingWith": "Advantage" } }Seeded reproducibility
Section titled “Seeded reproducibility”The roll tool accepts an optional integer seed. With a seed, the server uses
a deterministic random number generator, so the same notation + seed always
produces the same dice, which suits tests, examples, and shareable results.
Omit seed for a fresh random roll each call. (validate and roll_game do
not take a seed.)
Privacy
Section titled “Privacy”The server needs no account and keeps nothing: it sees only the arguments of each tool call, never your conversation. Cloudflare keeps short-lived request logs for operations. See the privacy policy.