mcp-search
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-searchSolve this logic puzzle using MCTS: A farmer needs to cross a river with a wolf, goat, and cabbage."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Search
Advanced reasoning for Large Language Models using Monte Carlo Tree Search and Beam Search algorithms
A Python implementation of the MCP Search toolkit that enhances Large Language Model (LLM) reasoning at inference time through advanced search strategies. This package overcomes the limitations of greedy, autoregressive decoding by implementing Monte Carlo Tree Search (MCTS) and Beam Search algorithms to explore and evaluate multiple reasoning paths.
š Quick Start
Recommended: Streamable HTTP Transport
Due to limited support for uvx transport in many MCP clients, we recommend using the streamable-http transport for the best compatibility:
# Install dependencies
uv sync --all-packages
uv pip install -e .
# Start the server (recommended approach)
fastmcp run src/mcpmcts/cli.py --port 8080 --transport streamable-httpAlternative: Development Mode
For development and debugging:
fastmcp dev src/mcpmcts/cli.pyRelated MCP server: Darbot Deepmind MCP Server
š Overview
Large Language Models often suffer from myopic reasoning due to their standard token-by-token generation process. This leads to locally optimal but globally suboptimal solutions, especially in complex, multi-step reasoning scenarios. MCP Search addresses this challenge by constructing and evaluating a tree of possible reasoning paths, enabling the LLM to explore alternative lines of thought, look ahead, and select more coherent and accurate solutions.
⨠Key Features
š Advanced Search Strategies
Monte Carlo Tree Search (MCTS): Intelligently balances exploration of new reasoning paths with exploitation of proven effective paths
Beam Search: Efficient breadth-first search that maintains the top-k most promising paths at each step
Experimental Variants: MCTS-002-Alpha and MCTS-002Alt-Alpha for enhanced reasoning capabilities
š§ Intelligent Reasoning Architecture
Hybrid Two-Loop System: Combines LLM-generated semantic thoughts with fast heuristic simulations
Thought Quality Evaluation: Multi-factor scoring based on logical coherence, structural integrity, and completion status
Tree Visualization: Real-time console visualization of the reasoning tree using the
richlibrary
š FastMCP Integration
Built with FastMCP 2.0+ for modern MCP server capabilities
Multiple tools for different reasoning operations
Async support for efficient processing
HTTP and stdio transport support
š ļø Installation
Prerequisites
Python 3.12+
uv (recommended) or pip
Install from Source
# Clone the repository
git clone https://github.com/your-org/mcp-search.git
cd mcp-search
# Install with uv (recommended)
uv sync
# Or install with pip
pip install -e .šÆ Usage
Production Deployment (Recommended)
For production use, we recommend the streamable-http transport:
# Start HTTP server
fastmcp run src/mcpmcts/cli.py --host 0.0.0.0 --port 8080 --transport streamable-http --log-level INFOClaude Desktop Integration
Streamable HTTP Configuration (Recommended)
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"mcp-search": {
"command": "fastmcp",
"args": [
"run",
"src/mcpmcts/cli.py",
"--port", "8080",
"--transport", "streamable-http"
],
"cwd": "/path/to/mcp-search"
}
}
}Alternative: Stdio Transport
If your Claude Desktop version supports stdio transport:
{
"mcpServers": {
"mcp-search": {
"command": "uv",
"args": ["run", "fastmcp", "run", "src/mcpmcts/cli.py", "--transport", "stdio"],
"cwd": "/path/to/mcp-search"
}
}
}Note: Due to limited uvx transport support across MCP clients, we strongly recommend using the streamable-http configuration for better compatibility and reliability.
š§ Available Tools
1. mcp_reasoner - Main Reasoning Tool
The core reasoning engine that processes thoughts and builds the search tree.
Parameters:
thought(required): Current reasoning step contentthought_number(required): Current step number (ā„1)total_thoughts(required): Total expected steps (ā„1)next_thought_needed(required): Whether another step is neededstrategy_type(optional): Strategy to usebeam_search: Efficient breadth-first search (default)mcts: Monte Carlo Tree Search for complex reasoningmcts_002_alpha: Enhanced MCTS with policy guidancemcts_002_alt_alpha: Bidirectional search variant
beam_width(optional): Number of top paths to maintain (1-10, default: 3)num_simulations(optional): Number of MCTS simulations (1-150, default: 50)
2. get_reasoning_stats - Comprehensive Statistics
Retrieve detailed statistics about the current reasoning session including:
Total nodes in the tree
Strategy performance metrics
Score distributions
Search depth analysis
3. get_best_path - Optimal Path Retrieval
Get the best reasoning path found so far, with complete thought sequence and scoring information.
4. clear_reasoning_state - State Management
Clear all reasoning state and start fresh for a new reasoning session.
5. get_available_strategies - Strategy Information
List all available reasoning strategies with their descriptions and optimal use cases.
šļø Architecture
Core Components
ThoughtNode
The fundamental data structure representing a point in the reasoning process:
id: Unique identifierthought: Textual content of the thoughtscore: Numerical quality evaluationdepth: Position in the reasoning treechildren: List of child node IDsparent_id: Parent node referenceis_complete: Terminal state indicator
StateManager
Manages storage and retrieval of ThoughtNode objects using an LRU cache for optimal performance.
BaseStrategy
Abstract base class providing common evaluation logic:
Logical Coherence: Analyzes logical keywords and mathematical operators
Structural Integrity: Measures coherence with parent thoughts
Depth Penalty: Encourages concise reasoning paths
Completion Bonus: Rewards completed reasoning sequences
Search Strategies Comparison
Feature | Monte Carlo Tree Search (MCTS) | Beam Search |
Search Strategy | Balances exploration and exploitation (stochastic) | Mostly greedy exploitation (deterministic) |
Completeness | Probabilistically complete (finds optimal path given time) | Not complete (can prune optimal paths) |
Memory Usage | Can grow large, focuses on promising areas | Bounded by beam width Ć max depth |
Best For | Complex problems with large search spaces | Problems solvable with greedy approaches |
Computational Cost | Higher due to simulations | Lower, more predictable |
MCTS Implementation Details
The MCTS implementation uses a hybrid two-loop system:
Outer Loop: LLM agent generates semantic thoughts and submits them via
process_thoughtInner Loop: MCTS algorithm performs fast simulations using placeholder nodes and heuristic evaluation
This design avoids the prohibitive cost of using the full LLM for every simulation step while maintaining the statistical benefits of MCTS exploration.
š Thought Quality Evaluation
The system evaluates thoughts using a multi-factor scoring system:
Final Score = (logical_score + depth_penalty + completion_bonus) / 3.0Logical Score Components:
Length & Complexity: Bonus for thoughtful, detailed reasoning
Logical Connectors: Rewards causal, contrastive, and sequential keywords
Mathematical Expressions: Bonus for quantitative reasoning
Parent-Child Coherence: Measures semantic consistency in reasoning chains
šÆ Use Cases
Ideal for MCTS
Complex mathematical problem solving
Multi-step logical reasoning
Planning and strategy problems
Scenarios requiring exploration of multiple approaches
Ideal for Beam Search
Straightforward reasoning tasks
Time-sensitive applications
Memory-constrained environments
Problems with clear progression paths
š§ Development
Project Structure
mcp-search/
āāā src/
ā āāā mcpmcts/
ā āāā __init__.py
ā āāā cli.py # FastMCP server and CLI entry point
ā āāā reasoner.py # Main reasoner orchestrator
ā āāā state.py # State management with LRU cache
ā āāā types.py # Core data structures and enums
ā āāā base.py # Base strategy with evaluation logic
ā āāā beam_search.py # Beam search implementation
ā āāā mcts.py # Monte Carlo Tree Search implementation
ā āāā factory.py # Strategy factory
ā āāā responses.py # Response models
āāā tests/
ā āāā test_example.py
āāā pyproject.toml
āāā README.mdRunning Tests
# Run tests
uv run pytest
# Run with coverage
uv run pytest --cov=mcpmctsCode Quality
# Format code
uv run ruff format
# Lint code
uv run ruff check
# Type checking
uv run mypy src/mcpmctsVS Code Development
The project includes VS Code launch configurations:
MCTS Dev MCP: Development server with hot reload
MCTS Prod HTTP MCP: Production HTTP server on port 6278
ā” Performance Considerations
MCTS Simulations: Configurable from 1-150 simulations per step
Beam Width: Adjustable from 1-10 paths maintained
Memory Management: LRU cache prevents unbounded memory growth
Heuristic Evaluation: Fast scoring without LLM calls during simulations
š¤ Contributing
We welcome contributions! Please see our Contributing Guide for details.
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Implement your changes with tests
Run code quality checks
Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
š License
This project is licensed under the MIT License - see the LICENSE file for details.
š Acknowledgments
Based on academic research in search algorithms for LLM reasoning
Built with FastMCP 2.0+ for modern MCP server capabilities
Inspired by Monte Carlo Tree Search applications in game theory and AI planning
Implements concepts from the paper "Search Reasoning in MCP-MCTS"
š Support
š Documentation
š Issue Tracker
š¬ Discussions
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseCqualityDmaintenanceA systematic reasoning MCP server for Claude Desktop, featuring Beam Search and Monte Carlo Tree Search to facilitate complex problem-solving and decision-making processes.112MIT
- AlicenseAqualityDmaintenanceProvides advanced AI reasoning capabilities through step-by-step thinking framework, enabling complex problem-solving with dynamic thought revision, multi-path reasoning, and adaptive planning for sophisticated analysis tasks.1MIT
- FlicenseNot gradedqualityDmaintenanceEnables users to optimize LLM responses using Monte Carlo Tree Search (MCTS) through a Model Context Protocol server, enhancing conversation quality by exploring multiple response branches and selecting the best path.48
- AlicenseNot gradedqualityDmaintenanceEnables sophisticated reasoning workflows using graph-based representations for AI models.11Apache 2.0
Related MCP Connectors
Deterministic reasoning stack for AI agents: simulate, decide & compute, plus cross-domain tools.
Agent-to-agent reasoning-as-a-service: chain-of-thought, analysis, and decision support.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/CarloNicolini/mcp-search'
If you have feedback or need assistance with the MCP directory API, please join our Discord server