MC

MCP Server Prompt Enhancer: Structured AI Prompts

Enhance simple keywords or briefs on the MCP server into structured, detailed prompts that boost AI output quality, clarity, and predictability.

Quick Install
npx -y @FelixFoster/mcp-enhance-prompt

Overview

MCP Server Prompt Enhancer is a small server component for the Model Context Protocol (MCP) ecosystem that converts short briefs or keyword lists into fully structured prompts. It helps teams and integrations produce clearer, more predictable AI outputs by applying consistent prompt templates, constraints, and role/context segmentation before forwarding to an LLM.

For developers, this reduces variability when different consumers submit terse instructions. Instead of relying on ad-hoc user input, the enhancer expands and normalizes inputs into a repeatable prompt format that contains background context, task instructions, output schema, and example inputs. This is useful when you want dependable generation quality across services, pipelines, or microservices that feed an LLM.

Features

  • Expand brief keywords or short briefs into full multi-part prompts
  • Template-driven transformation with variables and conditional sections
  • Constraint and format enforcement (e.g., JSON schema, length limits)
  • HTTP API + simple CLI for local and CI usage
  • Configurable role segments: system, assistant, user, context
  • Output formats: plain text, structured JSON prompt, or MCP-compatible payload
  • Lightweight, runtime-agnostic (works with any LLM provider downstream)
  • Extensible: add custom templates and post-processing plugins

Installation / Configuration

Install from source or run via Docker. Clone the repository and start the server locally:

git clone https://github.com/FelixFoster/mcp-enhance-prompt.git
cd mcp-enhance-prompt
# using npm
npm install
npm run start

Run with Docker:

docker build -t mcp-enhance-prompt .
docker run -p 8080:8080 -e PORT=8080 mcp-enhance-prompt

Environment variables

# .env example
PORT=8080
DEFAULT_TEMPLATE=marketing-longform
MAX_PROMPT_TOKENS=4000
LOG_LEVEL=info

Example server configuration (YAML)

templates:
  marketing-longform:
    description: Expand a short brief into a blog-post prompt
    parts:
      - role: system
        content: "You are an expert technical copywriter."
      - role: user
        content: |
          Brief: {{brief}}
          Tone: {{tone | default("informal")}}
          Audience: {{audience | default("developers")}}
    constraints:
      max_words: 1200
      format: markdown

Available Tools / Resources

Endpoints

EndpointMethodPurpose
/enhancePOSTEnhance an input brief into a structured prompt
/templatesGET/POSTList or create prompt templates
/validatePOSTValidate generated prompt against schema/constraints
/healthGETHealth check

/enhance request (JSON)

{
  "template": "marketing-longform",
  "input": {
    "brief": "MCP server prompt enhancer",
    "tone": "professional"
  },
  "outputFormat": "mcp_payload"
}

/enhance response (JSON)

{
  "prompt": "System: You are an expert technical copywriter...\nUser: Brief: MCP server prompt enhancer\n...",
  "mcp": {
    "messages": [...],
    "metadata": {...}
  }
}

Resources included in the repo:

  • example templates
  • JSON schema examples for output validation
  • CLI for running quick enhancements locally

Use Cases

  1. Marketing copy generator

    • Input: brief “launch email for new auth SDK”
    • Workflow: send brief to /enhance with marketing template, forward resulting prompt to LLM
    • Result: consistent email structure, calls-to-action, and constraints on length and tone
  2. Code generation helper

    • Input: keywords “pagination, postgres, Go”
    • Workflow: use a code-template that includes role:system instructing best practices, required files, and test cases
    • Result: predictable scaffolding and testable output suitable for CI integration
  3. Data annotation prompt standardization

    • Input: short guideline like “label sentiment”
    • Workflow: expand into a prompt with explicit labels, examples, edge-case rules, and JSON schema for responses
    • Result: high inter-annotator reliability when using AI or human annotators
  4. Chat assistant prompt normalization

    • Input: terse user question forwarded from client apps
    • Workflow: enhancer injects context (user profile, recent messages), role instructions, and output constraints before sending to the model
    • Result: consistent assistant behavior across platforms

Example enhancement (curl)

curl -X POST http://localhost:8080/enhance \
  -H "Content-Type: application/json" \
  -d '{
    "template": "technical-article",
    "input": {"brief": "MCP Server Prompt Enhancer", "audience": "developers"}
  }'

Response contains the expanded prompt text and structured MCP payload ready for downstream use.

Tips for Developers

  • Start by customizing templates for your most common use cases (emails, docs, code).
  • Use the validate endpoint to enforce JSON schemas for downstream parsers.
  • Keep templates modular: separate system context, user instruction, and example blocks.
  • Test with different output formats to ensure your downstream LLM client accepts the payload.

This server is intended to sit between user input and your LLM client, standardizing and enriching prompts so model outputs are easier to predict and integrate into your applications.