Supports configuration through environment variables stored in .env files for API keys and service parameters
Random.org MCP Server
A Model Context Protocol (MCP) server that provides access to the api.random.org service for generating true random numbers, strings, UUIDs, and more.
Features
This MCP server provides the following tools:
- generateIntegers - Generate true random integers within a specified range
- generateIntegerSequences - Generate sequences of true random integers
- generateDecimalFractions - Generate random decimal fractions between 0 and 1
- generateGaussians - Generate random numbers from a Gaussian distribution
- generateStrings - Generate random strings from specified characters
- generateUUIDs - Generate true random UUIDs (version 4)
- generateBlobs - Generate random binary data in base64 or hex format
- getUsage - Get API usage statistics
Installation & Deployment
🚀 Quick Start with npm (Recommended)
Method 1: Global Installation
Method 2: Use without Installation
Method 3: Local Project Installation
🛠️ Build from Source
- Clone this repository:
- Install dependencies:
- Build the project:
Configuration
🔑 Get API Key
- Visit api.random.org to get a free API key
- Register and obtain your API key
⚙️ Configuration Methods
Method 1: Environment Variables (Recommended)
Create a .env
file in your working directory:
Edit .env
file:
Method 2: MCP Client Configuration
Configure directly in your MCP client (e.g., Claude Desktop):
Environment Variables
RANDOM_ORG_API_KEY
(required) - Your api.random.org API keyRATE_LIMIT_REQUESTS_PER_SECOND
(optional, default: 1) - Rate limitingRATE_LIMIT_BURST_SIZE
(optional, default: 5) - Burst size for rate limitingREQUEST_TIMEOUT_MS
(optional, default: 10000) - Request timeout in millisecondsMAX_RETRIES
(optional, default: 3) - Maximum number of retriesRETRY_DELAY_MS
(optional, default: 1000) - Delay between retries
Usage
🔗 MCP Client Integration
Claude Desktop Configuration
- Locate your Claude Desktop configuration file:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Linux:
~/.config/Claude/claude_desktop_config.json
- Windows:
- Add the Random.org MCP server configuration:
- Restart Claude Desktop
Alternative Configurations
Using Global Installation
Using Local Installation
Running the Server
🚀 Production Usage
If installed globally:
Using npx (no installation required):
From source:
🛠️ Development
For development with auto-reload:
Tool Examples
Generate Random Integers
Generate Random Strings
Generate UUIDs
Generate Gaussian Numbers
Get Usage Statistics
API Limits
The api.random.org service has the following limits:
- Integers: 1-10,000 numbers per request
- Integer Sequences: 1-10,000 sequences, each 1-10,000 numbers long
- Decimal Fractions: 1-10,000 numbers per request
- Gaussians: 1-10,000 numbers per request
- Strings: 1-10,000 strings per request, each 1-20 characters long
- UUIDs: 1-1,000 UUIDs per request
- Blobs: 1-100 blobs per request, each 1-1,048,576 bytes
Error Handling
The server includes comprehensive error handling:
- Input validation for all parameters
- Rate limiting to respect API limits
- Automatic retries with exponential backoff
- Detailed error messages for troubleshooting
Development
Scripts
npm run build
- Build the TypeScript codenpm start
- Run the compiled servernpm run dev
- Run in development mode with auto-reloadnpm run clean
- Clean the build directory
Project Structure
License
MIT License - see LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Support
For issues related to this MCP server, please open an issue on GitHub. For api.random.org API issues, please refer to their documentation.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A Model Context Protocol server that provides access to api.random.org for generating true random numbers, strings, UUIDs, and more.
Related MCP Servers
- -securityAlicense-qualityA server that implements the Model Context Protocol, providing a standardized way to connect AI models to different data sources and tools.Last updated -27TypeScriptMIT License
- -securityFlicense-qualityA Model Context Protocol server that provides AI models with structured access to external data and services, acting as a bridge between AI assistants and applications, databases, and APIs in a standardized, secure way.Last updated -1Python
- -securityAlicense-qualityAn Intelligent Model Context Protocol server that generates mock servers from OpenAPI specifications, featuring advanced logging, performance analytics, and server discovery for AI-assisted API development.Last updated -PythonMIT License
- AsecurityFlicenseAqualityA Model Context Protocol server that enables LLMs to explore and interact with API specifications by providing tools for loading, browsing, and getting detailed information about API endpoints.Last updated -41013TypeScript