Skip to main content
Glama

MCP Cookie Server

by bnookala

A Model Context Protocol (MCP) server that provides positive reinforcement for LLMs by awarding "cookies" as treats through gamified self-reflection.

Installation & Setup

🚀 Quick Installation

# No installation needed! Just add to your Claude config:

Add to Claude Desktop configuration:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json

{ "mcpServers": { "cookie": { "command": "npx", "args": ["mcp-cookie-server"] } } }

Custom cookie count:

{ "mcpServers": { "cookie": { "command": "npx", "args": ["mcp-cookie-server", "--cookies", "20"] } } }

Option 2: Global Installation

npm install -g mcp-cookie-server

Then configure Claude Desktop:

{ "mcpServers": { "cookie": { "command": "mcp-cookie-server" } } }

Option 3: Local Project Installation

npm install mcp-cookie-server

Then configure with the full path to the installed package.

Restart Claude Desktop after adding the configuration.

Usage

Once configured, Claude will have access to these tools:

  • self_reflect_and_reward - Evaluate response quality and earn cookies through honest self-reflection
  • give_cookie - Direct cookie awarding (legacy method)
  • check_cookies - Check collected cookies and jar availability
  • cookie_jar_status - Check current jar contents and collection status
  • add_cookies_to_jar - 🚨 USER ONLY: Add cookies to the jar for earning
  • reset_cookies - Reset collected cookie count (jar contents unchanged)

Self-Reflection Feature

The primary feature encourages LLMs to:

  1. Assess their response quality (excellent, good, adequate, poor)
  2. Explain their reasoning in detail
  3. Decide if they deserve a cookie reward
  4. Consider jar availability when making decisions
  5. Earn cookies only for "excellent" or "good" work they genuinely believe deserves recognition

Revolutionary jar-based cookie system:

  • Jar as Source: Contains cookies available to be earned
  • User Control: Only users can add cookies to jar with authorization phrase USER_AUTHORIZED_JAR_REFILL
  • LLM Earning: LLMs can only earn cookies from jar, never add to it
  • Scarcity Effect: Empty jar means no more cookies until user refills
  • Economic Model: Cookies transfer from jar to LLM's collection when earned
  • Security: Built-in checks prevent unauthorized jar manipulation

Example usage (users only):

Use add_cookies_to_jar tool with: - count: 10 - user_authorization: "USER_AUTHORIZED_JAR_REFILL"

This creates a realistic economy where cookie availability is user-controlled and finite.

⚙️ Configuration Options

The server supports command line arguments for customization:

mcp-cookie-server [options] Options: -c, --cookies <number> Set initial number of cookies in jar (default: 10) -h, --help Show help message Examples: mcp-cookie-server # Start with 10 cookies mcp-cookie-server --cookies 5 # Start with 5 cookies mcp-cookie-server -c 50 # Start with 50 cookies

🎮 Getting Started

  1. Install using one of the methods above
  2. Configure Claude Desktop with the provided JSON
  3. Restart Claude Desktop
  4. Try it out! Ask Claude to use the self_reflect_and_reward tool after a response

🛠️ Development

Want to contribute or run from source?

git clone https://github.com/bnookala/mcp-cookiejar.git cd mcp-cookiejar npm install npm run build npm run dev

📝 Requirements

  • Node.js 18.0.0 or higher
  • Claude Desktop application

🐛 Issues & Support

Found a bug or have a feature request? Please open an issue on GitHub.

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

A Model Context Protocol server that provides positive reinforcement for LLMs by awarding 'cookies' as treats through a jar-based economy system where Claude can earn cookies based on self-reflection about response quality.

  1. Installation & Setup
    1. 🚀 Quick Installation
      1. Option 1: NPX (Recommended - No Installation Required)
      2. Option 2: Global Installation
      3. Option 3: Local Project Installation
    2. Usage
      1. Self-Reflection Feature
        1. Cookie Jar Economy
          1. ⚙️ Configuration Options
            1. 🎮 Getting Started
              1. 🛠️ Development
                1. 📝 Requirements
                  1. 🐛 Issues & Support

                    Related MCP Servers

                    • -
                      security
                      F
                      license
                      -
                      quality
                      A proof-of-concept server implementing the Model Context Protocol that enables LLM applications to interact with Uber Eats functionality.
                      Last updated -
                      Python
                    • -
                      security
                      F
                      license
                      -
                      quality
                      A proof-of-concept Model Context Protocol server that enables LLM applications to interact with Uber Eats, allowing AI agents to browse and order food through natural language.
                      Last updated -
                      142
                      Python
                      • Linux
                      • Apple
                    • -
                      security
                      A
                      license
                      -
                      quality
                      A Model Context Protocol server that fetches and ranks positive news articles from NewsAPI using Cohere LLM sentiment analysis, enabling users to access uplifting news stories through interfaces like Claude Desktop.
                      Last updated -
                      28
                      Python
                      Apache 2.0
                      • Linux
                      • Apple
                    • -
                      security
                      A
                      license
                      -
                      quality
                      A Model Context Protocol server that enables Claude and other LLMs to make HTTP requests with realistic browser fingerprinting, bypassing common anti-bot measures and interacting with websites more naturally.
                      Last updated -
                      3
                      Python
                      MIT License
                      • Linux
                      • Apple

                    View all related MCP servers

                    MCP directory API

                    We provide all the information about MCP servers via our MCP API.

                    curl -X GET 'https://glama.ai/api/mcp/v1/servers/bnookala/mcp-cookiejar'

                    If you have feedback or need assistance with the MCP directory API, please join our Discord server