MCP Scratchpad Server
An MCP (Model Context Protocol) server that provides a "think" tool for structured reasoning, based on the Anthropic blog post.
Overview
The Scratchpad MCP server allows Claude and other LLMs to add dedicated thinking steps during complex tool use scenarios. This improves problem-solving by creating space for structured reasoning and helps the model carefully process tool call outputs.
Features
- Think Tool: Add thoughts to a timestamped log for structured reasoning
- Thoughts Log Resource: View all logged thoughts in JSON format
- Clear Tool: Reset the thinking log when needed
- Structured Thinking Prompt: Template for systematic problem-solving
Installation
Prerequisites
- Python 3.11 or higher
uv
package manager (recommended)
Setup
- Clone or download this repository
- Install dependencies:
Usage
Testing with MCP Inspector
Run the server in development mode:
This opens the MCP Inspector where you can:
- Test the
think
tool - View the thoughts log resource
- Clear the log
- Try the structured thinking prompt
Installing in Claude Desktop
Install the server for use with Claude:
Tools
think
Add a thinking step to the log.
Parameters:
thought
(string): The thought to log
Example:
clear_thoughts
Clear all thoughts from the log.
No parameters required
Resources
log://thoughts
Returns all logged thoughts as a JSON array with timestamps.
Example output:
Prompts
Structured Thinking
A template for systematic problem-solving using the think tool.
Parameters:
topic
(string): The topic or problem to think through
Use Cases
The scratchpad tool is particularly useful for:
- Long chains of tool calls: Keep track of intermediate results and reasoning
- Complex problem-solving: Break down problems systematically
- Policy-heavy environments: Verify compliance with guidelines
- Sequential decision making: Document the reasoning process
- Edge case handling: Think through unusual scenarios
Example Workflow
- Start with a complex problem
- Use the "Structured Thinking" prompt to set up the approach
- Use the
think
tool multiple times to log reasoning steps - Check progress with the
log://thoughts
resource - Clear the log when starting a new problem
Best Practices
- Use descriptive thoughts that explain the "why" not just the "what"
- Break complex problems into smaller, manageable parts
- Validate reasoning at each step
- Summarize conclusions at the end
- Clear the log between unrelated tasks
Development
To modify the server:
- Edit
scratchpad_server.py
- Test changes with
uv run mcp dev scratchpad_server.py
- Reinstall in Claude Desktop if needed
Future Enhancements
Potential improvements:
- Persist thoughts to a file
- Add search/filter capabilities
- Support for thought categories or tags
- Export thoughts in different formats
- Integration with other reasoning tools
This server cannot be installed
Provides a 'think' tool that allows Claude and other LLMs to add dedicated thinking steps during complex tool use scenarios, creating space for structured reasoning and improving problem-solving capabilities.
Related MCP Servers
- -securityAlicense-qualityAn MCP server that implements the 'think' tool, providing Claude with a dedicated space for structured thinking during complex problem-solving tasks to improve reasoning capabilities.Last updated -48PythonMIT License
- AsecurityFlicenseAqualityOfficial implementation of Anthropic's 'think' tool that provides Claude with a dedicated space for structured reasoning, improving performance by up to 54% on complex tasks requiring multi-step problem solving.Last updated -152537TypeScript
- AsecurityAlicenseAqualityImplements Anthropic's 'think' tool for Claude, providing a dedicated space for structured reasoning during complex problem-solving tasks that improves performance in reasoning chains and policy adherence.Last updated -41055JavaScriptMIT License
- -securityAlicense-qualityEnables Claude's explicit thinking mode in Cursor, allowing users to see Claude's step-by-step reasoning process when prefacing queries with 'think'.Last updated -1JavaScriptMIT License