
Mirror Mcp
io.github.toby由 GitHub 帳號 toby 發布v0.0.8更新於 Oct 24, 2026
Mirror MCP: Introspection for LLMs
概覽
一個本機 MCP 伺服器,提供 reflect 工具,讓助理透過 MCP 取樣向自己提問並取得回答。
- 可以做什麼
- mirror-mcp 只提供一個工具 reflect,讓模型向自己提出問題,並透過 MCP 取樣機制取得生成的回答。此工具接受必填的 question,以及選用的 context、system_prompt、user_prompt、max_tokens 和 temperature,模型可藉此控制反思的角度與形式。預設引導聚焦於優勢、弱點、假設與替代觀點,回傳結果附帶 token 用量與耗時中繼資料。
- 適用情境
- 適合希望助理在作答前檢查自身推理、校準信心程度或探索其他觀點的情境。它是單一用途的小工具,而非通用工具集,因此只有在用戶端支援 MCP 取樣時才有意義。
- 執行需求
- 以 npm 套件形式透過 stdio 在本機執行,可用 npx mirror-mcp 啟動或全域安裝;需要 Node.js 18 或更高版本。未宣告任何帳號、API 金鑰、環境變數或標頭。僅支援桌面用戶端。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Mirror Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
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.
來源:README.md,提交 36ed257
工具
0版本歷史
1- v0.0.8最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分