Cover image
servidor de mCP de número aleatorio
Public

servidor de mCP de número aleatorio

Try Now
2025-03-26

3 years

Works with Finder

1

Github Watches

0

Github Forks

0

Github Stars

Random Number MCP Server

This project implements a simple Model Context Protocol (MCP) server that provides a tool to generate random numbers using the random.org API.

Overview

This server demonstrates the basic concepts of MCP, including:

  • Setting up an MCP server.
  • Defining and implementing tools.
  • Integrating with an external API.
  • Configuring the server for use with MCP clients.

Prerequisites

  • Node.js and npm installed.
  • An MCP client such as the Claude desktop app.

Project Setup

  1. Clone the repository:
    git clone [repository_url]
    cd [project_directory]
    
  2. Install dependencies:
    npm install
    

API

The server uses the random.org API to generate true random numbers. No API key is required for basic usage.

MCP Server Implementation

The server is implemented in index.ts and uses the @modelcontextprotocol/sdk to handle MCP communication.

Tool: get_random_number

This tool retrieves a random integer from the random.org API.

Input Parameters:

  • max (optional): An integer specifying the maximum value (inclusive) of the random number. Defaults to 100.

Output:

  • A string containing the random number.

Server Configuration

The server is configured through the cline_mcp_settings.json file. You need to add an entry for this server, specifying the command to run it:

{
  "mcpServers": {
    "random-number": {
      "command": "node",
      "args": ["[path/to/index.js]"],
      "env": {}
    }
  }
}

Replace [path/to/index.js] with the actual path to the compiled index.js file (usually in a build or dist directory after running npm run build).

Running the Server

  1. Build the server
    npm run build
    
  2. Start the server (this is typically done automatically by the MCP client after configuration).

Usage

Once the server is running and configured, you can use the get_random_number tool through your MCP client.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • huahuayu
  • Una puerta de enlace de API unificada para integrar múltiples API de explorador de blockchain similar a Esterscan con soporte de protocolo de contexto modelo (MCP) para asistentes de IA.

  • deemkeen
  • Controle su MBOT2 con un combo de potencia: MQTT+MCP+LLM

  • jae-jae
  • Servidor MCP para obtener contenido de la página web con el navegador sin cabeza de dramaturgo.

    Reviews

    4 (1)
    Avatar
    user_MVhYg62K
    2025-04-17

    The random-number-mcp-server by ysd-rysn is a remarkable tool that adds efficiency and reliability to my projects. Its seamless integration and easy setup make it a standout in the field. I've had no issues with performance, and the random number generation is both fast and accurate. Highly recommend checking it out on GitHub: https://github.com/ysd-rysn/random-number-mcp-server. It's a must-have for anyone needing random number generation in their applications.