
feedback_mcp_python
一个用Python实现的反馈收集工具,支持MCP协议并与Claude等客户端集成。
Repository Info
About This Server
一个用Python实现的反馈收集工具,支持MCP协议并与Claude等客户端集成。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
MCP Feedback Tool
A Python implementation of a feedback collection tool similar to the mcp_claudeflow_collect_feedback tool, integrated with an MCP server for use with Claude and other MCP-compatible clients.
Features
- Collect user feedback via a customizable dialog window
- Store feedback history in a JSON file
- Format timestamps in various ways (full, ISO, date, time, unix)
- View feedback history
- Easily integrate with Claude Desktop or Claude Code via the MCP protocol
- Autoclose timer that automatically closes the dialog after 15 seconds (can be paused)
- Status messages for different interaction outcomes (normal, empty, cancelled, auto-closed, closed)
Installation
Prerequisites
- Python 3.8 or higher
- Tkinter (usually comes with Python)
- fastmcp package
- customtkinter package
Setup
- Clone this repository or download the files
- Install the required dependencies:
pip install -r requirements.txt
Usage
Standalone Feedback Collector
You can use the feedback collector directly without the MCP server:
from mcp_feedback import MCPFeedbackCollector
collector = MCPFeedbackCollector()
# Basic feedback collection
result = collector.collect_feedback()
print(f"Feedback received: {result['feedback']}")
print(f"Status: {result['status']}")
print(f"Timestamp: {result['timestamp']}")
# Custom prompt and title
result = collector.collect_feedback(
prompt="What do you think about the new feature?",
title="Feature Feedback",
time_format="iso"
)
# View feedback history
collector.view_history()
Autoclose Timer
The feedback dialog includes an autoclose timer that will automatically close the dialog after 15 seconds of inactivity:
- A countdown timer shows the remaining time
- The "Pause" button allows users to pause/resume the timer
- If the dialog auto-closes, it returns a special message: "Session expired. The project is now in your hands. Proceed as you see fit."
- The timer resets to 15 seconds whenever the user:
- Types in the feedback area
- Moves the mouse within the dialog
- Clicks anywhere in the dialog
- Changes the appearance mode
- Resumes the timer after pausing
Status Messages
The feedback collector provides different status messages based on how the dialog was closed:
| Status | Description | Message |
|---|---|---|
normal | User submitted feedback normally | User's feedback text |
approved | User clicked Approve button | "I approve." |
enough | User clicked Enough button | "That is good enough for now." |
empty | User submitted with empty feedback | "Assume the user has no issues." |
cancelled | User clicked Cancel | "Operation cancelled by user. Please stop all current operations." |
auto_closed | Timer expired | "Assume the user has no issues." |
closed | User closed window with X button | "Window closed by user. Please stop all current operations." |
Note that:
- The
auto_closedmessage is intentionally similar to theemptymessage to allow the AI to continue working on the project in both cases. - Both
cancelledandclosedmessages instruct the AI to stop all operations, providing consistent behavior when the user explicitly cancels or closes the dialog. - The
approvedstatus indicates the user has approved the current state or suggestion without providing additional feedback. - The
enoughstatus indicates the user finds the current state acceptable but may want to revisit it later.
MCP Server Integration
To use with Claude Desktop or Claude Code, you need to run the MCP server and configure your client to connect to it.
- Start the MCP server:
python mcp_feedback_server.py
-
Configure Claude Desktop:
- Open Claude Desktop settings
- Navigate to the "Developer" tab
- Click "Edit Config"
- Add your MCP server configuration:
{
"mcpServers": {
"feedback": {
"command": "python",
"args": [
"/absolute/path/to/mcp_feedback_server.py"
]
}
}
}
- Configure Claude Code:
claude mcp add
Then provide the following details:
- Server Name:
feedback - Server Scope: Choose
ProjectorGlobal - Server Command:
python /absolute/path/to/mcp_feedback_server.py
MCP Tools
The MCP server exposes two tools:
-
collect_feedback: Opens a dialog to collect user feedback- Parameters:
prompt: The message displayed to the user (default: "Please provide your feedback or describe your issue:")title: The title of the feedback window (default: "AI Feedback Collection")time_format: The format for time information (default: "full")timezone: The timezone to use (default: local)
- Parameters:
-
view_feedback_history: Returns a formatted string of all collected feedback
Customization
You can customize the appearance and behavior of the feedback collector by modifying the mcp_feedback.py file:
- Change the default window size
- Modify the UI styling
- Adjust the history file location
- Add more timestamp formats
- Change the autoclose timer duration
License
MIT
Acknowledgements
This project was inspired by the mcp_claudeflow_collect_feedback tool available in Claude.
Quick Start
Clone the repository
git clone https://github.com/ceciliomichael/feedback_mcp_pythonInstall dependencies
cd feedback_mcp_python
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.