npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

think-mcp-tool

v1.3.0

Published

An MCP server that provides a 'think' tool for structured reasoning, based on Anthropic's engineering research

Downloads

247

Readme

Think Tool MCP Server

npm version License: MIT

Implementation of Anthropic's "think" tool as an MCP server — Structured reasoning that dramatically improves AI performance, with a hard rule that forces deep analysis on any problem with ≥ 3 parallel items.

What's in this server?

Two tools, served over stdio:

  • think — a structured-reasoning scratchpad. The model pauses, organizes its thoughts in Markdown headings + lists, then proceeds. No side effects; no new information fetched. Each call returns a short structure diagnostic (recorded id, detected sections, warnings) instead of echoing the thought — a feedback loop the model can use to self-correct.
  • recall — revisit prior thoughts from the same session, ranked by keyword relevance, deduplicated, and budget-capped, so the model builds on earlier reasoning instead of repeating itself.

What's new in v1.3.0

think no longer echoes the full thought back — it returns a structure diagnostic instead (e.g. Thought #3 recorded (sections: Problem, Options, Decision). plus warnings for missing Verification, single-option tradeoffs, duplicates, or unstructured prose). Input schemas and the string return type are unchanged, but this is a semantic change in what think returns: workflows that fed the echoed thought text into later steps must adapt (the thought itself is already in the tool-call input; retrieve stored thoughts via recall). recall now ranks results by term relevance (headings weighted higher), deduplicates repeated thoughts, and truncates long entries/output to protect the context window.

What is the Think Tool?

This MCP server implements the "think" tool that Anthropic introduced in their engineering blog post. The Think Tool provides AI assistants with a dedicated space for structured reasoning during complex problem-solving tasks, enabling more thoughtful, accurate, and reliable responses.

Proven Performance Benefits

Anthropic's research demonstrates remarkable improvements when using the "think" tool:

  • 54% improvement in complex customer service tasks
  • Significantly better adherence to detailed policies and guidelines
  • Enhanced consistency across multiple trials of the same task
  • Improved performance on software engineering benchmarks
  • Minimal implementation overhead compared to other enhancement techniques

The "think" tool excels where other approaches fall short:

  • Better than extended thinking for cases requiring complex tool chains
  • More effective than baseline prompting for policy-heavy scenarios
  • Especially powerful when paired with optimized prompting

Quick Install

Via npm (Recommended)

npx think-mcp-tool

For Claude Desktop

Add to your Claude Desktop configuration:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "think-tool": {
      "command": "npx",
      "args": ["think-mcp-tool"]
    }
  }
}

For Cursor

Add to your Cursor MCP settings:

{
  "mcpServers": {
    "think-tool": {
      "command": "npx",
      "args": ["think-mcp-tool"]
    }
  }
}

For OpenCode

Add to your opencode.json:

{
  "mcp": {
    "think-tool": {
      "command": "npx",
      "args": ["think-mcp-tool"]
    }
  }
}

How It Works

The "think" tool implements the mechanism described in Anthropic's engineering blog. Unlike extended thinking (which happens before the AI starts responding), the "think" tool allows the AI to pause and reflect during its response generation. The tool performs no external actions and retrieves no new information — it provides a dedicated scratchpad to reason step-by-step, which materially improves performance on complex tasks.

Feedback loop and relevance-ranked recall (v1.3.0)

Every think call is analyzed on the fly: the server detects ## sections, hashes the content, and returns a compact diagnostic — Thought #N recorded (sections: …) plus warnings such as missing Verification, a single option is not a tradeoff, duplicate of Thought #N, or unstructured prose. The model reads the diagnostic and fills the flagged gaps on non-trivial problems. recall scores stored thoughts per query term (word-boundary hits > substring hits, heading hits doubled), drops duplicates keeping the newest copy, truncates entries over 1500 characters, and caps total output at 10000 characters so retrieval never floods the context.

Hard rule: think before acting on ≥ 3 items

This server ships with a mandatory trigger. The model must call think before acting when any of these hold:

  • ≥ 3 parallel items — options, candidates, files, fields, steps, search hits, errors (any countable set)
  • ≥ 3 affected code points — files, functions, call sites, config keys
  • A task that decomposes into ≥ 3 ordered steps

Counting rule: if unsure whether items are "parallel," trigger. Skipping this rule causes missed tradeoffs, missed call-site edits, and wrong step ordering. This rule is injected via the server's MCP instructions field and the think tool description, so any compliant client will see it automatically.

When else it helps (soft triggers)

Beyond the hard rule, think is valuable after non-trivial tool results, before writing or editing code, when verify fails (trace root cause), and before multi-file edits (plan order, gauge blast radius).

System Prompt for Optimal Results

Anthropic's research shows that combining the "think" tool with optimized prompting delivers the strongest performance improvements. This server already injects the prompt below via the MCP instructions field, so most clients (Claude Desktop, Cursor, OpenCode) pick it up automatically — if your client already surfaces MCP instructions, there is no need to paste this prompt again. Only if your client does not surface MCP instructions, paste this into your system prompt:

You have two structured-reasoning tools: think and recall.

## MUST think first (hard rule)

Call think before acting when ANY of these hold — no exceptions:
- ≥ 3 parallel items (options, candidates, files, fields, steps, search hits, errors)
- ≥ 3 affected code points (files, functions, call sites, config keys)
- Task decomposes into ≥ 3 ordered steps

Rule: count the items; ≥ 3 → trigger. When unsure if "parallel," trigger.

## Workflow

1. Complex task (≥ 3 items / multi-step / policy-heavy)?
2. recall first — check whether prior analysis already covers it.
3. think with structure (template below).
4. Read the returned diagnostic; fill flagged gaps if the problem is non-trivial.
5. Act.

## How to structure

Always Markdown headings + lists. No prose dumps. Template:

## Problem
One sentence.

## Constraints
- What's frozen
- Boundaries not to cross

## Options
1. Option A — one-line tradeoff
2. Option B — one-line tradeoff

## Decision
Which, and why.

## Verification
How to confirm correctness.

Skip irrelevant sections on simple problems. Core discipline: boxes, not mush.

## Anti-patterns

- Listing options without tradeoffs
- Deciding without Constraints
- Decision without Verification
- Re-thinking an already-analyzed problem (recall first)
- Stream-of-consciousness prose (no boxes, mush)

## When else to think (soft)

- After non-trivial tool results — assess before acting
- After search/API results — list findings, contradictions, next action
- Before writing/editing code — validate plan, list affected call sites
- Before execution — check each policy/constraint one by one
- When stuck or verify fails — trace root cause
- Before multi-file edits — plan order, gauge blast radius

## recall — revisit past thoughts

Use recall (short keyword queries like "constraint", "trade-off", "decision") to check if a problem was already analyzed, build on existing reasoning, or review the decision chain. Results are relevance-ranked and deduplicated.

Manual Installation

If you prefer to run the server locally from source:

  1. Clone the repository:

    git clone https://github.com/LeXwDeX/think-mcp-server.git
    cd think-mcp-server
  2. Install dependencies:

    npm install
  3. Build and run:

    npm run build
    npm start

Development

npm run dev    # Hot-reload development mode
npm run build  # Compile TypeScript
npm start      # Run compiled output

License

MIT License