Claude Code Prompt Engineer

Claude Code Prompt Engineer

Intelligently engineers and optimizes prompts for Claude Code with automatic language detection, task type recognition, and interactive refinement capabilities. Works entirely offline without external API dependencies to transform natural language requests into structured, Claude Code-optimized prompts.

Category
访问服务器

README

Claude Code Prompt Engineer MCP Server

An advanced Model Context Protocol (MCP) server that intelligently engineers and optimizes prompts for Claude Code, with interactive refinement capabilities and automatic optimization.

Features

🚀 Intelligent Prompt Engineering

  • Automatically detects programming language and task type
  • Optimizes prompts specifically for Claude Code's capabilities
  • Leverages knowledge of Claude Code's tools and workflows

🤖 Interactive Refinement

  • Q&A-based prompt clarification system
  • Context-aware question generation
  • Session-based refinement process

Automatic Optimization

  • Language-specific prompt enhancement
  • Task complexity detection
  • Claude Code capability awareness
  • No external API dependencies - works entirely with built-in capabilities

Installation & Setup

1. Install Dependencies

npm install

2. Configure Claude Code

Create or update your .mcp.json configuration file:

{
  "mcpServers": {
    "prompt-engineer": {
      "command": "node",
      "args": ["/absolute/path/to/cc_peng_mcp/index.ts"],
      "env": {}
    }
  }
}

3. Restart Claude Code

# Exit current session and start new one
claude

4. Verify Installation

/mcp

You should see prompt-engineer listed as connected.

Usage with Claude Code

🎯 Auto-Optimization (Primary Usage)

Simply use the tools directly - no setup required:

Use the auto_optimize tool to analyze: "fix my React app performance issues"

Interactive Mode for Complex Requests

Use the engineer_prompt tool with interactive=true for: "create a new authentication system"

Direct Prompt Engineering

Use the engineer_prompt tool with prompt="optimize my database queries" and language="python"

Available Tools

auto_optimizePrimary Tool

Automatically detects and optimizes natural language text:

  • text (required): Your natural language text/request
  • context (optional): Additional project context
  • interactive (optional): Force interactive questioning

engineer_prompt

Manual prompt engineering with specific parameters:

  • prompt (required): The raw user prompt that needs engineering
  • language (optional): Programming language (auto-detected if not provided)
  • context (optional): Additional project context
  • interactive (optional): Enable Q&A refinement process

answer_questions

Used to provide answers during interactive sessions:

  • sessionId (required): Session ID from interactive mode
  • answers (required): Array of answers to the questions

How It Works

1. Natural Language Detection

The system automatically identifies when your text is natural language that needs optimization by detecting:

  • Request patterns: "help me", "can you", "i need", "i want"
  • Problem descriptions: "issue", "bug", "not working", "broken"
  • Task indicators: "create", "build", "fix", "optimize"
  • Questions: "how do", "what is", "why is"
  • Conversational markers: "i'm", "i think", "not sure"

2. Built-in Intelligence

  • No API calls required - uses pattern matching and rule-based optimization
  • Language detection via regex patterns for 10+ programming languages
  • Task type detection (debug, test, refactor, explain, architecture)
  • Complexity analysis based on text length and technical indicators

3. Claude Code Optimization

Prompts are optimized knowing Claude Code's capabilities:

  • File system operations (Read, Write, Edit)
  • Code search (Grep, Glob patterns)
  • Git operations and workflow management
  • Todo list management for complex tasks
  • Browser automation via Playwright MCP
  • GitHub integration

4. Interactive Refinement

When needed, the system:

  • Generates clarifying questions based on your prompt
  • Creates a session to track the conversation
  • Refines the prompt based on your answers
  • Delivers a highly optimized final prompt

Example Workflows

🎯 Auto-Optimization Example

Input:

"my website is slow and users are complaining"

Auto-Optimized Output:

**Task:** Debug and fix the following issue:

my website is slow and users are complaining

**Requirements:**
- Use file search tools (Grep/Glob) to locate relevant code
- Read and analyze the problematic files
- Identify the root cause and implement a fix
- Test the solution if possible

**Ready to proceed with this task?**

🤖 Interactive Mode Example

Input: "make my app better"

Questions Generated:

  1. What specific aspect needs improvement (performance, readability, maintainability)?
  2. What technology stack or programming language are you using?
  3. Are there any constraints or requirements I should know about?

After Answers: Creates detailed, structured prompt with your specific requirements.

Benefits

No Setup Required: Works immediately after MCP configuration
No API Keys: Uses only built-in Claude Code capabilities
Context Aware: Understands your project and requirements
Interactive: Asks clarifying questions when needed
Systematic: Structures complex requests properly
Fast: No external API calls for instant optimization

Requirements

  • Node.js 16+
  • TypeScript support (tsx recommended)
  • Claude Code CLI
  • No external API keys required

Technical Details

Supported Languages

  • JavaScript/Node.js, TypeScript, Python, Java, C++, Rust, Go, PHP, Ruby, C#/.NET

Task Types

  • Debug: Bug fixing and error resolution
  • Test: Unit testing and test creation
  • Refactor: Code improvement and restructuring
  • Explain: Code explanation and documentation
  • Architecture: System design and patterns
  • Code: General coding tasks (default)

Architecture

  • Pure pattern matching - no machine learning models
  • Rule-based optimization - deterministic and fast
  • Session management - for interactive conversations
  • Built-in language detection - regex-based patterns

License

MIT License - feel free to modify and distribute.

Installation Guide

See INSTALL.md for detailed installation instructions, troubleshooting, and advanced configuration options.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选