home / mcp / 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.
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.
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.
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 buildAdd 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"
}
}
}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.
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.
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.
Analyzes a prompt to determine domain, calculate clarity scores, identify risks, and produce an optimized prompt with optional clarifying questions when needed.
References the autonomous workflow that combines research, verification, implementation, and documentation steps for prompt optimization.
Automatically identifies the domain of a request such as code, UX, data, writing, or research.
Calculates a 0-1 clarity score based on goal clarity, context completeness, format specification, success criteria, and technical detail.