home / mcp / mcp prompt optimizer mcp server

MCP Prompt Optimizer MCP Server

Provides an OTA-based prompt optimizer that analyzes prompts, detects risks, asks clarifying questions, and outputs optimized prompts for AI processing.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "grandinh-mcp-prompt-optimizer": {
      "command": "node",
      "args": [
        "/path/to/mcp-prompt-optimizer/dist/index.js"
      ]
    }
  }
}

You have an MCP server that automatically analyzes and optimizes AI prompts using the OTA (Optimize-Then-Answer) Framework. It helps you assess clarity, detect risks, ask clarifying questions when needed, and produce ready-to-use, domain-specific prompts that improve AI responses.

How to use

You can use this MCP server with your MCP client to analyze prompts, get structured optimizations, and run the prompt through your AI workflow. Start by preparing a prompt you want to optimize, then let the server classify its domain, score its clarity, flag risks, and output an enhanced prompt with any required domain-specific rules.

How to install

Prerequisites: Node.js and npm must be installed on your system.

# Clone the repository
git clone https://github.com/grandinh/mcp-prompt-optimizer.git
cd mcp-prompt-optimizer

# Install dependencies
npm install

# Build the project
npm run build

Add the MCP server configuration to your client’s config file as shown below.

{
  "mcpServers": {
    "prompt_optimizer": {
      "command": "node",
      "args": ["/path/to/mcp-prompt-optimizer/dist/index.js"],
      "description": "Optimizes prompts using the OTA Framework"
    }
  }
}

Configuration and startup

Restart your MCP client after adding the new server configuration. The server runs as a local process and is started via the runtime command shown above. You can then invoke the optimize_prompt tool through your MCP client to analyze prompts.

Usage patterns and examples

Use the optimize_prompt tool to analyze a prompt like: "build a dashboard". If you need to perform an autonomous flow, you can leverage multi-model approaches and structured outputs that reveal domain, clarity, and risks, followed by an enhanced prompt ready for processing.

Notes on tools and capabilities

This server provides core capabilities for prompt optimization, including domain detection, clarity scoring, risk detection, smart questions when needed, and domain-specific enhancements to the final prompt.

Available tools

optimize_prompt

Analyzes a prompt to determine domain, calculate clarity scores, identify risks, and produce an optimized prompt with optional clarifying questions when needed.

ori_command

References the autonomous workflow that combines research, verification, implementation, and documentation steps for prompt optimization.

DomainDetection

Automatically identifies the domain of a request such as code, UX, data, writing, or research.

ClarityScoring

Calculates a 0-1 clarity score based on goal clarity, context completeness, format specification, success criteria, and technical detail.