home / mcp / mcp dual-cycle reasoner mcp server

MCP Dual-Cycle Reasoner MCP Server

A MCP server implementing the Dual-Cycle Metacognitive Reasoning Framework for autonomous agents. A loop prevention and experience recall mechanism.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "cyqlelabs-mcp-dual-cycle-reasoner": {
      "command": "npx",
      "args": [
        "@cyqlelabs/mcp-dual-cycle-reasoner"
      ]
    }
  }
}

You use the MCP Dual-Cycle Reasoner to give autonomous agents metacognitive capabilities. It monitors cognitive processes, detects loops or stagnation, and learns from past experiences to improve decision making. This server enables self-awareness, reliability, and smarter adaptation through sentinel-style anomaly detection and adjudicator-driven case management.

How to use

To use this MCP server with your client, install the server locally or run it via a compatible MCP client. Start monitoring an agent’s goal, feed it cognitive traces, and let the system detect loops or anomalies. When a loop is detected, the system returns an intervention plan and details to guide your recovery actions. You can store successful experiences and retrieve similar cases to inform future decisions. Use the provided tools to monitor, detect loops, configure detection, and manage experiences.

How to install

Prerequisites: Ensure you have Node.js installed (version 14+ is recommended) and npm available in your environment.

1. Clone the project folder to your local machine.

2. Install dependencies.

git clone https://github.com/cyqlelabs/mcp-dual-cycle-reasoner.git
cd mcp-dual-cycle-reasoner

3. Build the project.

npm install
npm run build

4. Run the server in HTTP stream mode (default). The server will listen on port 8080.

npm start

5. If you prefer stdio transport, run the server with the stdio option.

npm start -- --stdio

Additional setup for MCP clients

To connect a client, configure your MCP client with the runtime command for the dual-cycle reasoner. The example below demonstrates a standard MCP client setup that uses a local stdio command.

{
  "mcpServers": {
    "dual_cycle_reasoner": {
      "command": "npx",
      "args": ["@cyqlelabs/mcp-dual-cycle-reasoner"]
    }
  }
}

Example usage with a client

Once the server is running, you can initialize monitoring for an agent, send cognitive trace updates, and store or retrieve experiences to guide behavior.

Notes on operation

- The system supports flag options to switch between detection methods (statistical, pattern, hybrid) and to adjust thresholds for progress indicators and repetitions.

- Use the experience management tools to curate a library of past problems and solutions, enabling faster recovery from similar situations in the future.

Available tools

start_monitoring

Initialize metacognitive monitoring of an agent's cognitive process.

process_trace_update

Process cognitive trace updates from the agent to assess progress and detect loops.

stop_monitoring

Stop monitoring and obtain a session summary.

detect_loop

Detect if the agent is stuck in a loop using statistical, pattern, or hybrid strategies.

configure_detection

Configure detection parameters and domain-specific progress indicators.

store_experience

Store a case for future case-based reasoning with enhanced metadata and quality scoring.

retrieve_similar_cases

Retrieve similar cases using semantic matching and filtering.

get_monitoring_status

Get the current monitoring status and statistics.

reset_engine

Reset the dual-cycle engine state.