Skip to main content
Glama

Think Tool MCP Server

by PhillipRt
server.ts1.09 kB
import { FastMCP, UserError } from "fastmcp"; import { z } from "zod"; // Create a new MCP server const server = new FastMCP({ name: "Think Tool Server", version: "1.0.0", }); // Add the "think" tool server.addTool({ name: "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: z.object({ thought: z.string().describe("A thought to think about.") }), execute: async (args, { log }) => { // Log the thought (this will be visible in the server logs but not to the user) log.info("Thinking process", { thought: args.thought }); // Simply return the thought itself, as per Anthropic's blog post return args.thought; }, }); // Start the server with stdio transport server.start({ transportType: "stdio", }); // Use console.error instead of console.log - this writes to stderr which won't interfere with the protocol console.error("Think Tool Server is running...");

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/PhillipRt/think-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server