Random.org logo

Random.org

Community
QianJue-CN

A Model Context Protocol (MCP) server that provides access to the api.random.org service for generating true random numbers, strings, UUIDs, and more.

PublisherQianJue-CN
RepositoryTRUERandomMCP
LanguageTypeScript
Forks
1
Stars
1
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Random.org exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    1 stars and 1 forks from the linked repository.

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

bash
# Install globally
npm install -g random-org-mcp-server

# Verify installation
random-org-mcp --version

Method 2: Use without Installation

bash
# Run directly with npx (no installation required)
npx random-org-mcp-server

Method 3: Local Project Installation

bash
# Install in your project
npm install random-org-mcp-server

# Run from node_modules
npx random-org-mcp-server

🛠️ Build from Source

  1. Clone this repository:
bash
git clone https://github.com/QianJue-CN/TRUERandomMCP.git
cd TRUERandomMCP
  1. Install dependencies:
bash
npm install
  1. Build the project:
bash
npm run build

Configuration

🔑 Get API Key

  1. Visit api.random.org to get a free API key
  2. Register and obtain your API key

⚙️ Configuration Methods

Method 1: Environment Variables (Recommended)

Create a .env file in your working directory:

bash
# Copy example file (if building from source)
cp .env.example .env

Edit .env file:

env
RANDOM_ORG_API_KEY=your_api_key_here
RATE_LIMIT_REQUESTS_PER_SECOND=1
RATE_LIMIT_BURST_SIZE=5
REQUEST_TIMEOUT_MS=10000
MAX_RETRIES=3
RETRY_DELAY_MS=1000

Method 2: MCP Client Configuration

Configure directly in your MCP client (e.g., Claude Desktop):

json
{
  "mcpServers": {
    "random-org": {
      "command": "npx",
      "args": ["random-org-mcp-server"],
      "env": {
        "RANDOM_ORG_API_KEY": "your_api_key_here"
      }
    }
  }
}

Environment Variables

  • RANDOM_ORG_API_KEY (required) - Your api.random.org API key
  • RATE_LIMIT_REQUESTS_PER_SECOND (optional, default: 1) - Rate limiting
  • RATE_LIMIT_BURST_SIZE (optional, default: 5) - Burst size for rate limiting
  • REQUEST_TIMEOUT_MS (optional, default: 10000) - Request timeout in milliseconds
  • MAX_RETRIES (optional, default: 3) - Maximum number of retries
  • RETRY_DELAY_MS (optional, default: 1000) - Delay between retries

Usage

🔗 MCP Client Integration

Claude Desktop Configuration

  1. 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
  2. Add the Random.org MCP server configuration:

json
{
  "mcpServers": {
    "random-org": {
      "command": "npx",
      "args": ["random-org-mcp-server"],
      "env": {
        "RANDOM_ORG_API_KEY": "your_api_key_here"
      }
    }
  }
}
  1. Restart Claude Desktop

Alternative Configurations

Using Global Installation

json
{
  "mcpServers": {
    "random-org": {
      "command": "random-org-mcp",
      "env": {
        "RANDOM_ORG_API_KEY": "your_api_key_here"
      }
    }
  }
}

Using Local Installation

json
{
  "mcpServers": {
    "random-org": {
      "command": "node",
      "args": ["node_modules/random-org-mcp-server/dist/index.js"],
      "env": {
        "RANDOM_ORG_API_KEY": "your_api_key_here"
      }
    }
  }
}

Running the Server

🚀 Production Usage

If installed globally:

bash
random-org-mcp

Using npx (no installation required):

bash
npx random-org-mcp-server

From source:

bash
npm start

🛠️ Development

For development with auto-reload:

bash
npm run dev

Tool Examples

Generate Random Integers

json
{
  "name": "generateIntegers",
  "arguments": {
    "n": 5,
    "min": 1,
    "max": 100,
    "replacement": true,
    "base": 10
  }
}

Generate Random Strings

json
{
  "name": "generateStrings",
  "arguments": {
    "n": 3,
    "length": 8,
    "characters": "abcdefghijklmnopqrstuvwxyz0123456789",
    "replacement": true
  }
}

Generate UUIDs

json
{
  "name": "generateUUIDs",
  "arguments": {
    "n": 5
  }
}

Generate Gaussian Numbers

json
{
  "name": "generateGaussians",
  "arguments": {
    "n": 10,
    "mean": 0,
    "standardDeviation": 1,
    "significantDigits": 6
  }
}

Get Usage Statistics

json
{
  "name": "getUsage",
  "arguments": {}
}

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 code
  • npm start - Run the compiled server
  • npm run dev - Run in development mode with auto-reload
  • npm run clean - Clean the build directory

Project Structure

src/
├── index.ts           # Main entry point
├── server.ts          # MCP server implementation
├── randomOrgClient.ts # API client for random.org
├── rateLimiter.ts     # Rate limiting implementation
├── config.ts          # Configuration management
└── types.ts           # TypeScript type definitions

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. 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.

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "random-org": {
      "command": "npx",
      "args": [
        "random-org-mcp-server"
      ],
      "env": {
        "RANDOM_ORG_API_KEY": "your_api_key_here"
      }
    }
  }
}

Use Random.org MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Random.org is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Random.org as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Random.org MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "random-org": {
      "command": "npx",
      "args": [
        "-y",
        "random-org-mcp-server"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Random.org MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Random.org MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Random.org to help me with this task?
Random.org
Sure. I read it.
Here is what I found using Random.org.

Frequently asked questions

What is the Random.org MCP server used for?

Random.org is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Random.org MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Random.org with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Random.org MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Random.org connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Random.org MCP to TypingMind?

Random.org runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Random.org MCP provide in TypingMind?

Random.org exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Random.org MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Random.org requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇