npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mcp-feedback-sse

v1.0.3

Published

SSE-based MCP server for interactive user feedback

Readme

MCP Feedback SSE Server

基于 SSE (Server-Sent Events) 的 MCP (Model Context Protocol) 反馈服务器,提供实时交互式反馈功能。

🚀 特性

  • SSE 实时通信: 基于 Server-Sent Events 的实时双向通信
  • 🌐 现代化 Web UI: 响应式设计,支持多设备访问
  • 📱 交互式反馈: 实时接收和回复 MCP 反馈请求
  • 📊 会话管理: 完整的会话历史记录和统计信息
  • 🔧 易于部署: 支持 npx 一键启动,可部署到任何服务器
  • 🎯 MCP 兼容: 完全兼容 MCP 协议标准

📦 安装

使用 npx (推荐)

# 直接运行
npx mcp-feedback-sse

# 或指定端口
npx mcp-feedback-sse --port 8080

从源码安装

# 克隆项目
git clone <repository-url>
cd mcp-feedback-sse

# 安装依赖
npm install

# 启动服务
npm start

🎯 使用方法

1. 启动服务器

# 默认端口 5555
npx mcp-feedback-sse

# 自定义配置
npx mcp-feedback-sse --port 8080 --host 0.0.0.0 --debug

2. 访问 Web UI

打开浏览器访问: http://localhost:5555

3. MCP 工具配置

在您的 MCP 客户端中配置 SSE URL:

{
     "mcpServers": {
     "feedback-sse": {
       "sseUrl": "http://your-server:5555/events",
       "apiUrl": "http://your-server:5555"
     }
   }
}

🔧 API 接口

基础接口

  • GET /health - 健康检查
  • GET /tools - 获取 MCP 工具列表
  • GET /events - SSE 连接端点

反馈接口

  • POST /feedback - 创建反馈请求
  • GET /feedback/:sessionId - 获取会话状态
  • POST /api/response - 提交用户回复

示例请求

// 创建反馈请求
const response = await fetch('/feedback', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    message: '请确认是否继续执行?',
    require_response: true,
    timeout: 300
  })
});

// 提交用户回复
const result = await fetch('/api/response', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    sessionId: 'session-id',
    response: '确认继续'
  })
});

🌐 部署

Docker 部署

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --production
COPY . .
EXPOSE 3000
CMD ["npm", "start"]

PM2 部署

# 安装 PM2
npm install -g pm2

# 启动服务
pm2 start src/server.js --name mcp-feedback-sse

# 配置开机自启
pm2 startup
pm2 save

Nginx 反向代理

server {
    listen 80;
    server_name your-domain.com;
    
         location / {
         proxy_pass http://localhost:5555;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_cache_bypass $http_upgrade;
    }
    
         location /events {
         proxy_pass http://localhost:5555/events;
        proxy_http_version 1.1;
        proxy_set_header Connection '';  # SSE 需要
        proxy_buffering off;
        proxy_cache off;
        chunked_transfer_encoding off;
    }
}

⚙️ 配置选项

命令行参数

npx mcp-feedback-sse [options]

选项:
  -p, --port <port>    服务器端口 (默认: 5555)
  -h, --host <host>    绑定主机 (默认: 0.0.0.0)
  --debug              启用调试模式
  --dev                开发模式
  --help               显示帮助信息
  --version            显示版本信息

环境变量

PORT=5555              # 服务器端口
HOST=0.0.0.0          # 绑定主机
DEBUG=true            # 调试模式
NODE_ENV=production   # 运行环境

🧪 测试

# 运行测试
npm test

# 或使用命令行工具
npx mcp-feedback-sse test

📊 功能特性

Web UI 功能

  • 🔄 实时连接状态: 显示 SSE 连接状态和活跃会话数
  • 💬 当前反馈: 实时显示收到的反馈请求
  • ✍️ 回复区域: 直观的用户回复界面,支持快捷键
  • 📚 会话历史: 完整的历史记录,支持导出和清除
  • 📈 统计信息: 会话统计和性能指标

技术特性

  • 🚀 高性能: 基于 Express.js 和原生 SSE
  • 🔒 稳定可靠: 自动重连和错误处理
  • 📱 响应式设计: 支持移动设备和桌面设备
  • 🎨 现代界面: 毛玻璃效果和流畅动画
  • 🌐 跨平台: 支持 Windows、macOS、Linux

🛠️ 开发

项目结构

mcp-feedback-sse/
├── src/
│   ├── server.js      # 主服务器逻辑
│   ├── cli.js         # 命令行入口
│   └── test.js        # 测试文件
├── public/
│   ├── index.html     # Web UI 主页
│   ├── styles.css     # 样式文件
│   └── app.js         # 前端 JavaScript
├── package.json       # 项目配置
└── README.md         # 项目说明

本地开发

# 克隆项目
git clone <repository-url>
cd mcp-feedback-sse

# 安装依赖
npm install

# 开发模式启动
npm run dev

# 运行测试
npm test

🤝 贡献

欢迎提交 Issues 和 Pull Requests!

  1. Fork 项目
  2. 创建特性分支 (git checkout -b feature/AmazingFeature)
  3. 提交更改 (git commit -m 'Add some AmazingFeature')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 开启 Pull Request

📄 许可证

MIT License - 查看 LICENSE 文件了解详情

🙏 致谢

本项目灵感来源于 mcp-feedback-enhanced,在此表示感谢!

📞 支持

如有问题或建议,请:

  • 提交 GitHub Issues
  • 发送邮件至项目维护者
  • 查看文档和 FAQ

🌟 如果这个项目对您有帮助,请给个 Star!