
MCP Rand
提供随机数生成实用程序,包括由 Node 的 crypto 模块驱动的安全 UUID 生成器。
Tools
roll_dice
Roll a set of dice using standard dice notation (e.g., "2d6" for two six-sided dice, "3d6+5" for three six-sided dice plus 5)
generate_uuid
Generate a random UUID v4
generate_random_number
Generate a random number within a specified range
generate_gaussian
Generate a random number following a Gaussian (normal) distribution between 0 and 1
generate_string
Generate a random string with specified length and character set
draw_cards
Draw cards from a standard deck of playing cards
generate_password
Generate a strong password with a mix of character types. WARNING: While this password is generated locally on your machine, it is recommended to use a dedicated password manager for generating and storing passwords securely.
README
MCP Rand
一个模型上下文协议 (MCP) 服务器,提供各种随机生成实用程序,包括 UUID、数字、字符串、密码、高斯分布、掷骰子和抽牌。
<a href="https://glama.ai/mcp/servers/ccd6b0hni8"><img width="380" height="200" src="https://glama.ai/mcp/servers/ccd6b0hni8/badge" alt="Rand MCP server" /></a>
安装
npm install mcp-rand
或者全局安装:
npm install -g mcp-rand
功能
UUID 生成器
- 生成 RFC 4122 版本 4 UUID
- 使用 Node 的原生 crypto 模块进行安全随机生成
- 无需参数
随机数生成器
- 在指定范围内生成随机数
- 可配置最小值和最大值(包含)
- 如果未提供参数,则默认为 0-100 范围
高斯随机数生成器
- 生成服从高斯(正态)分布的随机数
- 归一化到 0-1 范围
- 无需参数
随机字符串生成器
- 生成具有可配置长度和字符集的随机字符串
- 支持多种字符集:
- 字母数字(默认):A-Z、a-z、0-9
- 数字:0-9
- 小写:a-z
- 大写:A-Z
- 特殊:!@#$%^&*()_+-=[]{};'"\|,.<>/?
- 可配置字符串长度(默认为 10)
密码生成器
- 生成包含多种字符类型的强密码
- 确保每种类型(大写、小写、数字、特殊)至少包含一个字符
- 可配置长度(最小 8,默认 16)
- 警告:虽然密码是在本地生成的,但建议使用专用的密码管理器
掷骰子
- 使用标准骰子表示法掷多个骰子
- 支持诸如 "2d6"(两个六面骰子)、"1d20"(一个二十面骰子)之类的表示法
- 返回每组骰子的单独掷骰结果和总和
- 可以一次掷多个不同的骰子组(例如,"2d6"、"1d20"、"4d4")
抽牌器
- 从标准的 52 张牌的牌组中抽牌
- 使用 base64 编码维护抽牌之间的牌组状态
- 返回抽出的牌和剩余的牌组状态
- 支持抽取任意数量的牌,最多可抽取到牌组大小
- 在每次抽牌之前正确地洗牌可用的牌
用法
作为 CLI 工具
npx mcp-rand
与 MCP 客户端集成
添加到您的 MCP 客户端配置:
{
"mcpServers": {
"mcp-rand": {
"command": "node",
"args": ["path/to/mcp-rand/build/index.js"],
"disabled": false,
"alwaysAllow": []
}
}
}
使用示例
// 生成 UUID
const uuid = await client.callTool('generate_uuid', {});
console.log(uuid); // 例如,"550e8400-e29b-41d4-a716-446655440000"
// 生成随机数
const number = await client.callTool('generate_random_number', {
min: 1,
max: 100
});
console.log(number); // 例如,42
// 生成高斯随机数
const gaussian = await client.callTool('generate_gaussian', {});
console.log(gaussian); // 例如,0.6827
// 生成随机字符串
const string = await client.callTool('generate_string', {
length: 15,
charset: 'alphanumeric'
});
console.log(string); // 例如,"aB9cD8eF7gH6iJ5"
// 生成密码
const password = await client.callTool('generate_password', {
length: 20
});
console.log(password); // 例如,"aB9#cD8$eF7@gH6*iJ5"
// 掷骰子
const rolls = await client.callTool('roll_dice', {
dice: ['2d6', '1d20', '4d4']
});
console.log(rolls);
/* 输出示例:
[
{
"dice": "2d6",
"rolls": [3, 1],
"total": 4
},
{
"dice": "1d20",
"rolls": [4],
"total": 4
},
{
"dice": "4d4",
"rolls": [2, 3, 2, 3],
"total": 10
}
]
*/
// 抽牌
const draw1 = await client.callTool('draw_cards', {
count: 5
});
console.log(draw1);
/* 输出示例:
{
"drawnCards": [
{ "suit": "hearts", "value": "A" },
{ "suit": "diamonds", "value": "7" },
{ "suit": "clubs", "value": "K" },
{ "suit": "spades", "value": "2" },
{ "suit": "hearts", "value": "10" }
],
"remainingCount": 47,
"deckState": "t//+///bDw=="
}
*/
// 使用之前的牌组状态抽取更多牌
const draw2 = await client.callTool('draw_cards', {
count: 3,
deckState: draw1.deckState
});
console.log(draw2);
/* 输出示例:
{
"drawnCards": [
{ "suit": "diamonds", "value": "Q" },
{ "suit": "clubs", "value": "5" },
{ "suit": "spades", "value": "J" }
],
"remainingCount": 44,
"deckState": "l//+//zbDw=="
}
*/
贡献
请参阅 CONTRIBUTING.md 了解开发设置和指南。
许可证
ISC
推荐服务器
AIO-MCP Server
🚀 集成了 AI 搜索、RAG 和多服务(GitLab/Jira/Confluence/YouTube)的一体化 MCP 服务器,旨在增强 AI 驱动的开发工作流程。来自 Folk。
Knowledge Graph Memory Server
为 Claude 实现持久性记忆,使用本地知识图谱,允许 AI 记住用户的信息,并可在自定义位置存储,跨对话保持记忆。
https://github.com/Streen9/react-mcp
react-mcp 与 Claude Desktop 集成,能够根据用户提示创建和修改 React 应用程序。

any-chat-completions-mcp
将 Claude 与任何 OpenAI SDK 兼容的聊天完成 API 集成 - OpenAI、Perplexity、Groq、xAI、PyroPrompts 等。
Exa MCP Server
一个模型上下文协议服务器,它使像 Claude 这样的人工智能助手能够以安全和受控的方式,使用 Exa AI 搜索 API 执行实时网络搜索。
AI 图像生成服务
可以用于 Cursor 集成 MCP 服务器。
MCP Web Research Server
一个模型上下文协议服务器,使 Claude 能够通过集成 Google 搜索、提取网页内容和捕获屏幕截图来进行网络研究。
MySQL MCP Server
允许人工智能助手通过受控界面列出表格、读取数据和执行 SQL 查询,从而使数据库探索和分析更安全、更有条理。
browser-use MCP server
一个由人工智能驱动的浏览器自动化服务器,它实现了模型上下文协议,从而能够使用自然语言控制网页浏览器,以执行诸如导航、表单填写和视觉交互等任务。
mcp-codex-keeper
作为开发知识的守护者,为 AI 助手提供精心策划的最新文档和最佳实践访问权限。