Skip to main content
Glama
Claude Code Prompt Engineer

Claude Code Prompt Engineer

by gr3enarr0w

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

Related MCP server: Coding Prompt Engineer MCP Server

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_optimize ⭐ Primary 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.

Available Tools

4 tools
answer_questionsC

Provide answers to clarifying questions and continue the prompt engineering process.

Inputs: sessionId (required), answers (required).

ask_clarificationC

Ask clarifying questions to better understand user requirements and refine the prompt engineering process.

Inputs: sessionId (required), questions (required).

auto_optimizeB

Automatically detects and optimizes natural language text for Claude Code. Use this when the user is writing conversational text that should be translated into an optimized prompt.

Inputs: text (required), context, interactive.

engineer_promptB

Intelligently engineers and optimizes prompts for Claude Code, with interactive refinement and automatic optimization for maximum effectiveness.

Inputs: prompt (required), language, context, interactive.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 4 tools

    Disambiguation3/5

    There is some overlap between tools, particularly 'auto_optimize' and 'engineer_prompt' both involving prompt optimization, which could cause confusion. However, 'answer_questions' and 'ask_clarification' are clearly distinct, and descriptions help differentiate the optimization tools by specifying different use cases (natural language text vs. general prompt engineering).

    Naming Consistency4/5

    The tools follow a consistent verb_noun pattern throughout (e.g., answer_questions, ask_clarification, auto_optimize, engineer_prompt), with all using snake_case. There is a minor deviation in that 'auto_optimize' and 'engineer_prompt' are more descriptive phrases rather than simple verb_noun combos, but the overall naming is predictable and readable.

    Tool Count5/5

    With 4 tools, this is a well-scoped set for a Claude Code prompt engineering server. Each tool appears to serve a distinct purpose in the workflow (clarifying, optimizing, engineering), and the count is neither too thin nor too heavy, fitting the domain appropriately.

    Completeness4/5

    The tool surface covers key aspects of prompt engineering: gathering requirements (ask_clarification), providing feedback (answer_questions), and optimization (auto_optimize and engineer_prompt). A minor gap might be the lack of a tool for testing or evaluating prompts, but the core workflow is well-covered, and agents can likely work around this.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Refines and optimizes prompts for LLMs through adaptive questioning and intelligent clarification workflows. Supports multiple AI providers (Google, OpenAI, Anthropic, Groq, Qwen) with interactive prompt enhancement and targeted modifications.
      17
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides AI-powered selection and generation of specialized system prompts from a database of over 66 templates for Claude Code. It uses semantic search to find the best matching template and can adapt it to fit specific user tasks and contexts.
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables Claude Code users to decompose raw prompts into typed structured blocks, compile those blocks into Claude-optimized XML prompts with token estimates, and list all available block types and their canonical ordering — all directly inside a conversation without a browser or copy-paste.
      MIT