Back to MCP directory
publicPublicdnsLocal runtime

prompt-engineer-mcp-server

一个基于Claude AI的MCP服务器,用于优化编程提示词,提升在Cursor等AI IDE中的使用效果。

article

README

🚀 代码提示工程师 MCP 服务器

此 MCP 服务器为优化与 Cursor AI 及其他 AI IDE 的交互效果提供了有力工具,借助 Anthropic 的 Claude 模型对代码提示进行重写,能显著提升代码提示的质量与适用性。

🚀 快速开始

本 MCP 服务器可通过简单步骤完成安装与启动,以下为您详细介绍。

📦 安装指南

常规安装

npm install

通过 Smithery 安装

您可通过访问以下链接,直接在 Smithery 上安装此 MCP 服务器: https://smithery.ai/server/@hireshBrem/prompt-engineer-mcp-server

💻 使用示例

设置环境变量

该服务器需借助 Anthropic API 密钥,以使用 Claude 进行格式化操作。请按如下设置:

export ANTHROPIC_API_KEY=your_anthropic_api_key

若未提供 API 密钥,服务器将抛出缺少密钥的错误。

启动服务器

npm start

或者通过 MCP 检查器启动:

npx @modelcontextprotocol/inspector npm start

工具:rewrite_coding_prompt

此工具可将原始提示重写为适合 Cursor AI 和其他 AI IDE 的优化版本。

参数

  • prompt(必需):需要重写的原始用户提示
  • language(必需):目标代码的编程语言

示例用法

{
  "name": "rewrite_coding_prompt",
  "arguments": {
    "prompt": "创建一个函数,用于在摄氏度和华氏度之间转换温度",
    "language": "typescript"
  }
}

示例

输入:

创建一个函数,用于将一组对象按特定属性排序

带有参数:

{
  "prompt": "Create a function that sorts an array of objects by a specific property",
  "language": "typescript"
}

工具会将提示重写为更具结构化和详细的形式,以便更好地与您的 AI IDE 进行交互。

🔧 技术细节

工作原理

服务器运用 Claude 3 Sonnet 智能体重写提示,以实现最佳效果。它通过以下方式增强提示:

  1. 添加清晰的结构和上下文
  2. 明确要求和期望
  3. 考虑语言特定因素
  4. 优化 AI IDE 的理解

✨ 主要特性

  • 智能提示工程:借助 Claude 3 Sonnet 模型优化提示效果。
  • 语言感知:依据目标编程语言定制提示内容。
  • 轻松集成:与 Cursor 和其他 AI IDE 实现平滑兼容。
  • 低温度设置:采用 0.2 的温度值,以获取一致且结构化的输出。

📚 详细文档

配置

与 Claude Desktop 结合使用

将以下内容添加到您的 claude_desktop_config.json 文件:

{
  "mcpServers": {
    "cursor-prompt-engineer": {
      "command": "npx",
      "args": [
        "-y",
        "cursor-prompt-engineer"
      ]
    }
  }
}

本地安装

# 克隆仓库
git clone https://github.com/yourusername/cursor-prompt-engineer.git
cd cursor-prompt-engineer

# 安装依赖项
npm install

# 启动服务器
node index.js

📄 许可证

此 MCP 服务器依据 MIT 许可证发布,这意味着您可自由使用、修改和分发该软件,但需遵守 MIT 许可证的条款和条件。更多细节请参阅项目存储库中的 LICENSE 文件。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client