Get the FREE Ultimate OpenClaw Setup Guide →

mcp-dual-cycle-reasoner

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

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio cyqlelabs-mcp-dual-cycle-reasoner npx @cyqlelabs/mcp-dual-cycle-reasoner

How to use

The MCP Dual-Cycle Reasoner is a TypeScript-based server that implements a two-loop metacognitive framework for autonomous agents. It provides a Sentinel-like monitoring layer to detect anomalies and repetitive loops, together with an Adjudicator-style case base to learn from past experiences. The server exposes a set of tools for starting monitoring, processing cognitive traces, detecting loops, configuring detection parameters, and managing experiences. You can run the server over HTTP (default) or via stdio, and you can integrate it into clients like Claude Desktop using an MCP configuration block. Core capabilities include statistical and semantic analyses for loop detection, NLI-based text processing, and a configurable, high-performance detection pipeline. The tools are designed to be composable, allowing you to monitor goals, context, and actions, detect when the agent is stuck, propose interventions, and store or retrieve past experiences for better decision-making.

How to install

Prerequisites:

  • Node.js and npm installed on your system
  • Basic familiarity with npm scripts and running Node.js applications

Installation steps:

  1. Clone the repository git clone https://github.com/cyqlelabs/mcp-dual-cycle-reasoner.git cd mcp-dual-cycle-reasoner

  2. Install dependencies npm install

  3. Build the project (if required by the project setup) npm run build

  4. Run the server (HTTP stream by default) npm start

  5. Optional: run via stdio transport npm start -- --stdio

  6. (Optional) Use via npx (as shown in MCP config example) npx @cyqlelabs/mcp-dual-cycle-reasoner

Notes:

  • The server listens on port 8080 by default when using HTTP stream. You can override via environment variables or config if supported by the build.
  • If using stdio transport, pass the --stdio flag to enable stdio-based communication.

Additional notes

Tips and common considerations:

  • If you plan to run in Claude Desktop MCP, use the provided npx command in your mcpServers config: { "mcpServers": { "dual-cycle-reasoner": { "command": "npx", "args": ["@cyqlelabs/mcp-dual-cycle-reasoner"] } } }
  • Explore the available tools to tailor behavior: start_monitoring, process_trace_update, stop_monitoring, detect_loop, configure_detection, store_experience, retrieve_similar_cases, and get_monitoring_status.
  • Environment variables and thresholds can be tuned via configure_detection (e.g., min_actions_for_detection, repetition_threshold, semantic_intents).
  • For performance, the server leverages simple-statistics, natural, compromise, and HuggingFace transformers; ensure your environment satisfies the native dependencies if you customize the build.
  • Ensure proper handling of inputs when using the HTTP stream API to avoid large payloads or long-running traces that may incur timeouts.

Related MCP Servers

Sponsor this space

Reach thousands of developers