
Random Number and more generator (Includes UUID, numbers, password, dice, cards and more)
概览
A Model Context Protocol (MCP) server providing various random generation utilities, including UUID, numbers, strings, passwords, Gaussian distribution, dice rolling, and card drawing. - Generates RFC 4122 version 4 UUIDs - Uses Node's native crypto module for secure random generation - No parameters required - Generates random numbers within a specified range - Configurable minimum and maximum values (inclusive) - Defaults to range 0-100 if no parameters provided - Generates random numbers following a Gaussian (normal) distribution - Normalized to range 0-1 - No parameters required - Generates random strings with configurable length and character sets - Supports multiple character sets: * alphanumeric (default): A-Z, a-z, 0-9 * numeric: 0-9 * lowercase: a-z * uppercase: A-Z * special: !@#$%^&()+-=[]{};\\'"\\|,.<>/?
README
以下为原文 README 节选,完整内容请查看原文。
MCP Rand
A Model Context Protocol (MCP) server providing various random generation utilities, including UUID, numbers, strings, passwords, Gaussian distribution, dice rolling, and card drawing.
Installation
npm install mcp-rand
Or install globally:
npm install -g mcp-rand
Features
UUID Generator
- Generates RFC 4122 version 4 UUIDs
- Uses Node’s native crypto module for secure random generation
- No parameters required
Random Number Generator
- Generates random numbers within a specified range
- Configurable minimum and maximum values (inclusive)
- Defaults to range 0-100 if no parameters provided
Gaussian Random Generator
- Generates random numbers following a Gaussian (normal) distribution
- Normalized to range 0-1
- No parameters required
Random String Generator
- Generates random strings with configurable length and character sets
- Supports multiple character sets:
- alphanumeric (default): A-Z, a-z, 0-9
- numeric: 0-9
- lowercase: a-z
- uppercase: A-Z
- special: !@#$%^&*()_±=[]{};'"\|,.<>/?
- Configurable string length (defaults to 10)
Password Generator
- Generates strong passwords with a mix of character types
- Ensures at least one character from each type (uppercase, lowercase, numbers, special)
- Configurable length (minimum 8, default 16)
- WARNING: While passwords are generated locally, it’s recommended to use a dedicated password manager
Dice Roller
- Roll multiple dice using standard dice notation
- Supports notation like “2d6” (two six-sided dice), “1d20” (one twenty-sided die)
- Returns individual rolls and total for each set of dice
- Can roll multiple different dice sets at once (e.g., “2d6”, “1d20”, “4d4”)
Card Drawer
- Draw cards from a standard 52-card deck
- Maintains deck state between draws using base64 encoding
- Returns drawn cards and remaining deck state
- Supports drawing any number of cards up to the deck size
- Properly shuffles available cards before each draw
Usage
As a CLI Tool
npx mcp-rand
Integration with MCP Clients
Add to your MCP client configuration:
{
"mcpServers": {
"mcp-rand": {
"command": "node",
"args": ["path/to/mcp-rand/build/index.js"],
"disabled": false,
"alwaysAllow": []
}
}
}
Example Usage
// Generate UUID
const uuid = await client.callTool('generate_uuid', {});
console.log(uuid); // e.g., "550e8400-e29b-41d4-a716-446655440000"
// Generate random number
const number = await client.callTool('generate_random_number', {
min: 1,
max: 100
});
安装
npx mcp-rand配置
{
"mcpServers": {
"mcp-rand": {
"command": "node",
"args": ["path/to/mcp-rand/build/index.js"],
"disabled": false,
"alwaysAllow": []
}
}
}