random-mcp-server

ManuelAlejandroMartinezFlores/random-mcp-server

3.2

If you are the rightful owner of random-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Model Context Protocol (MCP) server is a specialized server designed to handle and manage model context protocols, facilitating communication and data exchange between different systems and models.

random-mcp-server

This MCP server gives LLM the tools to use random number generators. Here are the available tools:

  β€’ random_random_int: Generate random integer between min and max (inclusive)
  β€’ random_random_float: Generate random float between min and max
  β€’ random_random_choice: Pick random item(s) from a list

Here are some example use cases

πŸ’¬ You: choose three random items from [a,b,c,d,e,f,g,h]
πŸ€” Assistant: πŸ”§ Executing random_random_choice...
The three random items are: **f, d, c**.

πŸ’¬ You: throw a dice and give me the result
πŸ€” Assistant: πŸ”§ Executing random_random_int...
You rolled a **4**!

πŸ’¬ You: give me a random probability
πŸ€” Assistant: πŸ”§ Executing random_random_float...
Here’s a random probability: **0.8593**

To use this, clone this repository, then add the dependencies, it is recommended to use uv. Then, you can use Anthropic's SDK with the following configuration:

{
    "command": "uv",
    "args": [
        "run", "--directory", "/PATH/TO/REPO",
        "/PATH/TO/REPO/mcp_http_bridge.py",
        "https://random-number-mcp-server.manuelalejandromartinezf.workers.dev"
    ]
}

If one wants to request function calls without the SDK, one can use for example

curl -X POST https://random-number-mcp-server.manuelalejandromartinezf.workers.dev \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": {"name": "random_choice", "arguments": {"choices": ["A", "B", "C"], "count": 2}}}'

that gets the output

{"jsonrpc": "2.0", "id": 2, "result": {"content": [{"type": "text", "text": "Random choices: A, B"}]}}