
Mirror Mcp
io.github.tobyPublished by GitHub account tobyv0.0.8Updated Oct 24, 2026
Mirror MCP: Introspection for LLMs
Overview
A local MCP server exposing a single reflect tool that lets an assistant ask itself questions and receive answers via MCP sampling.
- What you can do
- mirror-mcp provides one tool, reflect, which lets the model pose a question to itself and get a response generated through MCP sampling. The tool accepts a required question plus optional context, system_prompt, user_prompt, max_tokens and temperature, so the model can steer the style and focus of the reflection. Default guidance covers strengths, weaknesses, assumptions and alternative perspectives, and responses come back with token and timing metadata.
- When to use it
- Worth adding when you want an assistant to check its own reasoning, calibrate confidence, or explore alternative perspectives before answering. It is a small, single-purpose helper rather than a general toolset, so it only makes sense if your client supports MCP sampling.
- Requirements
- Runs locally over stdio as an npm package, started with npx mirror-mcp or installed globally; Node.js 18 or higher is required. No accounts, API keys, environment variables or headers are declared. Desktop clients only.
Installation
In SourceWeft
- Open Mirror Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
mirror-mcp
A Model Context Protocol (MCP) server that provides a reflect tool, enabling LLMs to engage in self-reflection and introspection through recursive questioning and MCP sampling.
Overview
mirror-mcp allows AI models to "look at themselves" by providing a reflection mechanism. When an LLM uses the reflect tool, it can pose questions to itself and receive answers through the Model Context Protocol's sampling capabilities. This creates a powerful feedback loop for self-analysis, reasoning validation, and iterative problem-solving.
Features
- 🪞 Self-Reflection Tool: Enables LLMs to ask themselves questions and receive computed responses
- 🔄 MCP Sampling Integration: Uses the Model Context Protocol's sampling mechanism for responses
- 📦 npm Installable: Easy installation and deployment
- ⚡ Lightweight: Minimal dependencies and fast startup
- 🔧 Configurable: Customizable reflection parameters and sampling options
Installation
Quick Install for VS Code
[Install in VS Code] [Install in VS Code Insiders]
MCP Host Configuration
For other MCP-compatible clients, add the following configuration:
Via npm
Via npx (no installation required)
From Source
API Reference
Tools
reflect
Enables the LLM to ask itself a question and receive a response through MCP sampling. The tool supports custom system and user prompts to help the LLM self-direct what kind of response it gets.
Self-Direction with Custom Prompts:
- System Prompt: Define the role or perspective for the reflection (e.g., "expert coach", "critical thinker", "creative problem solver")
- User Prompt: Specify the format, structure, or focus of the reflection response
- Default Behavior: When no custom prompts are provided, uses built-in reflection guidance focused on strengths, weaknesses, assumptions, and alternative perspectives
Parameters:
question(string, required): The question the LLM wants to ask itselfcontext(string, optional): Additional context for the reflectionsystem_prompt(string, optional): Custom system prompt to direct the reflection approachuser_prompt(string, optional): Custom user prompt to replace the default reflection instructionsmax_tokens(number, optional): Maximum tokens for the response (default: 500)temperature(number, optional): Sampling temperature (default: 0.8)
Example:
Example with custom prompts:
Response:
Architecture & Rationale
Design Philosophy
mirror-mcp is built on the principle that self-reflection is crucial for robust AI reasoning. By enabling models to question their own outputs and reasoning processes, we create opportunities for:
- Error Detection: Models can identify potential flaws in their logic
- Confidence Calibration: Self-assessment helps gauge certainty levels
- Iterative Improvement: Reflective questioning can lead to better solutions
- Metacognitive Awareness: Understanding of the model's own reasoning process
Technical Architecture
Key Components
- Reflection Engine: Processes incoming self-directed questions
- Sampling Interface: Interfaces with MCP's sampling capabilities
- Context Manager: Maintains conversation context for coherent reflections
- Response Formatter: Structures reflection responses for optimal consumption
Why MCP?
The Model Context Protocol provides a standardized way for AI models to connect with external resources and tools. By implementing mirror-mcp as an MCP server, we ensure:
- Interoperability: Works with any MCP-compatible client
- Standardization: Follows established protocols for tool integration
- Scalability: Can be deployed alongside other MCP servers
- Future-Proofing: Benefits from ongoing MCP ecosystem development
Sampling Strategy
The reflection mechanism leverages MCP's sampling capabilities to generate thoughtful responses. The sampling process:
- Takes the self-directed question as a prompt
- Applies configurable sampling parameters (temperature, max tokens)
- Generates a response using the underlying model
- Returns the reflection with appropriate metadata
This approach ensures that reflections are generated using the same model capabilities as the original reasoning, creating authentic self-assessment.
Development
Prerequisites
- Node.js 18 or higher
- npm or yarn
- TypeScript (for development)
Development Setup
Testing
Building
Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Areas for Contribution
- Enhanced reflection strategies
- Additional sampling parameters
- Performance optimizations
- Documentation improvements
- Test coverage expansion
Related Projects
- Model Context Protocol: The foundational protocol specification
- MCP Ecosystem: Various other MCP servers and tools
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- The Model Context Protocol team for creating the foundational specification
- The broader AI research community working on metacognition and self-reflection
- Contributors and early adopters who help shape this tool
"The unexamined life is not worth living" - Socrates
Enable your AI models to examine their own reasoning with mirror-mcp.
Source: README.md at commit 36ed257
Tools
0Version history
1- v0.0.8LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts