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

@lmk1010/promptengine-mcp-server

v1.0.1

Published

MCP插件服务器,用于自动总结和保存prompt到PromptEngine

Readme

PromptEngine MCP插件服务器

这是一个专为PromptEngine设计的MCP(Model Context Protocol)插件服务器,可以在Cursor、Trae等支持MCP的AI工具中自动总结和保存prompt。

功能特性

  • 🤖 智能分析: 自动分析prompt内容,提供分类、标签、应用领域建议
  • 💾 一键保存: 直接将prompt保存到PromptEngine系统
  • 🏷️ 智能标签: 根据内容自动生成相关标签
  • 📊 分类建议: 智能识别prompt类型并建议合适分类
  • 🔧 灵活配置: 支持自定义API地址、默认分类等配置
  • 🚀 即插即用: 简单配置即可在AI工具中使用

可用工具

1. summarize_prompt

智能分析和总结prompt内容

  • 参数:
    • content (必需): prompt内容
    • title (可选): 自定义标题
    • category (可选): 自定义分类
    • tags (可选): 自定义标签
    • domain (可选): 应用领域
    • domainType (可选): 领域类型

2. save_prompt

保存prompt到PromptEngine系统

  • 参数:
    • title (必需): prompt标题
    • content (必需): prompt内容
    • summary (可选): 摘要
    • category (可选): 分类
    • tags (可选): 标签数组
    • domain (可选): 应用领域
    • domainType (可选): 领域类型
    • isPublic (可选): 是否公开

3. analyze_prompt

深度分析prompt内容

  • 参数:
    • content (必需): prompt内容

4. auto_save_prompt

自动分析并保存prompt(一站式服务)

  • 参数:
    • content (必需): prompt内容
    • title (可选): 自定义标题
    • isPublic (可选): 是否公开

5. get_categories

获取可用的prompt分类列表

6. get_domains

获取可用的应用领域列表

安装和配置

1. 安装依赖

cd mcp-prompt-server
npm install

2. 配置环境变量

复制配置模板:

cp env.example .env

编辑 .env 文件:

# PromptEngine API地址
PROMPT_ENGINE_API_URL=http://localhost:8080/api

# API密钥(如果需要)
# PROMPT_ENGINE_API_KEY=your_api_key_here

# 默认配置
PROMPT_ENGINE_DEFAULT_CATEGORY=AI助手
PROMPT_ENGINE_DEFAULT_DOMAIN=general
PROMPT_ENGINE_DEFAULT_DOMAIN_TYPE=GENERAL
PROMPT_ENGINE_AUTO_SAVE=false

3. 构建项目

npm run build

在Cursor中使用

1. 配置MCP服务器

在Cursor设置中,添加MCP服务器配置:

{
  "mcpServers": {
    "prompt-engine": {
      "command": "node",
      "args": ["dist/index.js"],
      "cwd": "/path/to/your/mcp-prompt-server",
      "env": {
        "PROMPT_ENGINE_API_URL": "http://localhost:8080/api",
        "PROMPT_ENGINE_DEFAULT_CATEGORY": "AI助手",
        "PROMPT_ENGINE_DEFAULT_DOMAIN": "general",
        "PROMPT_ENGINE_DEFAULT_DOMAIN_TYPE": "GENERAL"
      }
    }
  }
}

2. 重启Cursor

配置完成后重启Cursor即可使用。

在Trae中使用

1. 添加MCP服务器

在Trae的设置中添加MCP服务器:

  • 服务器路径: /path/to/your/mcp-prompt-server/dist/index.js
  • 启动命令: node
  • 环境变量: 按需配置

2. 重启Trae

配置完成后重启Trae即可使用。

使用示例

在AI对话中使用

  1. 自动分析并保存prompt:

    请使用auto_save_prompt工具保存这个prompt:
    "请帮我写一个Python函数,用于计算斐波那契数列"
  2. 只分析不保存:

    请使用analyze_prompt工具分析这个prompt的分类和标签
  3. 自定义保存:

    请使用save_prompt工具保存,标题为"斐波那契计算器",分类为"编程"

快速启动

使用提供的启动脚本:

./start.sh

故障排除

常见问题

  1. 连接PromptEngine API失败

    • 检查API地址是否正确
    • 确认PromptEngine服务器已启动
    • 检查网络连接
  2. 保存失败

    • 检查API密钥配置
    • 确认用户权限
    • 查看服务器日志
  3. MCP服务器无法启动

    • 检查Node.js版本(推荐16+)
    • 确认依赖已安装
    • 检查文件权限

日志查看

服务器日志会输出到stderr,可以通过以下方式查看:

./start.sh 2>&1 | tee server.log

开发和扩展

项目结构

mcp-prompt-server/
├── src/
│   ├── config/          # 配置管理
│   ├── services/        # 业务服务
│   ├── tools/           # MCP工具定义
│   ├── types/           # 类型定义
│   └── index.ts         # 入口文件
├── dist/                # 编译输出
├── package.json
├── tsconfig.json
├── start.sh            # 启动脚本
├── env.example         # 配置模板
├── mcp-config.json     # MCP配置示例
└── README.md

添加新工具

  1. src/tools/promptTools.ts 中添加工具定义
  2. 实现工具逻辑
  3. 重新构建项目

扩展分析能力

可以在 src/services/promptEngine.ts 中的 analyzePrompt 方法中:

  • 集成更强大的AI分析服务
  • 添加更复杂的关键词匹配
  • 实现机器学习分类器

许可证

MIT License

支持

如有问题请创建Issue或联系开发团队。