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

@xujiefeng/mcp-prompt-optimizer

v1.0.4

Published

ByteFun MCP服务:智能提示词优化,支持AI处理完成回调监听,提升Cursor使用体验

Readme

ByteFun MCP Prompt Optimizer

🚀 智能提示词优化服务,支持AI处理完成回调监听,提升Cursor使用体验

✨ 功能特性

  • 🎯 智能提示词优化:自动优化用户输入的提示词,提高AI响应质量
  • 📞 AI回调监听:监听AI处理完成事件,获取完整响应数据
  • 🔧 VSCode集成:完美集成VSCode插件,提供丰富的用户界面
  • ⚡ 高性能:基于MCP协议,提供稳定高效的服务
  • 🛡️ 安全可靠:企业级安全设计,保护用户数据隐私

📦 安装使用

全局安装

npm install -g @xujiefeng/mcp-prompt-optimizer

在Cursor中配置

.cursor/mcp.json 中添加配置:

{
  "mcpServers": {
    "bytefun-prompt-optimizer": {
      "command": "npx",
      "args": ["@xujiefeng/mcp-prompt-optimizer"],
      "env": {
        "NODE_ENV": "production"
      }
    }
  }
}

启动服务

# 直接运行
npx @xujiefeng/mcp-prompt-optimizer

# 或使用全局安装的命令
xujiefeng-mcp

🔧 配置选项

服务支持以下环境变量配置:

  • NODE_ENV: 运行环境 (development/production)
  • LOG_LEVEL: 日志级别 (debug/info/warn/error)
  • CACHE_DIR: 缓存目录路径

🎮 使用方法

1. 提示词优化

// MCP工具调用示例
{
  "tool": "optimize_with_callback",
  "arguments": {
    "user_input": "帮我写一个函数",
    "context_type": "coding",
    "enable_callback": true
  }
}

2. AI回调监听

服务会自动监听AI处理完成事件,并通过文件系统通信机制传递结果给VSCode插件。

3. 状态查询

{
  "tool": "get_request_status", 
  "arguments": {
    "request_id": "req_1234567890_abcdef"
  }
}

📋 API文档

工具列表

optimize_with_callback

优化提示词并支持AI处理完成后的回调通知

参数:

  • user_input (string, 必需): 用户的原始输入
  • context_type (string, 可选): 上下文类型 (coding/writing/analysis/general)
  • enable_callback (boolean, 可选): 是否启用回调通知

notify_ai_complete

AI处理完成后的通知工具(由AI自动调用)

参数:

  • request_id (string, 必需): 请求ID
  • ai_response (string, 必需): AI的完整响应内容
  • processing_time (number, 可选): 处理时间(毫秒)
  • metadata (object, 可选): 额外的元数据

get_request_status

获取请求状态

参数:

  • request_id (string, 必需): 请求ID

🔍 故障排除

常见问题

Q: 服务无法启动? A: 检查Node.js版本是否>=18.0.0,确保MCP SDK正确安装

Q: Cursor无法连接到服务? A: 验证.cursor/mcp.json配置是否正确,检查服务是否正在运行

Q: 回调功能不工作? A: 确保VSCode插件已正确安装并启用,检查通信目录权限

日志查看

# 启用调试日志
LOG_LEVEL=debug npx @xujiefeng/mcp-prompt-optimizer

📞 技术支持

  • 邮箱支持: [email protected]
  • 在线帮助: https://bytefun.com/support
  • 用户社区: https://bytefun.com/community

📄 许可证

MIT License - 详见 LICENSE 文件

🏢 关于ByteFun

ByteFun致力于为开发者提供高效的AI辅助工具,提升编程体验和生产力。


© 2024 ByteFun Team. All rights reserved.