Gemini Thinking MCP server

Integrates with Google's Gemini API to provide analytical thinking capabilities for complex problem-solving, codebase analysis, and architectural decision-making in software development contexts.
Back to servers
Setup instructions
Provider
bartekke8it56w2
Release date
Mar 02, 2025
Language
TypeScript
Stats
19 stars

The Model Context Protocol (MCP) Gemini Thinking Server integrates with Google's Gemini API to provide analytical thinking capabilities. This specialized server breaks down complex problems into sequential steps, helps with planning and analysis, and adapts to problems where the full scope may not be initially clear.

Getting Started

Installation

Follow these steps to install and set up the Gemini Thinking Server:

# Clone the repository
git clone <repository-url>

# Install dependencies
npm install

# Build the project
npm run build

Environment Configuration

Before running the server, you need to configure your Gemini API key:

export GEMINI_API_KEY=your_api_key_here

Starting the Server

Once configured, you can start the server with:

node dist/gemini-index.js

Using the Gemini Thinking Server

Tool Parameters

The geminithinking tool accepts various parameters to control the thinking process:

Required parameters:

  • query: The question or problem to analyze
  • thoughtNumber: Current thought step number
  • totalThoughts: Estimated total thoughts needed
  • nextThoughtNeeded: Boolean indicating if another thought step is needed

Optional parameters:

  • context: Additional context information
  • approach: Suggested approach to the problem
  • previousThoughts: Array of previous thoughts for context
  • thought: Your current thinking step (if empty, will be generated by Gemini)
  • isRevision: Whether this revises previous thinking
  • revisesThought: Which thought is being reconsidered
  • branchFromThought: Branching point thought number
  • branchId: Branch identifier
  • needsMoreThoughts: If more thoughts are needed

Basic Example

Here's a simple example request to analyze an urban transportation system:

{
  "query": "How might we design a sustainable urban transportation system?",
  "context": "The city has 500,000 residents and currently relies heavily on personal vehicles.",
  "approach": "Consider environmental, economic, and social factors.",
  "thoughtNumber": 1,
  "totalThoughts": 5,
  "nextThoughtNeeded": true
}

Response Format

The server responds with a structured JSON object containing:

{
  "thought": "The generated thought from Gemini",
  "thoughtNumber": 1,
  "totalThoughts": 5,
  "nextThoughtNeeded": true,
  "branches": [],
  "thoughtHistoryLength": 1,
  "metaComments": "Meta-commentary about the reasoning",
  "confidenceLevel": 0.85,
  "alternativePaths": ["Alternative approach 1", "Alternative approach 2"]
}

Session Management

The server supports saving and resuming analysis sessions with these commands:

Saving a Session

{
  "sessionCommand": "save",
  "sessionPath": "/path/to/save/session.json",
  "query": "dummy",
  "thoughtNumber": 1,
  "totalThoughts": 1,
  "nextThoughtNeeded": false
}

Loading a Session

{
  "sessionCommand": "load",
  "sessionPath": "/path/to/load/session.json",
  "query": "dummy",
  "thoughtNumber": 1,
  "totalThoughts": 1,
  "nextThoughtNeeded": false
}

Getting Session State

{
  "sessionCommand": "getState",
  "query": "dummy",
  "thoughtNumber": 1,
  "totalThoughts": 1,
  "nextThoughtNeeded": false
}

Example Clients

The server includes several example clients that demonstrate different use cases:

# Run the session example
node dist/session-example.js

# Run the advanced filtering example
node dist/advanced-filtering-example.js

Other available examples include:

  • Basic client example (sample-client.js)
  • Specific usage example (example-usage.js)
  • Codebase analysis example (codebase-analysis-example.js)

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "geminithinking" '{"command":"node","args":["dist/gemini-index.js"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "geminithinking": {
            "command": "node",
            "args": [
                "dist/gemini-index.js"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "geminithinking": {
            "command": "node",
            "args": [
                "dist/gemini-index.js"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later