# random-number-mcp

Give an agent tools for random values, list selection and secure tokens. Useful when these operations need to happen through an MCP client.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 51
- Author: zazencodes
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/zazencodes/random-number-mcp
- Updated: 2026-07-18
- HTML: https://affpapa.org/en/nevibecode/mcp/random-number-mcp

## What it 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`.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add random-number-mcp -- uvx random-number-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from random-number-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add random-number-mcp -- uvx random-number-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from random-number-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add random-number-mcp uvx random-number-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from random-number-mcp <command>

## When to use it
- 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
- Generate a random integer between 1 and 100.
- Shuffle the list `[1, 2, 3, 4, 5]`.
- Create a cryptographically secure token in hexadecimal form.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
