Ice Cream MCP
This is a minimal Model Context Protocol (MCP) server that showcases how to build MCP tools with elicitation capabilities
Installation
npx ice-cream-mcpAsk AI about Ice Cream MCP
Powered by Claude Β· Grounded in docs
I know everything about Ice Cream MCP. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Ice Cream Topping Recommender MCP Server
π¦ A Demonstration Repository for MCP Elicitation
This is a minimal Model Context Protocol (MCP) server that showcases how to build MCP tools with elicitation capabilities. It serves as a practical learning resource for developers interested in creating interactive MCP servers that can prompt users for input when needed.
What This Demo Shows
This repository demonstrates several key MCP development patterns:
- π Elicitation (Interactive Input): The tool prompts users for missing parameters using schema-driven UI
- β Input Validation: Type-safe validation using Zod schemas with helpful error messages
- ποΈ Modular Architecture: Clean separation between server setup, tool registration, and business logic
- π οΈ Production Patterns: Proper error handling, logging, and TypeScript configuration
- π Client Integration: Ready-to-use configuration for VS Code and Claude Desktop
The Core Feature
The server exposes a single tool: ice_cream_topping_recommender that recommends toppings based on ice cream flavours (vanilla, strawberry, or chocolate). When you invoke the tool without specifying a flavour, it demonstrates MCP's elicitation capability by prompting you to select one.
Example interaction:
π€ Tool called without flavour parameter
π Prompts: "Which ice cream flavour do you want toppings for?"
π€ User selects: "vanilla"
π¦ Response: "For vanilla ice cream, the best toppings are: caramel sauce, rainbow sprinkles, crushed cookies."
Quick Start
-
Install dependencies and build:
yarn install yarn build -
Run the server:
yarn start -
Integration with MCP clients:
- VS Code: The server auto-configures via
.vscode/mcp.json - Claude Desktop: Add the server to your MCP configuration
- VS Code: The server auto-configures via
Project Structure
ice-cream-mcp/
βββ src/
β βββ index.ts # Entry point & server bootstrap
β βββ server/
β βββ McpServer.ts # Complete MCP server implementation
βββ .vscode/
β βββ mcp.json # VS Code MCP integration
βββ package.json # Dependencies & scripts
βββ tsconfig.json # TypeScript configuration
Key Learning Points
1. Elicitation Pattern
See how the tool handles missing input by prompting users with a schema-driven interface:
if (!flavour && elicitInput) {
const result = await elicitInput({
message: "Which ice cream flavour do you want toppings for?",
requestedSchema: {
type: "object",
properties: {
flavour: {
type: "string",
enum: ["vanilla", "strawberry", "chocolate"]
}
}
}
});
}
2. Modular Tool Architecture
Tools follow a consistent interface pattern:
getName(): Unique identifiergetDescription(): Human-readable descriptiongetInputSchema(): Zod validation schemaexecute(args, elicitInput?): Main logic with elicitation support
3. Type Safety
All input is validated using Zod schemas before processing, ensuring robust error handling and clear user feedback.
Technical Details
- Language: TypeScript with ESM modules
- MCP SDK:
@modelcontextprotocol/sdkv1.15.1 - Validation: Zod schemas for input validation
- Transport: stdio (standard input/output)
- Integration: VS Code MCP extension, Claude Desktop
Blog Post
π Read the detailed blog post about this implementation β
Next Steps
- Clone this repository to explore the code
- Modify the tool to add new flavours or different recommendation logic
- Use this as a template for building your own MCP servers with elicitation
- Check out the detailed blog post (link above) for implementation insights
Perfect for: Developers learning MCP, building interactive tools, or wanting to understand elicitation patterns.
License
This project is licensed under the MIT License - see the LICENSE file for details.
