Skip to content

dotutils/ThinkTool

Repository files navigation

ThinkMCP Server

A Model Context Protocol (MCP) server providing the 'think' tool for model reasoning and thought logging.

Overview

This server implements a single tool called think that allows AI models to log their thoughts during complex reasoning processes. The tool is based on Anthropic's "think tool" specification and is designed to help models with:

  • Complex reasoning tasks
  • Multi-step problem solving
  • Policy adherence in conversation
  • Memory caching during long tool call chains

Features

  • ThinkTool: Logs model thoughts without changing state or obtaining new information
  • Dual Logging: Thoughts are logged both to the console (for MCP clients) and to persistent disk files
  • File Storage: Logs are stored in %temp%\think-mcp-logs\think-mcp-<timestamp>.log
  • MCP Compliant: Follows the Model Context Protocol specification

Tool Specification

think

  • Description: Use the tool to think about something. It will not obtain new information or change the database, but just append the thought to the log. Use it when complex reasoning or some cache memory is needed.
  • Parameters:
    • thought (string, required): A thought to think about.
  • Response: Simple echo of the thought in format "Thought: [thought]"

Installation and Usage

Prerequisites

  • .NET 8.0 or later
  • ModelContextProtocol NuGet package (preview)

Running the Server

cd ThinkMCP
dotnet run

The server will start and listen on stdin/stdout for MCP protocol messages.

Using with VS Code

To use this server with VS Code and Claude, you'll need to configure it in your MCP settings. The server expects to be launched via stdio transport.

Example configuration:

{
  "mcpServers": {
    "think": {
      "command": "dotnet",
      "args": ["run", "--project", "path/to/ThinkMCP/ThinkMCP.csproj"]
    }
  }
}

Testing

A test client is provided in the examples folder:

cd examples
dotnet run

This will:

  1. Connect to the ThinkMCP server
  2. List available tools
  3. Test the think tool with sample thoughts
  4. Display responses

Log Files

Thought logs are stored in:

  • Windows: %temp%\mcp\think\think-mcp-<timestamp>.log
  • Format: [timestamp LEVEL] message

Example log entry:

[2025-08-18 09:40:46 INF] Model thought: I need to analyze this complex problem step by step.

Example Usage

When a model uses the think tool:

Input:

{
  "name": "think",
  "arguments": {
    "thought": "I need to consider the edge cases before proceeding with this solution."
  }
}

Output:

{
  "content": [
    {
      "type": "text",
      "text": "Thought: I need to consider the edge cases before proceeding with this solution."
    }
  ]
}

Development

Project Structure

ThinkMCP/
├── ThinkMCP.csproj          # Main project file
├── Program.cs               # Server entry point and configuration
├── Tools/
│   └── ThinkTool.cs        # ThinkTool implementation
├── examples/
│   ├── TestClient.csproj    # Test client project
│   └── TestClient.cs       # Test client implementation
└── README.md               # This file

Building

dotnet build

Dependencies

  • ModelContextProtocol (preview)
  • Microsoft.Extensions.Hosting
  • Microsoft.Extensions.Logging
  • Serilog for file logging

License

This project is provided as a sample implementation for educational purposes.

About

MCP tool for encouraging and investigating LLM thinking

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published