Skip to main content
Glama
gr3enarr0w

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: Promptheus

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
sessionIdYesThe session ID for this prompt engineering session
answersYesAnswers to the previously asked questions

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions providing answers and continuing a process, but lacks details on permissions, side effects, response format, or session management. This is inadequate for a tool with two required parameters and no output schema, leaving key behavioral traits unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the tool's function without unnecessary words. It is appropriately sized and front-loaded, though it could be more structured by explicitly separating purpose from guidelines.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity with two required parameters, no annotations, and no output schema, the description is incomplete. It fails to explain return values, error handling, or how it integrates with sibling tools, leaving significant gaps for an AI agent to understand its full context and usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters (sessionId and answers). The description adds no additional meaning beyond implying that answers are for clarifying questions in a prompt engineering context, which is minimal value. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'provide answers to clarifying questions and continue the prompt engineering process,' which gives a vague purpose but doesn't specify what resource or action it performs beyond general continuation. It doesn't clearly distinguish from sibling tools like 'ask_clarification' or 'engineer_prompt,' leaving ambiguity about its specific role in the workflow.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives is provided. The description implies usage in a prompt engineering session with clarifying questions, but it doesn't specify prerequisites, exclusions, or how it differs from siblings like 'ask_clarification' or 'auto_optimize,' offering minimal direction for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

ask_clarificationC

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

ParametersJSON Schema
NameRequiredDescriptionDefault
sessionIdYesThe session ID for this prompt engineering session
questionsYesList of clarifying questions to ask the user

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool asks questions to understand requirements, but doesn't reveal key traits: e.g., whether this is an interactive process with the user, how responses are handled, if there are rate limits, or what the expected outcome is. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the purpose clearly without unnecessary words. It's appropriately sized for a simple tool, but could be slightly improved by front-loading more specific context or usage hints to enhance clarity immediately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (involving user interaction and prompt refinement), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects, usage context, or expected outcomes, making it inadequate for an AI agent to fully understand how to invoke and interpret this tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('sessionId' and 'questions') with descriptions. The description adds no additional meaning beyond what the schema providesβ€”it doesn't explain the format of questions, how they relate to the session, or any constraints. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Ask clarifying questions to better understand user requirements and refine the prompt engineering process.' It specifies the verb ('ask') and the resource ('clarifying questions'), and it connects to the broader context of prompt engineering. However, it doesn't explicitly differentiate from sibling tools like 'answer_questions' or 'engineer_prompt', which might also involve user interaction or prompt refinement, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions 'refine the prompt engineering process,' but doesn't specify scenarios, prerequisites, or exclusions. For example, it doesn't indicate if this should be used before 'engineer_prompt' or as an alternative to 'auto_optimize,' leaving the agent without clear usage instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
textYesThe natural language text to analyze and potentially optimize
contextNoAny additional context about the current project or situation
interactiveNoWhether to enable interactive questioning if the prompt is unclear or needs more info (default: auto-detect based on complexity)

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. While it mentions the tool 'automatically detects and optimizes,' it doesn't describe what optimization entails, whether it modifies the input text, what the output format is, or any limitations like rate limits or authentication requirements. This leaves significant behavioral aspects unclear.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise and well-structured with just two sentences. The first sentence states the purpose, and the second provides usage guidance. Every word earns its place with no wasted text or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of an optimization tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what 'optimized for Claude Code' means, what the output looks like, or any behavioral characteristics. For a tool that presumably transforms text, more context about the transformation process and results is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so the schema already documents all three parameters thoroughly. The description doesn't add any additional meaning or context about the parameters beyond what's in the schema, which is acceptable but not exceptional given the high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Automatically detects and optimizes natural language text for Claude Code.' It specifies both the action (detects and optimizes) and the resource (natural language text), though it doesn't explicitly differentiate from sibling tools like 'engineer_prompt' which might have overlapping functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context: 'Use this when the user is writing conversational text that should be translated into an optimized prompt.' This gives specific guidance on when to use the tool, though it doesn't explicitly mention when NOT to use it or name alternatives among the sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

engineer_promptB

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

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesThe raw user prompt that needs engineering
languageNoThe programming language (optional, will be detected if not provided)
contextNoAdditional context about the codebase or project (optional)
interactiveNoWhether to enable interactive Q&A refinement (default: false)

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions 'interactive refinement' and 'automatic optimization,' which gives some behavioral context, but lacks details on how the optimization works, what 'maximum effectiveness' entails, potential rate limits, authentication needs, or output format. For a tool with no annotations, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. It avoids redundancy and wastes no words, making it easy to parse. However, it could be slightly more structured by separating key features for clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and 4 parameters with full schema coverage, the description is minimally adequate. It covers the tool's purpose and hints at behavior but lacks details on output, optimization specifics, and error handling. For a tool with interactive and optimization features, more context would be beneficial to ensure complete understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional meaning beyond what's in the schema (e.g., it doesn't explain how 'interactive' refinement works in practice). With high schema coverage, the baseline is 3, as the description doesn't compensate with extra insights.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Intelligently engineers and optimizes prompts for Claude Code' with specific verbs ('engineers', 'optimizes') and resource ('prompts'). It distinguishes from sibling tools like 'answer_questions' and 'ask_clarification' by focusing on prompt engineering rather than direct Q&A. However, it doesn't explicitly differentiate from 'auto_optimize', which might have overlapping functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage through phrases like 'interactive refinement' and 'automatic optimization for maximum effectiveness,' suggesting when interactive mode might be beneficial. However, it doesn't explicitly state when to use this tool versus alternatives like 'auto_optimize' or provide clear exclusions. The guidance is present but not comprehensive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updates
    • First observedanswer_questions
    • First observedask_clarification
    • First observedauto_optimize
    • First observedengineer_prompt

TDQS

B3.2/5.0
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 issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    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.
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gr3enarr0w/cc_peng_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server