home / mcp / prompt auto-optimizer mcp server

Prompt Auto-Optimizer MCP Server

An MCP Server that optimizes prompts using the GEPA method.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "sloth-wq-prompt-auto-optimizer-mcp": {
      "command": "npm",
      "args": [
        "run",
        "mcp:start"
      ],
      "env": {
        "GEPA_DEFAULT_GENERATIONS": "10",
        "GEPA_DEFAULT_POPULATION_SIZE": "20",
        "GEPA_MAX_CONCURRENT_PROCESSES": "3"
      }
    }
  }
}

This MCP server automatically evolves AI prompts using genetic algorithms, helping you boost performance, creativity, and reliability across tasks. You run the server locally and connect to it with an MCP client to guide prompt optimization in an automated loop.

How to use

You interact with the server through an MCP client to manage prompt evolution tasks. Start an evolution task with your description of what you want to optimize, then record how prompts perform, analyze failures, and pull out the best prompts for deployment.

How to install

Prerequisites: you need Node.js and npm installed on your system.

1. Clone the project repository.

2. Install dependencies.

3. Build the project.

4. Start the MCP server.

Available tools

gepa_start_evolution

Start optimizing a prompt using evolutionary algorithms. Accepts a task description, optional seed prompt, and configuration for population size, generations, and mutation rate.

gepa_evaluate_prompt

Evaluate how a prompt performs on specified tasks, returning performance metrics for given task IDs.

gepa_reflect

Analyze test trajectories to identify why prompts fail and generate improvement suggestions at a chosen analysis depth.

gepa_get_pareto_frontier

Compute and return the best prompt candidates that balance multiple goals like performance and creativity.

gepa_select_optimal

Select the optimal prompt for a given use case based on task context and weighted criteria for performance and diversity.

gepa_record_trajectory

Log the results of prompt executions for later analysis, including execution steps and outcomes.

gepa_create_backup

Save the current optimization state for recovery and versioning.

gepa_restore_backup

Restore a previously saved optimization state from backups.

gepa_list_backups

List available backups for quick recovery.

gepa_recovery_status

Check the health status of the MCP-based system.

gepa_integrity_check

Verify data integrity across the optimization state and records.