Mcp-Reasoning-Server
by: AzDeltaQQ
This is a very basic implementation of an Mcp-Reasoning-Server for Cursor AI .
📌Overview
Purpose: The MCP Advanced Reasoning Server is designed to enhance reasoning capabilities in Cursor AI for improved problem-solving and decision-making processes.
Overview: This framework provides a sophisticated server equipped with advanced reasoning techniques to facilitate complex query responses in Cursor AI using the Model Context Protocol (MCP). It integrates various reasoning methods, allowing users to conduct in-depth analysis with ease.
Key Features:
-
Monte Carlo Tree Search (MCTS): Implements MCTS for solving complex problems by exploring multiple possibilities, optimizing decision-making processes.
-
Beam Search: Enables simultaneous exploration of various reasoning paths, enhancing the ability to find optimal solutions quickly.
-
R1 Transformer: Utilizes Transformer-based reasoning for in-depth analysis of complex issues, leveraging modern AI techniques for improved accuracy.
-
Hybrid Reasoning: Merges both MCTS and Transformer analyses to produce a more robust reasoning framework, allowing for comprehensive understanding and insights.
-
Auto-Iterative Reasoning: Streamlines reasoning processes through automatic completion of all steps in a single tool call, significantly improving user experience and efficiency.
MCP Advanced Reasoning Server for Cursor AI
A Model Context Protocol (MCP) server that provides advanced reasoning capabilities for Claude in Cursor AI.
Notable Mentions
Thanks for giving me the idea Jacck.
Features
- Monte Carlo Tree Search (MCTS): Use MCTS reasoning for complex problem-solving tasks.
- Beam Search: Explore multiple reasoning paths simultaneously.
- R1 Transformer: Leverage Transformer-based reasoning for complex problems.
- Hybrid Reasoning: Combine Transformer analysis with MCTS for enhanced reasoning.
- Auto-Iterative Reasoning: All multi-step reasoning methods automatically complete all reasoning steps in a single tool call.
Installation
npm install
npm run build
Usage
Configuring with Cursor AI
-
Build the server first:
cd mcp-reasoning-server npm run build
-
Open Cursor AI
-
Navigate to Settings > Features > MCP
-
Click the "+ Add new global MCP server" button
-
Enter the following details:
- In the command field:
node C:\\Users\\[YourUsername]\\path\\to\\mcp-reasoning-server\\dist\\index.js
- Use the full path to your project's dist/index.js file
- Use double backslashes for Windows paths
- In the command field:
-
Click "Add"
-
Find your server in the list (it will initially show as "Disabled")
-
Click "Disabled" to toggle it to "Enabled"
-
Click the refresh button to load the available tools
-
A command prompt window will open automatically - this is your server running
-
As long as this command prompt window remains open, the reasoning tools will be available
Alternatively, edit your Cursor MCP configuration file at C:\Users\[Username]\.cursor\mcp.json
(Windows):
{
"mcpServers": {
"mcp-reasoner": {
"command": "node",
"args": ["C:\\Users\\[Username]\\path\\to\\mcp-reasoning-server\\dist\\index.js"]
}
}
}
Important Notes
- Server Running: The tools are only available while the command prompt window is open and running.
- Making Changes: Rebuild with
npm run build
before restarting after code changes. - Restarting: Close the command prompt and toggle the server off/on in Cursor Settings to restart.
Using the Reasoning Tools
Use the reasoning tools directly in your Cursor AI conversations with Claude:
MCTS Reasoning
Start a MCTS-based reasoning chain with:
/reason-mcts How can I optimize the performance of this React component?
Beam Search Reasoning
Use beam search-based reasoning:
/reason-beam What architecture would be best for this microservice system?
R1 Transformer Reasoning
Use single-step Transformer-based reasoning:
/reason-r1 Analyze the complexity of this algorithm.
Hybrid Reasoning
Combine Transformer and MCTS reasoning:
/reason-hybrid How should we approach refactoring this legacy codebase?
Claude Integration
Add the following custom instructions for Claude to recognize and use the reasoning tools commands:
When I use commands like /reason-mcts, /reason-beam, /reason-r1, or /reason-hybrid in chat, interpret them as requests to use the corresponding reasoning tools:
/reason-mcts: Use the reason_mcts tool with the text following the command as the query.
Example: "/reason-mcts How do I solve this problem?" should call the reason_mcts tool
/reason-beam: Use the reason_beam tool with the text following the command as the query.
Example: "/reason-beam What's the best approach for this complex problem?" should call the reason_beam tool
/reason-r1: Use the reason_r1 tool with the text following the command as the query.
Example: "/reason-r1 Analyze this code for performance issues" should call the reason_r1 tool
/reason-hybrid: Use the reason_hybrid tool with the text following the command as the query.
Example: "/reason-hybrid How should we restructure this architecture?" should call the reason_hybrid tool
When these commands are used, extract the text after the command as the query parameter and use the corresponding tool to perform advanced reasoning.
Development
Project Structure
src/index.ts
: Main server entry pointsrc/tools/reasoning-tools.ts
: Implementation of reasoning toolssrc/tools/reasoning-wrapper.ts
: Command wrappers for easier use in Cursorsrc/utils/errors.ts
: Error handling utilities
Auto-Iterative Reasoning
Reasoning tools automatically complete all reasoning steps internally during a single tool call by:
- Initializing the first thought/step
- Automatically generating subsequent thoughts/steps
- Returning all thoughts along with the final result
This ensures a fully completed reasoning process without multiple manual tool calls.
Adding New Reasoning Methods
- Add a new tool implementation in
src/tools/reasoning-tools.ts
. - Add a corresponding command wrapper in
src/tools/reasoning-wrapper.ts
. - Follow existing patterns for parameters and response format.
- Implement auto-iteration if multi-step.
- Rebuild the project with
npm run build
.
Limitations
This is a simulated reasoning server. A production implementation would connect to actual reasoning algorithms instead of placeholders.
License
ISC