Get the FREE Ultimate OpenClaw Setup Guide →

mirror

🪞✨ Looking at yourself

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio toby-mirror-mcp npx mirror-mcp@latest

How to use

mirror-mcp is an MCP server that exposes a self-reflection tool called reflect. This tool lets an LLM pose questions to itself and receive structured reflections via MCP sampling, enabling iterative self-analysis, reasoning validation, and meta-cognition. The server integrates with the MCP ecosystem so clients can invoke reflect with optional system and user prompts, specify maximum tokens and temperature, and receive a formatted reflection along with metadata.

To use it, run the MCP host configuration (for example via npx mirror-mcp@latest) on a compatible client. Once the server is running, call the reflect tool with the required fields such as question, and optionally context, system_prompt, user_prompt, max_tokens, and temperature. The tool then processes the input through the MCP sampling pipeline and returns a reflection that can be consumed by the LLM to guide its next steps or to audit its reasoning.

How to install

Prerequisites:

  • Node.js 18+ (recommended)
  • npm (or yarn)

Install from npm (global):

npm install -g mirror-mcp

Run directly with npx (no installation):

npx mirror-mcp

From source (development):

git clone https://github.com/toby/mirror-mcp.git
cd mirror-mcp
npm install
npm run build
npm start

If you are integrating with a client, ensure your MCP host configuration points to npx mirror-mcp@latest as shown in the MCP Host Configuration example.

Additional notes

Notes and tips:

  • The reflect tool supports custom prompts via system_prompt and user_prompt to tailor the reflection approach.
  • Default max_tokens is 500 and default temperature is 0.8; adjust as needed for deeper or more conservative reflections.
  • Ensure your environment variables (if using specific MCP infrastructure) are configured as required by your deployment (no mandatory env vars are specified for basic usage).
  • When deploying in production, consider freezing the version (mirror-mcp@vX.Y.Z) to avoid unexpected changes from @latest.
  • If you encounter MCP compatibility issues, verify that the host configuration in your client matches the npx-based approach used here.
  • Running in a container or managed environment may require port and network access adjustments depending on your MCP ecosystem setup.

Related MCP Servers

Sponsor this space

Reach thousands of developers ↗