Bayesian Monte Carlo Tree Search MCP server

Provides a Bayesian Monte Carlo Tree Search engine for systematic exploration of different angles and interpretations, balancing exploration versus exploitation through probabilistic approaches that evolve through multiple iterations.
Back to servers
Provider
angrysky56
Release date
Apr 28, 2025
Language
Python
Stats
3 stars

The MCTS MCP Server provides an Advanced Bayesian Monte Carlo Tree Search engine for AI-assisted analysis and reasoning. It uses probabilistic algorithms to systematically explore different angles and interpretations of topics or questions, producing insightful analyses that evolve through multiple iterations.

Installation

To install the MCTS MCP Server, follow these steps:

  1. Clone the repository to your local machine
  2. Ensure you have Python 3.10 or higher installed
  3. Run the setup script:
./setup.sh

This script will:

  • Install UV (Astral UV) if not already installed
  • Create a virtual environment with UV
  • Install the required packages
  • Create the necessary state directory

If you prefer manual setup, use:

# Install UV if not already installed
curl -fsSL https://astral.sh/uv/install.sh | bash

# Create and activate a virtual environment
uv venv .venv
source .venv/bin/activate

# Install dependencies
uv pip install -r requirements.txt

Claude Desktop Integration

To integrate with Claude Desktop:

  1. Copy the contents of claude_desktop_config.json from the repository
  2. Add it to your Claude Desktop configuration (typically at ~/.claude/claude_desktop_config.json)
  3. Create the file if it doesn't exist yet
  4. Restart Claude Desktop

Example configuration:

{
  "mcpServers": {
    "MCTSServer": {
      "command": "uv",
      "args": [
        "run",
        "--directory", "/home/ty/Repositories/ai_workspace/mcts-mcp-server/src/mcts_mcp_server",
        "server.py"
      ],
      "env": {
        "PYTHONPATH": "/home/ty/Repositories/ai_workspace/mcts-mcp-server"
      }
    }
  }
}

Important: Update the paths to match the location of the MCTS MCP server on your system.

Using the MCTS Server

Core MCTS Tools

The server provides several key functions to use in your prompts:

list_ollama_models()  # Check what models are available
set_ollama_model("cogito:latest")  # Set the model you want to use
initialize_mcts(question="Your question here", chat_id="unique_id")  # Initialize analysis
run_mcts(iterations=1, simulations_per_iteration=5)  # Run the analysis

Note: After running run_mcts(), the process can take several minutes to hours to complete. During this time, you can discuss ideas or ask questions while waiting for the process to finish.

Analysis Tools

Once the MCTS process is complete, you can use these tools to analyze the results:

# Get a summary of MCTS results
generate_synthesis()

# View current configuration
get_config()

# Update configuration parameters
update_config()

# Check current status
get_mcts_status()

Browsing and Analysis Functions

# List recent MCTS runs
list_mcts_runs(count=10, model=None)

# Get details about a specific run
get_mcts_run_details('cogito:latest_1745979984')

# Extract key insights
get_mcts_insights(run_id='cogito:latest_1745979984')

# Generate a comprehensive report
get_mcts_report(run_id='cogito:latest_1745979984', format='markdown')

# Compare multiple runs
compare_mcts_runs(['cogito:latest_1745979984', 'qwen3:0.6b_1745979584'])

Ollama Integration

The server supports integration with Ollama models:

# List available models
list_ollama_models()

# Set a specific model
set_ollama_model("qwen3:0.6b")

# Compare performance across models
run_model_comparison(question="Your question", iterations=2)

Customizing MCTS Parameters

You can adjust the MCTS algorithm behavior by updating its configuration:

  • max_iterations: Number of MCTS iterations to run
  • simulations_per_iteration: Number of simulations per iteration
  • exploration_weight: Controls exploration vs. exploitation balance
  • early_stopping: Whether to stop early if a high-quality solution is found
  • use_bayesian_evaluation: Whether to use Bayesian evaluation for node scores
  • use_thompson_sampling: Whether to use Thompson sampling for selection

Example Usage Flow

  1. Initialize a new analysis:

    initialize_mcts(question="What are the implications of artificial intelligence on human creativity?", chat_id="creativity_analysis")
    
  2. Run the MCTS process:

    run_mcts(iterations=3, simulations_per_iteration=10)
    
  3. Generate a summary of findings:

    generate_synthesis()
    
  4. Extract insights:

    get_mcts_insights(run_id='your_run_id')
    
  5. Generate a detailed report:

    get_mcts_report(run_id='your_run_id', format='markdown')
    

The MCTS server stores all results automatically in /home/ty/Repositories/ai_workspace/mcts-mcp-server/results, organized by model name and run ID.

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

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

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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