Production-ready MCP server that provides LLMs with essential random generation abilities, built entirely on Python's standard library.
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"random-number": {
"args": [
"random-number-mcp"
],
"command": "uvx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
Production-ready MCP server that provides LLMs with essential random generation abilities, built entirely on Python's standard library.
Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
npx -y '@modelcontextprotocol/inspector' 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
Five weighted categories — click any category to see the underlying evidence.
MCP Inspector is Vulnerable to Potential Command Execution via XSS When Connecting to an Untrusted MCP Server
An XSS flaw exists in the MCP Inspector local development tool when it renders a redirect URL returned by a remote MCP server. If the Inspector connects to an untrusted server, a crafted redirect can inject script into the Inspector context and, via the built-in proxy, be leveraged to trigger arbitrary command execution on the developer machine. Version 0.16.6 hardens URL handling/validation and prevents script execution. > Thank you to the following researchers for their reports and contributi
MCP Inspector proxy server lacks authentication between the Inspector client and proxy
Versions of MCP Inspector below 0.14.1 are vulnerable to remote code execution due to lack of authentication between the Inspector client and proxy, allowing unauthenticated requests to launch MCP commands over stdio. Users should immediately upgrade to version 0.14.1 or later to address these vulnerabilities. Credit: Rémy Marot <bughunters@tenable.com>
Click any tool to inspect its schema.
This server is missing a description.If you've used it, help the community.
Add informationBe the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in other
MCP server for Spanning Cloud Backup — M365/GWS/Salesforce backups, restores, audit.
AI agent control of 3D printers — 432 tools for OctoPrint, Moonraker, Bambu, Prusa, Elegoo
MCP server for Kaseya Autotask PSA — companies, tickets, projects, time entries, and more.
On-chain provenance lookup for AnchorRegistry. Resolve AR-IDs, hashes, and full trees. Authless.
MCP Security Weekly
Get CVE alerts and security updates for Random Number Mcp and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
Essential random number generation utilities from the Python standard library, including pseudorandom and cryptographically secure operations for integers, floats, weighted selections, list shuffling, and secure token generation.
https://github.com/user-attachments/assets/303a441a-2b10-47e3-b2a5-c8b51840e362
| Tool | Purpose | Python function |
|---|---|---|
random_int | Generate random integers | random.randint() |
random_float | Generate random floats | random.uniform() |
random_choices | Choose items from a list (optional weights) | random.choices() |
random_shuffle | Return a new list with items shuffled | random.sample() |
random_sample | Choose k unique items from population | random.sample() |
secure_token_hex | Generate cryptographically secure hex tokens | secrets.token_hex() |
secure_random_int | Generate cryptographically secure integers | secrets.randbelow() |
Add this to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"random-number": {
"command": "uvx",
"args": ["random-number-mcp"]
}
}
}
random_intGenerate a random integer between low and high (inclusive).
Parameters:
low (int): Lower bound (inclusive)high (int): Upper bound (inclusive)Example:
{
"name": "random_int",
"arguments": {
"low": 1,
"high": 100
}
}
random_floatGenerate a random float between low and high.
Parameters:
low (float, optional): Lower bound (default: 0.0)high (float, optional): Upper bound (default: 1.0)Example:
{
"name": "random_float",
"arguments": {
"low": 0.5,
"high": 2.5
}
}
random_choicesChoose k items from a population with replacement, optionally weighted.
Parameters:
population (list): List of items to choose fromk (int, optional): Number of items to choose (default: 1)weights (list, optional): Weights for each item (default: equal weights)Example:
{
"name": "random_choices",
"arguments": {
"population": ["red", "blue", "green", "yellow"],
"k": 2,
"weights": [0.4, 0.3, 0.2, 0.1]
}
}
random_shuffleReturn a new list with items in random order.
Parameters:
items (list): List of items to shuffleExample:
{
"name": "random_shuffle",
"arguments": {
"items": [1, 2, 3, 4, 5]
}
}
random_sampleChoose k unique items from population without replacement.
Parameters:
population (list): List of items to choose fromk (int): Number of items to chooseExample:
{
"name": "random_sample",
"arguments": {
"population": ["a", "b", "c", "d", "e"],
"k": 2
}
}
secure_token_hexGenerate a cryptographically secure random hex token.
Parameters:
nbytes (int, optional): Number of random bytes (default: 32)Example:
{
"name": "secure_token_hex",
"arguments": {
"nbytes": 16
}
}
secure_random_intGenerate a cryptographically secure random integer below upper_bound.
Parameters:
upper_bound (int): Upper bound (exclusive)Example:
{
"name": "secure_random_int",
"arguments": {
"upper_bound": 1000
}
}
This package provides both