Pluggedin Random Number Generator
Teaching LLMs that Math.random() is so last century
Tools
generate_random_integer
Generate cryptographically secure random integers within a specified range
generate_random_float
Generate cryptographically secure random floating-point numbers
generate_random_bytes
Generate cryptographically secure random bytes
generate_uuid
Generate a cryptographically secure UUID (v4)
generate_random_string
Generate a cryptographically secure random string
generate_random_choice
Randomly select items from a given list using cryptographically secure randomness
generate_random_boolean
Generate cryptographically secure random boolean values
README
Plugged.in Random Number Generator MCP Server
A state-of-the-art cryptographically secure random number generator server implementing the Model Context Protocol (MCP). This server provides advanced random number generation capabilities for AI applications, LLMs, and other systems requiring high-quality randomness.
🚀 Features
- Cryptographically Secure: Uses Node.js built-in
cryptomodule for cryptographically secure pseudorandom number generation (CSPRNG) - Multiple Data Types: Generate integers, floats, bytes, UUIDs, strings, booleans, and random choices
- Flexible Configuration: Customizable ranges, counts, encodings, and character sets
- MCP Compliant: Full compatibility with Model Context Protocol specification including tools and prompts
- AI-Friendly Prompts: Built-in prompt to help LLMs understand they should use this server for random generation
- Type Safety: Written in TypeScript with comprehensive type definitions
- Error Handling: Robust input validation and error reporting
- Performance Optimized: Efficient algorithms suitable for high-throughput applications
📦 Installation
Prerequisites
- Node.js 18.0.0 or higher
- npm or yarn package manager
Install via Desktop Extension (DXT)
For Claude Desktop users, you can install this server as a one-click Desktop Extension:
- Download the latest
.dxtfile from the releases page - Open Claude Desktop
- Go to Settings → Developer → MCP Servers
- Click "Install from file" and select the downloaded
.dxtfile
Install from npm
npm install -g pluggedin-random-number-generator-mcp
Or install locally in your project:
npm install pluggedin-random-number-generator-mcp
Deploy with Smithery
Deploy this MCP server to the cloud using Smithery:
- Fork this repository
- Connect your GitHub account to Smithery
- Navigate to the Deployments tab
- Click "Deploy"
The server includes a smithery.yaml configuration file for easy deployment.
Build from Source
git clone https://github.com/VeriTeknik/pluggedin-random-number-generator-mcp.git
cd pluggedin-random-number-generator-mcp
npm install
npm run build
# Optional: Build DXT package
npm run build:dxt
🛠️ Usage
Running the Server
The server communicates via stdio (standard input/output) following the MCP protocol:
# Using the built version
node dist/index.js
# Using development mode
npm run dev
Integration with MCP Clients
For npm installation (recommended):
Add to your MCP client configuration. For Claude Desktop, add to your claude_desktop_config.json:
{
"mcpServers": {
"random-generator": {
"command": "npx",
"args": ["-y", "pluggedin-random-number-generator-mcp@latest"]
}
}
}
This will always use the latest version from npm without requiring a global installation.
For local installation:
{
"mcpServers": {
"random-generator": {
"command": "node",
"args": ["node_modules/pluggedin-random-number-generator-mcp/dist/index.js"]
}
}
}
🔧 Available Tools
1. Generate Random Integers
Generate cryptographically secure random integers within a specified range.
Parameters:
min(integer, optional): Minimum value (inclusive), default: 0max(integer, optional): Maximum value (inclusive), default: 100count(integer, optional): Number of integers to generate, default: 1, max: 1000
Example:
{
"name": "generate_random_integer",
"arguments": {
"min": 1,
"max": 100,
"count": 5
}
}
2. Generate Random Floats
Generate cryptographically secure random floating-point numbers.
Parameters:
min(number, optional): Minimum value (inclusive), default: 0.0max(number, optional): Maximum value (exclusive), default: 1.0count(integer, optional): Number of floats to generate, default: 1, max: 1000precision(integer, optional): Decimal places to round to, default: 6, max: 15
Example:
{
"name": "generate_random_float",
"arguments": {
"min": 0.0,
"max": 1.0,
"count": 3,
"precision": 4
}
}
3. Generate Random Bytes
Generate cryptographically secure random bytes in various encodings.
Parameters:
length(integer, optional): Number of bytes to generate, default: 32, max: 1024encoding(string, optional): Output encoding ("hex", "base64", "binary"), default: "hex"
Example:
{
"name": "generate_random_bytes",
"arguments": {
"length": 32,
"encoding": "hex"
}
}
4. Generate UUIDs
Generate cryptographically secure UUID version 4 identifiers.
Parameters:
count(integer, optional): Number of UUIDs to generate, default: 1, max: 100format(string, optional): UUID format ("standard", "compact"), default: "standard"
Example:
{
"name": "generate_uuid",
"arguments": {
"count": 3,
"format": "standard"
}
}
5. Generate Random Strings
Generate cryptographically secure random strings with customizable character sets.
Parameters:
length(integer, optional): String length, default: 16, max: 256charset(string, optional): Character set ("alphanumeric", "alphabetic", "numeric", "hex", "base64", "ascii_printable"), default: "alphanumeric"count(integer, optional): Number of strings to generate, default: 1, max: 100
Example:
{
"name": "generate_random_string",
"arguments": {
"length": 12,
"charset": "alphanumeric",
"count": 2
}
}
6. Generate Random Choices
Randomly select items from a provided list using cryptographically secure randomness.
Parameters:
choices(array, required): Array of string items to choose fromcount(integer, optional): Number of items to select, default: 1allow_duplicates(boolean, optional): Whether to allow duplicate selections, default: true
Example:
{
"name": "generate_random_choice",
"arguments": {
"choices": ["apple", "banana", "cherry", "date"],
"count": 2,
"allow_duplicates": false
}
}
7. Generate Random Booleans
Generate cryptographically secure random boolean values with configurable probability.
Parameters:
count(integer, optional): Number of booleans to generate, default: 1, max: 1000probability(number, optional): Probability of true (0.0 to 1.0), default: 0.5
Example:
{
"name": "generate_random_boolean",
"arguments": {
"count": 10,
"probability": 0.7
}
}
🤖 AI Prompts
The server includes a built-in prompt to help LLMs understand they should use this server for random number generation rather than attempting to generate random values themselves.
Available Prompt: generate_random
This prompt educates the AI about its limitations in generating random numbers and guides it to use the available cryptographically secure tools.
Parameters:
type(string, optional): Type of random value needed (integer, float, uuid, string, bytes, choice, boolean)requirements(string, optional): Specific requirements for the random generation
Example Usage: When an LLM receives a request like "Generate a random password" or "Pick a random number", the prompt will:
- Acknowledge that LLMs cannot generate truly random values
- Explain the available cryptographically secure tools
- Guide the AI to use the appropriate tool for the task
This ensures that all random generation in your application uses proper cryptographic methods rather than predictable AI-generated patterns.
🔒 Security Features
This server implements several security best practices:
-
Cryptographically Secure Randomness: All random number generation uses Node.js
cryptomodule functions (randomBytes,randomInt,randomUUID) which provide cryptographically secure pseudorandom numbers suitable for security-sensitive applications. -
Input Validation: Comprehensive validation of all input parameters to prevent injection attacks and ensure data integrity.
-
Rate Limiting: Built-in limits on generation counts to prevent resource exhaustion attacks.
-
Error Handling: Secure error messages that don't leak sensitive information about the system state.
🧪 Testing
The server includes a comprehensive test suite that validates all functionality:
# Run the test suite
node test.js
The test suite covers:
- Tool discovery and listing
- All random generation functions
- Input validation and error handling
- Output format verification
- Statistical properties validation
📊 Performance
The server is optimized for performance while maintaining security:
- Efficient Algorithms: Uses optimized native crypto functions
- Memory Management: Minimal memory footprint with efficient buffer handling
- Concurrent Requests: Thread-safe design supporting multiple simultaneous requests
- Scalability: Suitable for high-throughput applications
🔧 Development
Project Structure
pluggedin-random-number-generator-mcp/
├── src/
│ └── index.ts # Main server implementation
├── dist/ # Compiled JavaScript output
├── test.js # Comprehensive test suite
├── package.json # Project configuration
├── tsconfig.json # TypeScript configuration
└── README.md # This documentation
Building
npm run build
Development Mode
npm run dev
Testing with MCP Inspector
You can test the server using the MCP Inspector tool:
npm run inspector
This will start the MCP Inspector web interface where you can:
- View available tools
- Test tool execution
- Inspect request/response payloads
- Debug server behavior
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Development Guidelines
- Follow TypeScript best practices
- Maintain comprehensive test coverage
- Update documentation for new features
- Ensure all tests pass before submitting
- Follow semantic versioning for releases
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🔗 Related Projects
- Model Context Protocol - The official MCP specification
- Plugged.in - MCP server management and discovery platform
- MCP SDK - Official TypeScript SDK for MCP
📞 Support
For support, questions, or feature requests:
- Open an issue on GitHub
- Visit the Plugged.in platform for MCP server management
- Check the MCP documentation for protocol details
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。