# My Last Feedback Python

> A Model Context Protocol (MCP) server that enables a human-in-the-loop workflow for AI-assisted development tools such as Cursor, Cline, and Windsurf. Based on the original work by Fábio Ferreira (@fabiomlferreira).

- **Type:** MCP server
- **Install:** `agentstack add mcp-iswitthere-my-last-feedback-python`
- **Verified:** Pending review
- **Seller:** [isWittHere](https://agentstack.voostack.com/s/iswitthere)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [isWittHere](https://github.com/isWittHere)
- **Source:** https://github.com/isWittHere/my-last-feedback-python

## Install

```sh
agentstack add mcp-iswitthere-my-last-feedback-python
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# My Last Feedback MCP

A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that enables a **human-in-the-loop workflow** for AI-assisted development tools such as [Cursor](https://www.cursor.com), [Cline](https://cline.bot), and [Windsurf](https://windsurf.com).

> **Based on** the original work by [Fábio Ferreira (@fabiomlferreira)](https://x.com/fabiomlferreira).  
> This fork adds UI enhancements and stronger API contracts for AI agents.

---

## ✨ Features

| Feature | Description |
|---|---|
| **Interactive feedback window** | A native PySide6 desktop UI pops up whenever the AI agent requests feedback |
| **Markdown summary rendering** | Agent summaries are rendered as rich Markdown in the feedback window |
| **Task title in window bar** | The `request_name` parameter is displayed as both window title and a bold heading |
| **Image attachments** | Attach images via file picker, Ctrl+V clipboard paste, or drag-and-drop — images are returned to the LLM as `ImageContent` |
| **Quick action buttons** | One-click preset responses (Start task, Continue, Analyze, Fix, Explain) |
| **Custom prompt buttons** | Load your own `.prompt.md` files from the `mcp_prompts/` folder as buttons |
| **Test log section** | A dedicated area to paste test output, appended to feedback automatically |
| **Feedback enhancement reminder** | Optional checkbox to remind the agent to call `interactive_feedback` again |
| **Dark mode** | Full dark theme with Windows dark title bar support |
| **Per-project settings** | Preferences are saved per project directory via Qt `QSettings` |

---

## 💡 Why Use This?

By guiding the AI assistant to check in with the user instead of making speculative tool calls, this server can drastically reduce the number of API requests consumed. In practice it can consolidate up to 25 tool calls into a single feedback-aware request — saving cost and improving accuracy.

---

## 🛠️ Installation

### Prerequisites

- Python **3.11** or newer
- [uv](https://github.com/astral-sh/uv) package manager

```bash
# Windows
pip install uv

# Linux / macOS
curl -LsSf https://astral.sh/uv/install.sh | sh
```

### Setup

```bash
# 1. Clone the repository
git clone https://github.com/isWittHere/my-last-feedback.git
cd my-last-feedback

# 2. Install dependencies
uv sync
```

---

## ⚙️ Configuration

### Cursor

Add the following to your Cursor MCP configuration (replace the path with your actual clone location):

```json
{
  "mcpServers": {
    "my-last-feedback": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/my-last-feedback",
        "run",
        "server.py"
      ],
      "timeout": 600,
      "autoApprove": [
        "interactive_feedback"
      ],
      "env": {
        "FEEDBACK_LANG": "en"
      }
    }
  }
}
```

### Cline / Windsurf

Use the same `command` / `args` pattern above in the respective tool's MCP settings.

### 🌐 Language Configuration

Set the `FEEDBACK_LANG` environment variable in the `env` block of your MCP config to control the UI language:

| Value | Language |
|---|---|
| `en` | English (default) |
| `zh` | Chinese |

See [`mcp.json.template`](mcp.json.template) for a ready-to-use configuration template.

---

## 📝 Prompt Engineering

Add the following to your AI assistant's custom rules (e.g. as a `.cursor/rules/` rule or a VS Code `.instructions.md`):

```markdown
---
name: interactive-feedback
description: For ALL Requests, use the interactive-feedback tool to get user confirmation for important operations and finalizing requests.
applyTo: '**'
---
## MUST FOLLOW :
Whenever you're about to complete a user request, call the interactive_feedback instead of simply ending the process.

## Interactive Feedback MCP Tool Usage Instructions
The interactive_feedback tool must be used in any of the following situations:
- When user confirmation is needed for certain important operations, call the interactive_feedback：
  - Testing: Before wanting to perform project testing or coding a test script;
  - Terminal: Before wanting to use any terminal commands;
  - Reporting: Before wanting to generate any reports, especially in markdown format;
  - Asking: Before wanting to ask the user any questions;
- Whenever you're about to complete a user request, call the interactive_feedback instead of simply ending the process. 
- Keep calling interactive_feedback until the user's feedback is empty, then end the request.
```

---

## 🔧 Tool Reference

### `interactive_feedback`

Requests interactive feedback from the user.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `project_directory` | `string` | ✅ | Full path to the project directory |
| `summary` | `string` | ✅ | Summary in **standard Markdown format** — must use headings (`##`), lists (`-`), bold (`**text**`), and/or code blocks. Plain text is not acceptable. |
| `request_name` | `string` | ✅ | A concise task title (5–10 words) shown in the window title bar. **Must not be left empty.** |

#### Example call

```xml

  my-last-feedback
  interactive_feedback
  
    {
      "project_directory": "/path/to/your/project",
      "request_name": "Refactor authentication module",
      "summary": "## Changes Made\n\n- Extracted token logic into `auth/token.py`\n- Added unit tests for edge cases\n\n## Next Steps\n\n- Review the updated tests"
    }
  

```

#### Return value

The tool returns a **list of MCP content blocks** (`TextContent` and/or `ImageContent`).
The text blocks reflect the configured language (`FEEDBACK_LANG` env var).
If the user attached images, they are included as `ImageContent` items (base64-encoded) that vision-capable LLMs can read directly.

```json
[
  {
    "type": "text",
    "text": "## User Feedback\n[user feedback]\n\n## Reminder\nPlease use the interactive_feedback tool again after completing this operation."
  },
  {
    "type": "image",
    "data": "",
    "mimeType": "image/png"
  }
]
```

> **Note:** Image support requires a vision-capable LLM (e.g. GPT-4o, Claude 3.5+).

---

## �️ Image Attachments

Users can attach images to their feedback, which are transmitted to the LLM as MCP `ImageContent` (base64-encoded). This allows vision-capable models to see screenshots, diagrams, or any other visual context.

### How to attach images

| Method | How |
|--------|-----|
| **File picker** | Click the **📎 Attach Images** button and browse for files |
| **Clipboard paste** | Press **Ctrl+V** in the feedback text box to paste a screenshot |
| **Drag & drop** | Drag image files from Explorer directly onto the feedback window |

### Limits

| Limit | Value |
|-------|-------|
| Max images per feedback | 5 |
| Max size per image | 5 MB |
| Max total size | 20 MB |
| Supported formats | PNG, JPG, JPEG, GIF, WEBP, BMP |

Clipboard-pasted images are saved to a temporary directory and automatically cleaned up after the feedback is sent.

---

## �📁 Custom Prompt Buttons

Place `.prompt.md` files in the `mcp_prompts/` directory. Each file must have YAML front matter with `name` and optionally `description`:

```markdown
---
name: "Run Tests"
description: "Ask the agent to run the test suite"
---
Please run the full test suite and report any failures.
```

Clicking the button appends the prompt body to the feedback input and submits immediately.

---

## 🧑‍💻 Development

Run the server with the FastMCP development web UI:

```bash
uv run fastmcp dev server.py
```

---

## 📄 License

See [LICENSE](LICENSE) for details.

---

## Acknowledgements

Original project by [Fábio Ferreira](https://x.com/fabiomlferreira).  
Check out [dotcursorrules.com](https://dotcursorrules.com/) for more AI development resources.

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [isWittHere](https://github.com/isWittHere)
- **Source:** [isWittHere/my-last-feedback-python](https://github.com/isWittHere/my-last-feedback-python)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: flagged — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-iswitthere-my-last-feedback-python
- Seller: https://agentstack.voostack.com/s/iswitthere
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
