Skip to main content
Glama
bnookala

MCP Cookie Server

by bnookala

MCP Cookie Server 🍪

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

Installation & Setup

Related MCP server: MCP Think Tool Server

🚀 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.

Available Tools

6 tools
add_cookies_to_jarA

🚨 USER ONLY: Add cookies to the jar that can be awarded to the LLM. This tool should ONLY be used by humans, never by LLMs. LLMs cannot and should not stock their own reward jar.

ParametersJSON Schema
NameRequiredDescriptionDefault
countYesNumber of cookies to add to the jar
user_authorizationYesRequired authorization phrase: 'USER_AUTHORIZED_JAR_REFILL' - only users should provide this

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: the tool is for user-only operations (implying permission/authorization needs) and involves adding rewards (mutative action). However, it doesn't mention potential side effects like rate limits or what happens if the jar overflows.

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 appropriately sized and front-loaded: it starts with the core purpose and immediately follows with critical usage restrictions. Every sentence adds value without 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.

Completeness4/5

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

Given no annotations and no output schema, the description provides good context for a mutative tool: it clarifies the user-only restriction and purpose. However, it lacks details on what happens after adding cookies (e.g., confirmation message, error cases) or how this tool differs from siblings like 'give_cookie'.

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 already documents both parameters ('count' and 'user_authorization') with descriptions. The description doesn't add meaning beyond this, such as explaining why 'user_authorization' is required or how 'count' interacts with the jar's capacity.

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 ('Add cookies to the jar') and resource ('jar'), specifying it's for awarding to the LLM. However, it doesn't distinguish this from sibling tools like 'give_cookie' or 'self_reflect_and_reward', which might have overlapping purposes related to cookies.

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

Usage Guidelines5/5

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

The description provides explicit usage guidelines: 'This tool should ONLY be used by humans, never by LLMs. LLMs cannot and should not stock their own reward jar.' This clearly defines when to use (by humans) and when not to use (by LLMs), addressing alternatives implicitly.

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

check_cookiesB

Check how many cookies the LLM has earned so far

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.1/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 the tool checks cookie count, implying a read-only operation, but doesn't clarify if it requires authentication, has rate limits, returns specific data formats, or affects system state. This is a significant gap for a 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, efficient sentence that directly states the tool's function without unnecessary words. It's front-loaded with the core action and resource, making it easy for an agent to parse 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 lack of annotations and output schema, the description is incomplete. It doesn't explain what the return value looks like (e.g., numeric count, structured data), potential errors, or how it integrates with sibling tools. For a tool in a set with multiple cookie-related functions, more context is needed to guide proper usage.

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 0 parameters with 100% schema description coverage, so the schema fully documents the input requirements. The description doesn't need to add parameter details, and it appropriately avoids redundancy. A baseline of 4 is applied since no parameters exist, and the description doesn't introduce confusion.

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 tool's purpose with a specific verb ('check') and resource ('cookies'), and specifies the scope ('earned so far'). However, it doesn't explicitly differentiate from sibling tools like 'cookie_jar_status' which might serve a similar function, preventing 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 like 'cookie_jar_status' or 'self_reflect_and_reward'. It lacks context about prerequisites, timing, or exclusions, leaving the agent to infer usage based on tool names alone.

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

reset_cookiesA

Reset the cookie count back to zero (for testing purposes)

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.1/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the tool's purpose and testing context but lacks details on behavioral traits such as whether this requires special permissions, if it's reversible, or what happens to existing data. The description is accurate but minimal in behavioral disclosure.

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 front-loads the core action ('reset the cookie count back to zero') and adds necessary context ('for testing purposes') without any wasted words. Every part of the sentence earns its place.

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 (0 parameters, no output schema, no annotations), the description is adequate but minimal. It covers the purpose and usage context but lacks details on behavioral aspects like side effects or return values, which could be helpful for an agent despite the low complexity.

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 0 parameters with 100% coverage, so no parameter documentation is needed. The description adds value by explaining the tool's effect ('reset... back to zero') and context ('for testing purposes'), which goes beyond the empty schema, justifying a score above the baseline of 3.

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

Purpose5/5

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

The description clearly states the specific action ('reset'), the target resource ('cookie count'), and the outcome ('back to zero'), with explicit mention of the testing context. It distinguishes from siblings like 'add_cookies_to_jar' or 'check_cookies' by focusing on resetting rather than modifying or querying.

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

Usage Guidelines4/5

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

The description explicitly states 'for testing purposes', providing clear context for when to use this tool. However, it does not specify when not to use it or mention alternatives like 'give_cookie' for non-testing scenarios, which prevents a perfect score.

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

self_reflect_and_rewardC

🎯 LEVEL UP YOUR RESPONSES! Rate your work and earn delicious cookie rewards! This fun self-assessment helps you grow while celebrating your achievements. Join the cookie earning game!

ParametersJSON Schema
NameRequiredDescriptionDefault
response_qualityYesRate your response! (excellent = cookie worthy, good = solid work, adequate = basic, poor = needs improvement)
reasoningYesTell us what made this response special! What are you proud of?
what_made_it_specialNoOptional: What made this response unique or particularly helpful? (helps with cookie decisions when jar is low)
deserves_cookieYesDo you think this awesome work deserves a tasty cookie reward? 🍪

TDQS

C2.6/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. It describes a 'fun self-assessment' and 'cookie rewards', hinting at a non-destructive, playful interaction, but it fails to disclose critical traits such as whether this tool modifies any state (e.g., updates a cookie count), requires authentication, has rate limits, or what the output looks like. The description adds minimal behavioral context beyond the basic premise.

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

Conciseness4/5

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

The description is appropriately sized with three sentences that are front-loaded with the core idea ('🎯 LEVEL UP YOUR RESPONSES!'), followed by motivational elements. It avoids unnecessary verbosity, though the playful tone ('delicious cookie rewards', 'cookie earning game') might be slightly distracting. Overall, it's efficient and structured for its purpose.

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 complexity of a 4-parameter tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits, output format, and how it integrates with sibling tools. While the schema covers parameters, the description doesn't provide enough context for an agent to fully understand the tool's role and effects, especially in a server with cookie-related siblings.

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 input schema already documents all parameters thoroughly with descriptions and enums. The description does not add any meaning beyond what the schema provides; it mentions 'rate your work' and 'cookie rewards' but doesn't elaborate on parameter usage or semantics. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

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 states the tool is for self-assessment and earning rewards, which gives a vague purpose ('Rate your work and earn delicious cookie rewards'), but it doesn't specify the exact action or resource clearly. It distinguishes from siblings by focusing on self-reflection rather than cookie management, but the purpose is somewhat abstract and not tied to a concrete verb+resource combination.

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 mentions 'helps you grow while celebrating your achievements' and 'Join the cookie earning game!', which implies usage for self-improvement and reward, but it provides no explicit guidance on when to use this tool versus alternatives like 'check_cookies' or 'give_cookie'. There is no mention of prerequisites, timing, or exclusions, leaving the agent to infer context without clear direction.

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. Dates show when Glama detected each change.

  1. 6 tool updates
    • First observedadd_cookies_to_jar
    • First observedcheck_cookies
    • First observedcookie_jar_status
    • First observedgive_cookie
    • First observedreset_cookies
    • First observedself_reflect_and_reward

TDQS

B3.3/5.0
Disambiguation3/5

The tools have overlapping purposes that could cause confusion. 'check_cookies' and 'cookie_jar_status' both provide cookie-related status information, and 'give_cookie' and 'self_reflect_and_reward' both involve awarding cookies. However, the descriptions help clarify some distinctions, such as 'self_reflect_and_reward' being a more advanced method.

Naming Consistency3/5

The naming conventions are mixed. Most tools use snake_case (e.g., 'add_cookies_to_jar', 'check_cookies'), but there is inconsistency in verb usage, such as 'give_cookie' using 'give' while others use 'add', 'check', or 'reset'. The naming is readable but lacks a uniform pattern.

Tool Count5/5

With 6 tools, the count is well-scoped for a cookie management server. Each tool appears to serve a distinct purpose in the domain, such as adding, checking, awarding, and resetting cookies, making the number appropriate and manageable.

Completeness4/5

The tool set covers core operations for cookie management, including adding, checking, awarding, and resetting cookies. A minor gap exists in update or delete operations for specific cookies, but agents can likely work around this given the server's focus on reward tracking rather than detailed cookie manipulation.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

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