Skip to main content
Glama
jimmcq

Lemonade Stand MCP Server

by jimmcq

๐Ÿ‹ 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.

What is MCP?

Model Context Protocol (MCP) is an open standard that enables AI models like Claude to interact with external data sources and tools. This server demonstrates how MCP works by implementing the classic Lemonade Stand game as a set of tools that Claude can use.

Related MCP server: MCP Tools

Features

  • ๐ŸŒค๏ธ Dynamic weather system affecting sales

  • ๐Ÿ’ฐ Business simulation with supply and demand

  • ๐Ÿ“Š Strategic pricing and inventory management

  • ๐Ÿ 14-day game cycle with profit tracking

  • ๐ŸŽฎ Fully playable through Claude Desktop

Prerequisites

Quick Start

  1. Clone this repository:

    git clone https://github.com/yourusername/Lemonade-Stand-MCP-Server.git
    cd Lemonade-Stand-MCP-Server
  2. Install dependencies:

    npm install
  3. Find your Claude Desktop configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

    • Windows: %APPDATA%\Claude\claude_desktop_config.json

  4. Configure Claude Desktop:

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

  6. You should now see a hammer icon in Claude Desktop, indicating the MCP server is connected!

Playing the Game

Once the server is connected, simply start a new chat with Claude and say:

"Play a complete game of Lemonade Stand using the MCP tools available."

Claude will then:

  1. Start a new game

  2. Analyze the weather conditions

  3. Make strategic decisions about supplies and pricing

  4. Report daily results

  5. Continue until Day 14 or your business fails

Game Mechanics

  • Weather System: Temperature and conditions affect customer traffic

  • Supply Chain: Buy cups, lemons, sugar, and ice at different prices

  • Price Strategy: Set your price per cup to balance profit and demand

  • Inventory Management: Ice melts daily; manage your supplies wisely

  • Customer Demand: Based on weather, price, and available inventory

Available Tools

The server exposes these MCP tools to Claude:

  • start_game: Begin a new game session

  • get_game_state: Check current status, money, inventory, and weather

  • buy_supplies: Purchase cups, lemons, sugar, and ice

  • set_price: Set the price per cup of lemonade

  • sell_lemonade: Open for business and see daily results

  • next_day: Advance to the next day

Configuration Examples

For WSL Users

{
  "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"
      ]
    }
  }
}

Using NPX

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

Troubleshooting

  1. No hammer icon in Claude Desktop:

    • Ensure Claude Desktop is up to date

    • Check that the configuration file path is correct

    • Verify Node.js is installed and accessible

    • Check Claude Desktop logs in:

      • Windows: %APPDATA%\Claude\logs\

      • macOS: ~/Library/Logs/Claude/

  2. Server connection error:

    • Verify the server path in your configuration is absolute

    • Test the server directly with node server.js

    • Check for any errors in the Claude Desktop logs

  3. WSL-specific issues:

    • Ensure Node.js is installed in WSL

    • Use the full path to the Node.js binary

    • Check WSL is properly installed and running

Development

To modify the server:

  1. Edit server.js to change game mechanics or add new tools

  2. Test locally with node server.js

  3. Restart Claude Desktop to load changes

Project Structure

Lemonade-Stand-MCP-Server/
โ”œโ”€โ”€ server.js              # Main MCP server implementation
โ”œโ”€โ”€ package.json           # Node.js dependencies
โ””โ”€โ”€ README.md             # This file

How It Works

This MCP server implements a simple game loop:

  1. The server maintains game state in memory

  2. Each tool represents a game action (buy, sell, etc.)

  3. When Claude calls a tool, the server updates the game state

  4. Results are returned to Claude as JSON

  5. Claude analyzes the results and decides the next action

This demonstrates how MCP can be used to create interactive experiences where AI models can maintain state, make decisions, and interact with complex systems.

Contributing

Feel free to open issues or submit pull requests if you have ideas for improvements or find bugs.

License

MIT


Built as an example of the Model Context Protocol in action.

Available Tools

5 tools
buy_suppliesC

Purchase supplies for the lemonade stand

ParametersJSON Schema
NameRequiredDescriptionDefault
gameIdYesThe game ID
cupsNoNumber of cups to buy
lemonsNoNumber of lemons to buy
sugarNoAmount of sugar to buy
iceNoAmount of ice to buy

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It implies a transactional action ('purchase') but doesn't disclose effects like cost, inventory changes, success conditions, or error handling, which are critical for a purchase tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste, clearly front-loading the core purpose. It's appropriately sized for the tool's complexity, making it easy to scan and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's transactional nature, lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like what happens post-purchase, error cases, or integration with sibling tools, leaving significant gaps for agent usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all parameters (gameId, cups, lemons, sugar, ice). The description adds no additional meaning beyond the schema, such as units for sugar/ice or purchase limits, meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('purchase') and resource ('supplies for the lemonade stand'), making the tool's purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'sell_lemonade' or 'set_price' beyond the obvious action difference, missing explicit distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description lacks context about prerequisites (e.g., needing a game started with 'start_game'), timing (e.g., before 'sell_lemonade'), or constraints, leaving usage unclear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

next_dayC

Advance to the next day

ParametersJSON Schema
NameRequiredDescriptionDefault
gameIdYesThe game ID

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Advance to the next day' implies a mutation (changing state), but it doesn't specify if this is reversible, has side effects (e.g., updates game state), requires permissions, or what happens upon execution. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with 'Advance to the next day'โ€”a single, clear sentence that front-loads the core action. There is no wasted verbiage or redundancy, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool likely mutates game state (inferred from siblings like 'start_game'), there are no annotations or output schema to clarify behavior. The description is too minimalโ€”it doesn't explain what 'advance' entails (e.g., updates time, triggers events) or the return value. For a mutation tool in a game context, this leaves critical gaps in understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter with 100% coverage (gameId is described as 'The game ID'), so the schema does the heavy lifting. The description doesn't add any parameter details beyond what the schema provides, but with only one parameter and high schema coverage, the baseline is high. It implies the tool operates on a game context, which aligns with the parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Advance to the next day' states a clear action (advance) and target (next day), but it's vague about what exactly gets advanced. It doesn't specify if this is for a game, simulation, or calendar, nor does it differentiate from siblings like 'start_game' or 'set_price'. The purpose is understandable but lacks specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., requires an active game), exclusions, or relationships with sibling tools like 'buy_supplies' or 'sell_lemonade'. Usage is implied only by the action itself, with no contextual instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sell_lemonadeD

Open for business and see today's results

ParametersJSON Schema
NameRequiredDescriptionDefault
gameIdYesThe game ID

TDQS

D1.9/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure but fails completely. It doesn't indicate whether this is a read or write operation, what side effects occur, what permissions are needed, or what the response contains. The metaphorical 'Open for business and see today's results' provides no concrete information about the tool's behavior beyond implying some kind of operational activity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

While brief, the description is under-specified rather than appropriately concise. The single metaphorical sentence doesn't earn its place by providing useful information. It's front-loaded with unhelpful figurative language rather than functional description. This isn't conciseness but rather insufficient content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a metaphorical description that provides no functional information, this description is completely inadequate. For a tool with one parameter but unknown behavioral characteristics and return values, the description fails to provide the minimal context needed for an agent to understand what the tool does and how to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no parameter information beyond what the schema provides. However, with 100% schema description coverage (the single parameter 'gameId' has a clear description), the baseline is 3. The description doesn't compensate for any gaps because there are none in the schema documentation, but it also doesn't add any value regarding parameter meaning or usage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Open for business and see today's results' is vague and metaphorical rather than stating a clear purpose. It suggests starting operations and viewing outcomes, but doesn't specify what resource is being manipulated or what specific action is performed. This is a tautology that restates the tool name 'sell_lemonade' in figurative language rather than providing functional clarity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus its siblings (buy_supplies, next_day, set_price, start_game). There's no mention of prerequisites, sequencing, or alternatives. The metaphorical language doesn't help an agent understand the tool's role in the workflow or when it's appropriate to invoke it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

set_priceC

Set the price per cup of lemonade

ParametersJSON Schema
NameRequiredDescriptionDefault
gameIdYesThe game ID
priceYesPrice per cup in dollars

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'Set the price per cup of lemonade,' which implies a mutation operation, but doesn't clarify permissions needed, whether the change is reversible, side effects (e.g., impacting sales in 'sell_lemonade'), or expected response format. This is inadequate for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with zero wasted words. It's front-loaded with the core action and resource, making it highly efficient and easy to parse. Every word earns its place without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's mutation nature, lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like side effects, error conditions, or how it integrates with sibling tools (e.g., 'sell_lemonade'). For a tool that likely affects game state, more context is needed for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with both parameters ('gameId' and 'price') clearly documented in the schema. The description adds no additional parameter semantics beyond what the schema provides (e.g., units, constraints, or examples). This meets the baseline for high schema coverage but doesn't enhance understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Set') and the target resource ('price per cup of lemonade'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'sell_lemonade' or 'next_day', which might also involve price-related operations in the lemonade stand context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an active game), exclusions, or how it relates to sibling tools like 'sell_lemonade' (which might depend on the price set). This leaves the agent with insufficient context for optimal tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

start_gameB

Start a new lemonade stand game

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('Start') but doesn't reveal whether this initializes a new game state, resets existing progress, requires any preconditions, or what happens upon invocation (e.g., default settings, initial resources). For a mutation tool with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose with zero wasted words. It's appropriately sized for a zero-parameter tool and front-loads the essential information without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (zero parameters, no output schema), the description is minimally complete but lacks context about what 'starting' entails behaviorally. Without annotations or output schema, the description should ideally clarify the result (e.g., initial game state) or preconditions, but it only states the action, leaving gaps for a mutation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and schema description coverage is 100% (though trivial since there are no parameters). The description doesn't need to compensate for any parameter documentation gaps. It appropriately doesn't mention parameters, earning a high baseline score for parameter semantics in this context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Start') and resource ('a new lemonade stand game'), making the purpose immediately understandable. It distinguishes this from siblings like 'buy_supplies' or 'sell_lemonade' by focusing on game initialization rather than gameplay actions. However, it doesn't specify what 'starting' entails (e.g., initializing state, resetting progress), keeping it from a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't indicate whether this should be called once at the beginning of a session, whether it can be called multiple times to restart, or how it relates to sibling tools like 'next_day' for progression. Without any usage context, the agent must infer appropriate timing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updates
    • First observedbuy_supplies
    • First observednext_day
    • First observedsell_lemonade
    • First observedset_price
    • First observedstart_game

TDQS

B3.1/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: buying supplies, advancing time, selling lemonade, setting price, and starting the game. An agent can easily distinguish between these core gameplay actions without confusion.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern (e.g., buy_supplies, set_price, start_game). The naming is uniform throughout, using snake_case and clear action-oriented verbs that align with the lemonade stand simulation domain.

Tool Count5/5

With 5 tools, this is well-scoped for a lemonade stand game simulation. Each tool serves a specific, essential function (setup, resource management, time progression, sales, pricing), and there are no extraneous or missing tools for this domain.

Completeness4/5

The toolset covers the core lifecycle of a lemonade stand game: starting, buying supplies, setting price, selling, and advancing days. A minor gap is the lack of tools for viewing game state (e.g., checking inventory or finances), but agents can work around this by tracking results from sell_lemonade.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers