Skip to main content
Glama
ramvishvas

prompt-enhancement-mcp-server

by ramvishvas

Prompt Enhancement MCP Server

An MCP (Model Context Protocol) server that enhances user prompts using AI. It takes a rough prompt and returns a more detailed, clear, and effective version. Works with any MCP-compatible client like Claude Desktop or Claude Code.

Quick Start

  1. Install and set your API key:

    export ANTHROPIC_API_KEY=sk-ant-...
  2. Add to your MCP client config (e.g. Claude Desktop):

    {
      "mcpServers": {
        "prompt-enhancer": {
          "command": "npx",
          "args": ["-y", "prompt-enhancement-mcp-server"],
          "env": {
            "ANTHROPIC_API_KEY": "your-key-here"
          }
        }
      }
    }
  3. Use the enhance_prompt tool to improve any prompt.

Related MCP server: Refine Prompt

Installation

# Run directly with npx (recommended)
npx -y prompt-enhancement-mcp-server

# Or install globally
npm install -g prompt-enhancement-mcp-server

# Or install locally
npm install prompt-enhancement-mcp-server

Supported Providers

Provider

Env Variable

Default Model

Anthropic

ANTHROPIC_API_KEY

claude-sonnet-4-5-20250929

OpenAI

OPENAI_API_KEY

gpt-4o

OpenRouter

OPENROUTER_API_KEY

anthropic/claude-sonnet-4-5-20250929

Gemini

GEMINI_API_KEY

gemini-2.0-flash

OpenAI-compatible

OPENAI_COMPATIBLE_API_KEY

gpt-3.5-turbo

Set at least one API key as an environment variable.

Configuration

Environment Variables

# API keys (set at least one)
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...
OPENROUTER_API_KEY=sk-or-...
GEMINI_API_KEY=...

# Optional settings
PROMPT_ENHANCER_DEFAULT_PROVIDER=anthropic   # Which provider to use by default
PROMPT_ENHANCER_CONFIG=/path/to/config.json  # Custom config file path
PROMPT_ENHANCER_LOG_LEVEL=info               # debug, info, warn, error

Optional Config File

Create ~/.config/prompt-enhancer/config.json for model defaults, custom templates, or OpenAI-compatible endpoints:

{
  "defaultProvider": "anthropic",
  "providers": {
    "anthropic": {
      "model": "claude-sonnet-4-5-20250929",
      "temperature": 0.7,
      "maxTokens": 4096
    },
    "openai": {
      "model": "gpt-4o"
    },
    "openrouter": {
      "model": "anthropic/claude-sonnet-4-5-20250929",
      "baseUrl": "https://openrouter.ai/api/v1"
    },
    "gemini": {
      "model": "gemini-2.0-flash"
    }
  },
  "templates": {
    "default": "Generate an enhanced version of this prompt (reply with only the enhanced prompt - no conversation, explanations, lead-in, bullet points, placeholders, or surrounding quotes):\n\n${userInput}"
  },
  "options": {
    "maxContextMessages": 10,
    "contextTruncateLength": 500
  }
}

API keys are never stored in the config file -- always use environment variables.

Tool: enhance_prompt

The server exposes a single MCP tool:

Parameter

Type

Required

Description

text

string

Yes

The prompt text to enhance

provider

string

No

Provider to use (anthropic, openai, openrouter, gemini, openai-compatible)

model

string

No

Model override (e.g. gpt-4-turbo)

context

array

No

Conversation history ([{role, content}]) for context

template

string

No

Custom template. Use ${userInput} as placeholder

Claude Desktop Integration

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "prompt-enhancer": {
      "command": "npx",
      "args": ["-y", "prompt-enhancement-mcp-server"],
      "env": {
        "ANTHROPIC_API_KEY": "your-key-here"
      }
    }
  }
}

Claude Code Integration

Add to ~/.claude/claude_code_config.json or your project's .mcp.json:

{
  "mcpServers": {
    "prompt-enhancer": {
      "command": "npx",
      "args": ["-y", "prompt-enhancement-mcp-server"],
      "env": {
        "OPENAI_API_KEY": "your-key-here",
        "PROMPT_ENHANCER_DEFAULT_PROVIDER": "openai"
      }
    }
  }
}

Custom Templates

Override the default enhancement template via the config file or the template tool parameter:

{
  "templates": {
    "default": "Rewrite this prompt to be more specific and actionable:\n\n${userInput}"
  }
}

Or pass inline when calling the tool:

{
  "text": "write a web app",
  "template": "Add technical details and edge cases to this prompt:\n\n${userInput}"
}

OpenAI-Compatible Endpoints

Connect to Ollama, LM Studio, vLLM, or any OpenAI-compatible API:

{
  "providers": {
    "openai-compatible": {
      "baseUrl": "http://localhost:11434/v1",
      "model": "llama3"
    }
  }
}

Then use it:

{
  "text": "write a function",
  "provider": "openai-compatible"
}

Troubleshooting

"Unsupported provider" error Check that the provider name is one of: anthropic, openai, openrouter, gemini, openai-compatible.

"API key is required" / authentication errors Make sure the corresponding environment variable is set. API keys are loaded from env vars, not the config file.

Timeouts or rate limit errors The server retries transient errors up to 3 times with exponential backoff. If you're consistently hitting rate limits, try a different provider or model.

No output / server won't start Check PROMPT_ENHANCER_LOG_LEVEL=debug for detailed logging. Logs go to stderr (MCP protocol reserves stdout for communication).

Development

git clone <repo-url>
cd prompt-enhancement-mcp-server
npm install
npm run build
npm test

License

Apache-2.0

Available Tools

1 tool
enhance_promptC

Enhances a user prompt using AI to make it more detailed, clear, and effective

ParametersJSON Schema
NameRequiredDescriptionDefault
textYesThe prompt text to enhance
modelNoModel to use, overriding provider default (optional)
contextNoOptional conversation history for context
providerNoAI provider to use (optional, uses default if not specified)
templateNoCustom enhancement template. Use ${userInput} as placeholder. (optional)

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full burden but discloses almost nothing: it doesn't mention latency (AI call), cost, whether the original prompt is preserved, what the output looks like, or any rate limits. 'Using AI' implies an external call but no behavioral details follow.

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?

A single efficient sentence that front-loads the core action and outcome. No wasted words or structural issues.

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?

For a 5-parameter AI tool with no annotations and no output schema, the description is insufficient. It omits important behavioral context such as output format, whether context/template alter behavior, and any constraints on the AI enhancement process.

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 coverage is 100%, so the schema already documents all five parameters with descriptions and enums. The description adds no parameter-specific meaning beyond what the schema provides, which meets the baseline of 3 when coverage is high.

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 states a specific verb ('Enhances') and resource ('a user prompt') with clarifying goals ('more detailed, clear, and effective'). It is clear what the tool does, though no sibling tools exist to differentiate from.

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 guidance is provided on when to use this tool versus alternatives, what prerequisites exist, or when not to use it. The description simply states the capability without any context for decision-making.

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.

  1. 1 tool updatev1.0.1
    • First observedenhance_prompt

TDQS

B3.2/5.0

Scored across 1 tool

Disambiguation5/5

There is only one tool, so there is no possibility of misselection or overlap. Its purpose is unambiguous.

Naming Consistency5/5

The single tool follows a clean verb_noun snake_case convention (enhance_prompt). No inconsistencies are possible with one tool.

Tool Count3/5

One tool matches the narrowly stated purpose but is thin even for that scope. There is no room for variants (e.g. tone, length, format options) that a prompt-enhancement service would plausibly offer.

Completeness3/5

The core enhancement operation is covered, but the surface is a single dead-end call with no options for enhancement style, target format, or refinement iterations. Usable but notably shallow for the domain.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    This MCP server provides research-backed prompt optimization tools and professional domain templates designed to improve AI performance through strategies like Tree of Thoughts and Medprompt. It enables users to analyze, auto-optimize, and refine prompts using advanced reasoning patterns and safety-critical alignment techniques.
    25
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    An MCP server that uses Claude 3.5 Sonnet to transform ordinary prompts into structured, professionally engineered instructions for any LLM. It enhances AI interactions by adding context, requirements, and structural clarity to raw user inputs.
    1
    3
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    An MCP server that transforms vague prompts into platform-optimized prompts for 58 AI platforms across 7 categories. Send a raw prompt. Get back a version specifically optimized for Midjourney, DALL-E, Sora, Runway, ElevenLabs, Claude, ChatGPT, or any of the 58 supported platforms — with the right syntax, parameters, and structure each platform expects.
    23
    62 npm
    12
    Apache 2.0