🍋 Lemonade Stand MCP Server

🍋 Lemonade Stand MCP Server

访问网站

A simple, working example of a Model Context Protocol (MCP) server that lets you play the classic Lemonade Stand game through Claude Desktop.

什么是 MCP?

模型上下文协议 (MCP) 是一项开放标准,它使像 Claude 这样的 AI 模型能够与外部数据源和工具进行交互。此服务器通过将经典的 Lemonade Stand 游戏实现为 Claude 可以使用的一组工具来演示 MCP 的工作原理。

特征

  • 🌤️ 动态天气系统影响销售
  • 💰 供需商业模拟
  • 📊 战略定价和库存管理
  • 🏁 14天游戏周期,带利润追踪
  • 🎮 可通过 Claude Desktop 完全播放

先决条件

快速入门

  1. 克隆此存储库:

    git clone https://github.com/yourusername/Lemonade-Stand-MCP-Server.git
    cd Lemonade-Stand-MCP-Server
     
  2. 安装依赖项:

    npm install
     
  3. 找到您的 Claude Desktop 配置文件:

    • macOS 系统~/Library/Application Support/Claude/claude_desktop_config.json
    • 窗户%APPDATA%\Claude\claude_desktop_config.json
  4. 配置Claude桌面:

    {
      "mcpServers": {
        "lemonade-stand": {
          "command": "node",
          "args": [
            "/absolute/path/to/Lemonade-Stand-MCP-Server/server.js"
          ]
        }
      }
    }
     
  5. 重启Claude桌面

  6. 您现在应该在 Claude Desktop 中看到一个锤子图标,表示 MCP 服务器已连接!

玩游戏

一旦服务器连接成功,只需与 Claude 开始新的聊天并说:

“使用可用的 MCP 工具玩完整的 Lemonade Stand 游戏。”

克劳德随后会:

  1. 开始新游戏
  2. 分析天气状况
  3. 就供应和定价做出战略决策
  4. 报告每日结果
  5. 坚持到第 14 天,否则你的生意就会失败

游戏机制

  • 天气系统:温度和天气状况影响客流量
  • 供应链:以不同的价格购买杯子、柠檬、糖和冰
  • 价格策略:设定每杯价格以平衡利润和需求
  • 库存管理:冰每天都会融化;明智地管理你的供应
  • 客户需求:基于天气、价格和可用库存

可用工具

服务器向 Claude 公开了以下 MCP 工具:

  • start_game:开始新的游戏
  • get_game_state:检查当前状态、金钱、库存和天气
  • buy_supplies:购买杯子、柠檬、糖和冰
  • set_price:设定每杯柠檬水的价格
  • sell_lemonade:开业并查看每日结果
  • next_day:前进到下一天

配置示例

对于 WSL 用户

{
  "mcpServers": {
    "lemonade-stand": {
      "command": "wsl.exe",
      "args": [
        "/home/username/.nvm/versions/node/v20.11.1/bin/node",
        "/home/username/projects/Lemonade-Stand-MCP-Server/server.js"
      ]
    }
  }
}
 

使用 NPX

{
  "mcpServers": {
    "lemonade-stand": {
      "command": "npx",
      "args": [
        "/path/to/Lemonade-Stand-MCP-Server/server.js"
      ]
    }
  }
}
 

故障排除

  1. 克劳德桌面上没有锤子图标

    • 确保 Claude Desktop 是最新的
    • 检查配置文件路径是否正确
    • 验证 Node.js 是否已安装并可访问
    • 检查 Claude Desktop 登录:
      • 视窗:%APPDATA%\Claude\logs\
      • macOS:~/Library/Logs/Claude/
  2. 服务器连接错误

    • 验证配置中的服务器路径是否是绝对路径
    • 直接使用以下方式测试服务器node server.js
    • 检查 Claude Desktop 日志中是否有任何错误
  3. WSL 特定问题

    • 确保在 WSL 中安装了 Node.js
    • 使用 Node.js 二进制文件的完整路径
    • 检查 WSL 是否正确安装并正在运行

发展

修改服务器:

  1. 编辑server.js以更改游戏机制或添加新工具
  2. 使用以下方式进行本地测试node server.js
  3. 重新启动 Claude Desktop 以加载更改

项目结构

Lemonade-Stand-MCP-Server/
├── server.js              # Main MCP server implementation
├── package.json           # Node.js dependencies
└── README.md             # This file
 

工作原理

该 MCP 服务器实现了一个简单的游戏循环:

  1. 服务器在内存中维护游戏状态
  2. 每个工具代表一个游戏动作(购买、出售等)
  3. 当Claude调用工具时,服务器会更新游戏状态
  4. 结果以 JSON 格式返回给 Claude
  5. Claude分析结果并决定下一步行动

这展示了如何使用 MCP 来创建交互式体验,其中 AI 模型可以维持状态、做出决策并与复杂系统交互。

相关推荐

SoColoring

SoColoring

<div class="post-content leading-8 text-[#242424] post-content text-lg space-y-7 mt-8">SoColoring是一个AI驱动的平台,它允许用户通过简单的文本输入来创建个性化的涂色页。这个平台特别适合儿童和教育工作者,因为它能够激发孩子们的绘画兴趣,同时提供一种寓教于乐的方式。SoColoring利用人工智能技术,将文本转换为可打印的涂色图案,极大地简化了传统涂色页的制作过程。产品背景信息显示,SoColoring在2024年保留所有权利,并且提供了多种语言选项,包括中文。价格方面,用户可以访问定价页面了解更多详情。</div> <div class="mt-8"> <div class="flex flex-col gap-2" dir="ltr" data-orientation="horizontal" data-slot="tabs"> <div class="bg-muted text-muted-foreground w-fit items-center justify-center rounded-lg p-[3px] flex md:flex-row flex-wrap h-auto px-2" tabindex="0" role="tablist" aria-orientation="horizontal" data-slot="tabs-list" data-orientation="horizontal"> </div> <div id="radix-«R2sfetlb»-content-website-screenshot" class="flex-1 outline-none" tabindex="0" role="tabpanel" data-state="active" data-orientation="horizontal" aria-labelledby="radix-«R2sfetlb»-trigger-website-screenshot" data-slot="tabs-content"> <div class="relative group"> <div class="p-5 z-10 bg-gradient-img rounded-lg mb-8 md:h-[480px] h-64"> <div class="relative overflow-hidden object-cover w-full h-full rounded-lg border-surface-100 border transition-transform duration-300 ease-in-out transform group-hover:scale-101"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://img.medsci.cn/aisite/tinymce/2025/05/21/1747868906_7xJ0UMZVv6.jpg"></div> </div> </div> </div> </div> </div> <div> <div class="grid grid-cols-1 md:grid-cols-1 gap-4"> <div class="mt-8"> </div> </div> </div>

mcPixelmonServer

mcPixelmonServer

Testing-of-FakePixelPe-Mcpe-Server

Testing-of-FakePixelPe-Mcpe-Server

I am Abinanda and I am Main Head of The project so I am Trying to make a Server like Hypixel in Mcpe With Private and Public+Paid Plugins

mcPixelmonServer

mcPixelmonServer

Mirror of

Video Editor MCP server

Video Editor MCP server

MCP Interface for Video Jungle

YouTube Music MCP Server

YouTube Music MCP Server

This is a MCP (Model Context Protocol) server that you can use with Cline through Visual Studio Code and ask songs to be played using Youtube Music

Meme MCP Server

Meme MCP Server

A simple Model Context Protocol (MCP) server for generating memes using the ImgFlip API

dice-server MCP Server

dice-server MCP Server

MCPet

MCPet

This is a TypeScript-based Model Context Protocol (MCP) server that implements a virtual pet simulation system. It demonstrates core MCP concepts by providing tools for pet care and interaction.

Model Context Protocol - Dad Jokes MCP Server

Model Context Protocol - Dad Jokes MCP Server

MCP Server Package

mcp-musicplayer-netease

mcp-musicplayer-netease

free to search and play online music from netease

Minesweeper MCP Server

Minesweeper MCP Server

An MCP server for playing Minesweeper

Minecraft MCP Server

Minecraft MCP Server

A Minecraft MCP Server powered by Mineflayer API. It allows to control a Minecraft character in real-time, allowing AI assistants to build structures, explore the world, and interact with the game environment through natural language instruction

Minecraft

Minecraft

🕹️ Welcome to the Minesweeper MCP Server

🕹️ Welcome to the Minesweeper MCP Server

An MCP server for playing Minesweeper

Minesweeper MCP Server 🚀

Minesweeper MCP Server 🚀

An MCP server for playing Minesweeper

🧨 Minesweeper MCP Server 🕹️

🧨 Minesweeper MCP Server 🕹️

An MCP server for playing Minesweeper

MCP Server for Playing Minesweeper 🕹️

MCP Server for Playing Minesweeper 🕹️

An MCP server for playing Minesweeper