TH

Think MCP Server: Agent Reasoning with Think-Tools

Enhance agent reasoning on your MCP server by integrating think-tools from Anthropic for smarter, context-aware decision making.

Quick Install
npx -y @Rai220/think-mcp

Overview

Think MCP Server integrates Anthropic’s think-tools into an MCP (Model Context Protocol) server to provide agents with richer, context-aware tool use. It exposes a standard MCP-compatible HTTP interface that agent frameworks can query to discover available tools, retrieve contextual information, and invoke tool actions with structured inputs and outputs. The result is more reliable agent reasoning because tools are described and executed with predictable schemas, provenance, and execution metadata.

This server is useful when you want to enable tool-augmented LLM agents in a controlled, discoverable way. Instead of embedding ad-hoc tool calls in prompts, an MCP server provides a central, versioned registry of tools and contextual memory that agents can consult at runtime. Think-tools supplies well-defined tool adapters (search, calculator, code-runner, memory, etc.), and the MCP server publishes them to agents while handling authentication, sandboxing, and result serialization.

Features

  • Exposes an MCP-compatible HTTP API for tool discovery and invocation
  • Integrates Anthropic think-tools adapters for structured tool interfaces
  • Context provisioning: attach conversation- or user-scoped context to tool calls
  • Tool metadata, versions, and capability descriptions for safe planning
  • Execution metadata (timestamps, provenance, execution logs)
  • Optional sandboxed execution for code and shell tools
  • Simple plugin/adapter model to add custom tools

Installation / Configuration

Clone the repository, install dependencies, and start the server:

git clone https://github.com/Rai220/think-mcp.git
cd think-mcp
# install (Node.js example)
npm install
npm run start

Environment variables (example):

export MCP_PORT=8080
export THINK_TOOLS_API_KEY="sk-xxxxx"   # if using hosted think-tools services
export MCP_HOST="0.0.0.0"

Docker (build + run):

docker build -t think-mcp .
docker run -p 8080:8080 \
  -e THINK_TOOLS_API_KEY="sk-xxxxx" \
  -e MCP_PORT=8080 \
  think-mcp

Configuration file example (config.json):

{
  "port": 8080,
  "host": "0.0.0.0",
  "tools": {
    "web_search": { "type": "think-tools/web_search", "enabled": true },
    "calculator": { "type": "think-tools/calculator", "enabled": true },
    "python_runner": { "type": "think-tools/python", "enabled": false }
  },
  "auth": {
    "api_key_required": true,
    "allowed_keys": ["agent-key-1", "agent-key-2"]
  }
}

Start with a custom config:

node ./bin/server.js --config ./config.json

Available Tools / Resources

Think MCP Server bundles common think-tools adapters out of the box; exact list depends on your installation and config. Typical tools include:

  • web_search — structured web search and summarization
  • calculator — numeric expressions and simple math
  • python_runner — sandboxed Python execution for small code snippets
  • shell — restricted shell executor (use with care; configurable sandbox)
  • memory_store — read/write contextual memory for agents
  • file_store — upload/download artifacts used by agents
  • http_request — make HTTP requests with sanitized inputs

Each tool is published with metadata: name, description, input schema, output schema, and allowed roles. The MCP GET /tools endpoint returns this registry for agent consumption.

API (Quick Reference)

Common endpoints (MCP-compatible):

  • GET /info — server metadata and version
  • GET /tools — list available tools and schemas
  • POST /call — invoke a tool
  • GET /context?scope=conversation — retrieve contextual data
  • POST /context — write/update context or memory

Example tool invocation:

POST /call
Content-Type: application/json
Authorization: Bearer agent-key-1

{
  "tool": "calculator",
  "input": { "expression": "12 * (3 + 4)" },
  "context": { "conversation_id": "abc123" }
}

Response:

{
  "tool": "calculator",
  "output": { "result": 84 },
  "metadata": { "exec_ms": 12, "timestamp": "2026-04-01T12:00:00Z" }
}

Use Cases

  • Research assistants: Agents call web_search for up-to-date facts, then summarize results into conversation memory via memory_store. The MCP server ensures consistent schemas and records provenance.
  • Code generation + execution: An agent uses a code tool (python_runner) to run generated snippets in a sandboxed environment and uses the output to iteratively refine results.
  • Workflow automation: Multiple agents coordinate via shared context (conversation or task memory). The MCP server manages context lifecycle, preventing race conditions and providing audit logs.
  • Safe tool usage: By exposing tool capabilities and input validation, developers can enforce allowed operations (e.g., disable shell access in production, enable web requests only to whitelisted domains).
  • Plugin development: Add custom adapters (e.g., CRM lookup, internal DB query) and register them with the server so agents can discover and call them without changing agent code.

Getting Started Tips

  • Start with read-only tools (search, calculator) to validate the agent flow before enabling execution tools.
  • Use API keys and role-based tool enablement to limit access per agent or environment.
  • Enable execution logging and provenance in development to debug plan/tool interactions.
  • Use the tool schema to build deterministic prompts: prefer structured inputs over free-text tool calls.

This MCP server is designed to make tool-augmented agent reasoning predictable, auditable, and safe by combining the MCP discovery protocol with think-tools’ structured adapters.

Tags:ai-ml