Provides direct API integration for prompt refinement using Google's Gemini models (2.0 Flash, 1.5 Pro), enabling LLM-powered prompt optimization and analysis.
Provides direct API integration for prompt refinement using OpenAI models (GPT-4o, GPT-4o-mini, GPT-4 Turbo), enabling LLM-powered prompt optimization and analysis.
Provides session store support for distributed multi-instance deployments and caching of refined prompts to improve performance.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PromptTuner MCPrefine this prompt to make it clearer and more effective"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PromptTuner MCP
PromptTuner MCP is an MCP server that fixes and boosts prompts using OpenAI, Anthropic, or Google Gemini.
What it does
Validates and trims input prompts (enforces
MAX_PROMPT_LENGTH).Wraps the prompt as JSON inside sentinel markers (sanitizing markers, bidi control chars, and null bytes).
Calls the selected provider.
Normalizes LLM output (strips code fences / labels if present).
Returns human-readable text plus machine-friendly
structuredContent.
Features
Polish and refine a prompt for clarity and flow (
fix_prompt).Boost and enhance a prompt for clarity and effectiveness (
boost_prompt).Craft a reusable workflow prompt for complex tasks (
crafting_prompt).Simple structured outputs.
Retry logic with exponential backoff for transient provider failures.
Quick Start
PromptTuner runs over stdio only. The dev:http and start:http scripts are compatibility aliases (no HTTP transport yet).
Claude Desktop
Add to claude_desktop_config.json:
Replace the API key and provider with your preferred LLM. Only configure the key for the active provider.
Configuration
PromptTuner uses minimal configuration. Set the provider and API key, and you're ready to go.
Variable | Default | Description |
|
|
|
| - | Required for all tools when |
| - | Required for all tools when |
| - | Required for all tools when |
| - | Override the default model. |
|
| Enable debug logging. |
All tools are LLM-backed and require an API key for the selected provider.
Default Models
Provider | Default Model |
|
|
|
|
|
|
CLI Options
Flag | Description |
| Show help text. |
| Print version. |
| Enable/disable debug logging. |
|
|
| Override the default model. |
Tools
All tools accept plain text, Markdown, or XML prompts. Responses include content (human-readable) and structuredContent (machine-readable).
Inputs are strict: extra fields are rejected. For fix_prompt/boost_prompt, only the prompt field is accepted.
fix_prompt
Polish and refine a prompt for clarity and flow while preserving intent and structure.
Parameter | Type | Required | Notes |
| string | Yes | Trimmed, length-checked; extra fields rejected. |
Returns: ok, fixed.
boost_prompt
Refine and enhance a prompt for clarity and effectiveness.
Parameter | Type | Required | Notes |
| string | Yes | Trimmed, length-checked; extra fields rejected. |
Returns: ok, boosted.
crafting_prompt
Generate a structured, reusable workflow prompt for complex tasks based on a raw request and a few settings.
Parameter | Type | Required | Notes |
| string | Yes | Trimmed, length-checked; strict input. |
| string | No | Hard requirements to enforce (bullet list recommended). |
| string | No |
|
| string | No |
|
| string | No |
|
| string | No |
|
Returns: ok, prompt, settings.
Response Format
content: array of content blocks. First block is JSON forstructuredContent, second is a short human message (orError: ...).structuredContent: machine-parseable results.Errors return
structuredContent.ok=falseand anerrorobject withcode,message, optionalcontext(sanitized, up to 200 chars),details, andrecoveryHint.Error responses also include
isError: true.
Development
Prerequisites
Node.js >= 22.0.0
npm
Scripts
Command | Description |
| Compile TypeScript and set permissions. |
| Build on install (publishing helper). |
| Run from source in watch mode. |
| Alias of |
| TypeScript compiler in watch mode. |
| Run the compiled server from |
| Alias of |
| Run |
| Run |
| Run |
| Run ESLint. |
| Run Prettier. |
| TypeScript type checking. |
| Run MCP Inspector against |
| Alias of |
| Run jscpd duplication report. |
| Lint, type-check, and build before publish. |
Project Structure
Security
API keys are supplied only via environment variables.
Inputs are validated with Zod and additional length checks.
Error context is included in debug mode (sanitized and truncated to 200 chars).
Google safety filters are always enabled.
Contributing
Pull requests are welcome. Please include a short summary, tests run, and note any configuration changes.
License
MIT License. See LICENSE for details.