MCTS MCP Server

Integrations

  • Enables integration with Ollama's local models to run MCTS analysis, allowing model selection, comparison between different Ollama models, and storing results organized by model name.

MCTS MCP 서버

AI 지원 분석 및 추론을 위한 고급 베이지안 몬테카를로 트리 탐색(MCTS) 엔진을 제공하는 모델 컨텍스트 프로토콜(MCP) 서버입니다.

개요

이 MCP 서버를 통해 Claude는 몬테카를로 트리 탐색(MCTS) 알고리즘을 사용하여 주제, 질문 또는 텍스트 입력에 대한 심층적이고 탐색적인 분석을 수행할 수 있습니다. MCTS 알고리즘은 베이지안 접근법을 사용하여 다양한 관점과 해석을 체계적으로 탐색하여 여러 번의 반복을 통해 진화하는 통찰력 있는 분석을 생성합니다.

특징

  • 베이지안 MCTS : 분석 중 탐색과 활용의 균형을 맞추기 위해 확률적 접근 방식을 사용합니다.
  • 다중 반복 분석 : 반복 당 여러 시뮬레이션을 통해 여러 번의 사고 반복을 지원합니다.
  • 상태 지속성 : 동일한 채팅에서 턴 사이의 주요 결과, 부적합한 접근 방식 및 사전 정보를 기억합니다.
  • 접근 분류법 : 생성된 사고를 다양한 철학적 접근 방식과 계열로 분류합니다.
  • 톰슨 샘플링 : 노드 선택을 위해 톰슨 샘플링이나 UCT를 사용할 수 있습니다.
  • 놀라운 감지 : 놀라운 또는 새로운 분석 방향을 식별합니다.
  • 의도 분류 : 사용자가 새로운 분석을 시작하거나 이전 분석을 계속하려는 시점을 파악합니다.

용법

서버는 아래에 자세히 설명된 LLM에 대한 다양한 도구를 시스템 프롬프트에 복사하여 붙여넣을 수 있는 형식으로 제공합니다.

Claude에게 주제나 질문에 대한 심층 분석을 요청하면, Claude는 MCTS 알고리즘과 분석 도구를 사용하여 다양한 각도에서 자동으로 분석을 수행합니다.

작동 원리

MCTS MCP 서버는 LLM을 직접 호출하는 대신 로컬 추론 방식을 사용합니다. 이는 MCP 프로토콜과 호환되는데, 이 프로토콜은 도구가 AI 모델을 직접 호출하는 것이 아니라, 클로드와 같은 AI 비서가 도구를 호출하도록 설계되었습니다.

Claude가 서버에 분석을 요청하면 서버는 다음을 수행합니다.

  1. 질문으로 MCTS 시스템을 초기화합니다.
  2. MCTS 알고리즘을 사용하여 탐색의 여러 반복을 실행합니다.
  3. 다양한 분석 작업에 대한 결정론적 응답을 생성합니다.
  4. 검색 중에 발견된 최상의 분석을 반환합니다.

설치

저장소를 복제합니다.

이 설정은 pip보다 더 빠른 대안으로 종속성 해결을 개선한 UV(Astral UV)를 사용합니다.

  1. Python 3.10 이상이 설치되어 있는지 확인하세요.
  2. 설치 스크립트를 실행합니다.

지엑스피1

이렇게 하면:

  • UV가 아직 설치되지 않았다면 설치하세요
  • UV로 가상 환경 만들기
  • UV를 사용하여 필요한 패키지를 설치하세요
  • 필요한 상태 디렉토리를 만듭니다.

또는 다음을 수동으로 설정할 수 있습니다.

# 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 데스크톱 통합

Claude Desktop과 통합하려면:

  1. 이 저장소에서 claude_desktop_config.json 의 내용을 복사하세요.
  2. Claude Desktop 구성에 추가하세요(일반적으로 ~/.claude/claude_desktop_config.json 에 위치)
  3. 아직 구성 파일이 없으면 해당 파일을 만들고 이 프로젝트의 claude_desktop_config.json 에서 콘텐츠를 추가하세요.
  4. Claude Desktop을 다시 시작하세요

구성 예:

{ "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" } } } }

시스템의 MCTS MCP 서버 위치와 일치하도록 경로를 업데이트해야 합니다 .

Ollama 통합을 포함한 제안된 시스템 프롬프트 및 업데이트된 도구, 즉 프로젝트 지침에 다음 블록을 넣으세요:


MCTS server and usage instructions: MCTS server and usage instructions: 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 After run_mcts is called it can take wuite a long time ie minutes to hours - so you may discuss any ideas or questions or await user confirmation of the process finishing, - then proceed to synthesis and analysis tools on resumption of chat. ## MCTS-MCP Tools Overview ### Core MCTS Tools: - `initialize_mcts`: Start a new MCTS analysis with a specific question - `run_mcts`: Run the MCTS algorithm for a set number of iterations/simulations - `generate_synthesis`: Generate a final summary of the MCTS results - `get_config`: View current MCTS configuration parameters - `update_config`: Update MCTS configuration parameters - `get_mcts_status`: Check the current status of the MCTS system Default configuration prioritizes speed and exploration, but you can customize parameters like exploration_weight, beta_prior_alpha/beta, surprise_threshold. ## Configuration You can customize the MCTS parameters in the config dictionary or through Claude's `update_config` tool. Key parameters include: - `max_iterations`: Number of MCTS iterations to run - `simulations_per_iteration`: Number of simulations per iteration - `exploration_weight`: Controls exploration vs. exploitation balance (in UCT) - `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 Articulating Specific Pathways: Delving into the best_path nodes (using mcts_instance.get_best_path_nodes() if you have the instance) and examining the sequence of thought and content at each step can provide a fascinating micro-narrative of how the core insight evolved. Visualizing the tree (even a simplified version based on export_tree_summary) could also be illuminating and I will try to set up this feature. Modifying Parameters: This is a great way to test the robustness of the finding or explore different "cognitive biases" of the system. Increasing Exploration Weight: Might lead to more diverse, less obviously connected ideas. Decreasing Exploration Weight: Might lead to deeper refinement of the initial dominant pathways. Changing Priors (if Bayesian): You could bias the system towards certain approaches (e.g., increase alpha for 'pragmatic') to see how it influences the outcome. More Iterations/Simulations: Would allow for potentially deeper convergence or exploration of more niche pathways. ### Ollama Integration Tools: - `list_ollama_models`: Show all available local Ollama models - `set_ollama_model`: Select which Ollama model to use for MCTS - `run_model_comparison`: Run the same MCTS process across multiple models ### Results Collection: - Automatically stores results in `/home/ty/Repositories/ai_workspace/mcts-mcp-server/results` - Organizes by model name and run ID - Stores metrics, progress info, and final outputs # MCTS Analysis Tools This extension adds powerful analysis tools to the MCTS-MCP Server, making it easy to extract insights and understand results from your MCTS runs. The MCTS Analysis Tools provide a suite of integrated functions to: 1. List and browse MCTS runs 2. Extract key concepts, arguments, and conclusions 3. Generate comprehensive reports 4. Compare results across different runs 5. Suggest improvements for better performance ## Available Run Analysis Tools ### Browsing and Basic Information - `list_mcts_runs(count=10, model=None)`: List recent MCTS runs with key metadata - `get_mcts_run_details(run_id)`: Get detailed information about a specific run - `get_mcts_solution(run_id)`: Get the best solution from a run ### Analysis and Insights - `analyze_mcts_run(run_id)`: Perform a comprehensive analysis of a run - `get_mcts_insights(run_id, max_insights=5)`: Extract key insights from a run - `extract_mcts_conclusions(run_id)`: Extract conclusions from a run - `suggest_mcts_improvements(run_id)`: Get suggestions for improvement ### Reporting and Comparison - `get_mcts_report(run_id, format='markdown')`: Generate a comprehensive report (formats: 'markdown', 'text', 'html') - `get_best_mcts_runs(count=5, min_score=7.0)`: Get the best runs based on score - `compare_mcts_runs(run_ids)`: Compare multiple runs to identify similarities and differences ## Usage Examples # To list your recent MCTS runs: list_mcts_runs() # To get details about a specific run: get_mcts_run_details('cogito:latest_1745979984') ### Extracting Insights # To get key insights from a run: get_mcts_insights(run_id='cogito:latest_1745979984') ### Generating Reports # To generate a comprehensive markdown report: get_mcts_report(run_id='cogito:latest_1745979984', format='markdown') ### Improving Results # To get suggestions for improving a run: suggest_mcts_improvements(run_id='cogito:latest_1745979984') ### Comparing Runs To compare multiple runs: compare_mcts_runs(['cogito:latest_1745979984', 'qwen3:0.6b_1745979584']) ## Understanding the Results The analysis tools extract several key elements from MCTS runs: 1. **Key Concepts**: The core ideas and frameworks in the analysis 2. **Arguments For/Against**: The primary arguments on both sides of a question 3. **Conclusions**: The synthesized conclusions or insights from the analysis 4. **Tags**: Automatically generated topic tags from the content ## Troubleshooting If you encounter any issues with the analysis tools: 1. Check that your MCTS run completed successfully (status: "completed") 2. Verify that the run ID you're using exists and is correct 3. Try listing all runs to see what's available: `list_mcts_runs()` 4. Make sure the `.best_solution.txt` file exists in the run's directory ## Advanced Example Usage ### Customizing Reports You can generate reports in different formats: # Generate a markdown report report = get_mcts_report(run_id='cogito:latest_1745979984', format='markdown') # Generate a text report report = get_mcts_report(run_id='cogito:latest_1745979984', format='text') # Generate an HTML report report = get_mcts_report(run_id='cogito:latest_1745979984', format='html') ### Finding the Best Runs To find your best-performing runs: best_runs = get_best_mcts_runs(count=3, min_score=8.0) This returns the top 3 runs with a score of at least 8.0. ## Simple Usage Instructions 1. **Changing Models**: list_ollama_models() # See available models set_ollama_model("qwen3:0.6b") # Set to fast small model 2. **Starting a New Analysis**: initialize_mcts(question="Your question here", chat_id="unique_identifier") 3. **Running the Analysis**: run_mcts(iterations=3, simulations_per_iteration=10) 4. **Comparing Performance**: run_model_comparison(question="Your question", iterations=2) 5. **Getting Results**: generate_synthesis() # Final summary of results get_mcts_status() # Current status and metrics

예시 프롬프트

  • "인공지능이 인간 창의성에 미치는 영향을 분석하세요"
  • "이 주제의 윤리적 차원을 계속 탐구하세요"
  • "마지막 실행에서 발견한 가장 좋은 분석은 무엇이었나요?"
  • "MCTS 프로세스는 어떻게 작동하나요?"
  • "현재 MCTS 구성을 보여주세요"

개발자를 위한

# Activate virtual environment source .venv/bin/activate # Run the server directly (for testing) uv run server.py # OR use the MCP CLI tools uv run -m mcp dev server.py

서버 테스트

서버가 올바르게 작동하는지 테스트하려면:

# Activate the virtual environment source .venv/bin/activate # Run the test script python test_server.py

이렇게 하면 LLM 어댑터가 제대로 작동하는지 테스트할 수 있습니다.

기여하다

MCTS MCP 서버 개선을 위한 여러분의 참여를 환영합니다. 개선이 필요한 부분은 다음과 같습니다.

  • 더욱 정교한 분석을 위한 로컬 추론 어댑터 개선
  • 더욱 정교한 사고 패턴과 평가 전략 추가
  • 트리 시각화 및 결과 보고 향상
  • MCTS 알고리즘 매개변수 최적화

라이센스: MIT

-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

클로드가 몬테카를로 트리 탐색 알고리즘을 사용하여 주제, 질문 또는 텍스트 입력에 대한 심층적이고 탐색적인 분석을 수행할 수 있도록 하는 MCP(모델 컨텍스트 프로토콜) 서버입니다.

  1. 개요
    1. 특징
      1. 용법
        1. 작동 원리
          1. 설치
            1. Claude 데스크톱 통합
              1. Ollama 통합을 포함한 제안된 시스템 프롬프트 및 업데이트된 도구, 즉 프로젝트 지침에 다음 블록을 넣으세요:
                1. 예시 프롬프트
              2. 개발자를 위한
                1. 서버 테스트
                  1. 기여하다
                    1. 라이센스: MIT

                      Related MCP Servers

                      • A
                        security
                        A
                        license
                        A
                        quality
                        A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
                        Last updated -
                        1
                        2,806
                        1,458
                        TypeScript
                        MIT License
                        • Apple
                      • -
                        security
                        A
                        license
                        -
                        quality
                        A Model Context Protocol (MCP) server that exposes MiniZinc constraint solving capabilities to Large Language Models.
                        Last updated -
                        53
                        Python
                        MIT License
                        • Linux
                        • Apple
                      • -
                        security
                        A
                        license
                        -
                        quality
                        A Model Context Protocol (MCP) server that enables semantic search and retrieval of documentation using a vector database (Qdrant). This server allows you to add documentation from URLs or local files and then search through them using natural language queries.
                        Last updated -
                        14
                        74
                        JavaScript
                        Apache 2.0
                        • Apple
                      • A
                        security
                        F
                        license
                        A
                        quality
                        An MCP (Model Context Protocol) server that provides Google search capabilities and webpage content analysis tools. This server enables AI models to perform Google searches and analyze webpage content programmatically.
                        Last updated -
                        3
                        46
                        41
                        TypeScript

                      View all related MCP servers

                      ID: cz65nop4za