random-number-mcp — Claude Code MCP server: features and setup
Give an agent tools for random values, list selection and secure tokens. Useful when these operations need to happen through an MCP client.
claude mcp add random-number-mcp -- uvx random-number-mcpWhat random-number-mcp does
The server offers tools for random integers and floats, weighted or unique list selections, list shuffling, and token generation. Its ordinary random operations use Python’s random module; secure integers and tokens use secrets.
That distinction matters: random functions are not cryptographically secure, so use secure_token_hex when generating tokens. Add the server to Claude Code with claude mcp add random-number-mcp -- uvx random-number-mcp; it starts through uvx.
What it helps with
- draw a random integer within a chosen range
- select list entries using weights
- shuffle items into a new order
- generate a cryptographically secure hex token
Example prompts for the agent
- Generate a random integer between 1 and 100.
- Shuffle the list
[1, 2, 3, 4, 5]. - Create a cryptographically secure token in hexadecimal form.
How to install random-number-mcp
Platform CLI
claude mcp add random-number-mcp -- uvx random-number-mcpuvx runs the command named after the package; if the README names another one, use uvx --from random-number-mcp <command>
Platform CLI
codex mcp add random-number-mcp -- uvx random-number-mcpuvx runs the command named after the package; if the README names another one, use uvx --from random-number-mcp <command>
Config file
{
"mcpServers": {
"random-number-mcp": {
"command": "uvx",
"args": [
"random-number-mcp"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from random-number-mcp <command>
Config file
{
"servers": {
"random-number-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"random-number-mcp"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from random-number-mcp <command>
Platform CLI
gemini mcp add random-number-mcp uvx random-number-mcpuvx runs the command named after the package; if the README names another one, use uvx --from random-number-mcp <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about random-number-mcp
How do I install random-number-mcp in Claude Code?
Run claude mcp add random-number-mcp -- uvx random-number-mcp. This registers the MCP server and configures it to launch with uvx.
What does random-number-mcp do?
It provides tools for random numbers, weighted and unique selections, shuffling lists, and generating secure integers and tokens.
Can random-number-mcp generate secure tokens?
Yes. Use secure_token_hex, which relies on Python’s secrets module. The ordinary functions based on random are not cryptographically secure.