clarifyprompt — Claude Code MCP server: compile prompts per platform
Turns a vague prompt into one shaped for a specific platform's syntax and parameters, using signals from your workspace.
claude mcp add clarifyprompt -e LLM_API_URL=<LLM_API_URL> -e LLM_API_KEY=<LLM_API_KEY> -e LLM_MODEL=<LLM_MODEL> -- npx -y clarifyprompt-mcpWhat clarifyprompt does
Send the raw request. The server reads workspace files such as CLAUDE.md, AGENTS.md, .cursorrules and package.json, works out the intent, and returns a prompt built for the platform you picked. The pack covers chat models, coding assistants, image and video generators; each has its own syntax and knobs.
There is optimize_prompt with a platform argument, a critique_prompt call that scores six dimensions, and an auto_revise loop that keeps fixing weak spots. Hosts supporting the io.modelcontextprotocol/ui extension get a compose_prompt panel with a before/after view and Accept / Revise buttons. Three environment variables are required: LLM_API_URL, LLM_API_KEY, LLM_MODEL. The server calls a model with your key, so it won't start without them. Node.js 18 or newer is needed.
Leave the platform out and the output stays neutral, without any vendor's idioms. Useful when one request goes to several tools.
What it helps with
- rewrite a vague prompt to match a target platform's syntax
- pull
CLAUDE.mdandpackage.jsoninto the request text - compare original and optimized prompts before sending
- score a prompt on six dimensions and revise it
- keep output neutral when no platform is chosen
Example prompts for the agent
- Optimize this prompt for Midjourney: a ginger cat on a windowsill in morning light
- Call
optimize_promptwithplatform: "gpt-image"and keep the in-image text - Run
critique_prompton my prompt and list what to fix
How to install clarifyprompt
Platform CLI
claude mcp add clarifyprompt -e LLM_API_URL=<LLM_API_URL> -e LLM_API_KEY=<LLM_API_KEY> -e LLM_MODEL=<LLM_MODEL> -- npx -y clarifyprompt-mcpReplace <…> with your own values
Platform CLI
codex mcp add clarifyprompt --env LLM_API_URL=<LLM_API_URL> --env LLM_API_KEY=<LLM_API_KEY> --env LLM_MODEL=<LLM_MODEL> -- npx -y clarifyprompt-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"clarifyprompt": {
"command": "npx",
"args": [
"-y",
"clarifyprompt-mcp"
],
"env": {
"LLM_API_URL": "<LLM_API_URL>",
"LLM_API_KEY": "<LLM_API_KEY>",
"LLM_MODEL": "<LLM_MODEL>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"clarifyprompt": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"clarifyprompt-mcp"
],
"env": {
"LLM_API_URL": "<LLM_API_URL>",
"LLM_API_KEY": "<LLM_API_KEY>",
"LLM_MODEL": "<LLM_MODEL>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e LLM_API_URL=<LLM_API_URL> -e LLM_API_KEY=<LLM_API_KEY> -e LLM_MODEL=<LLM_MODEL> clarifyprompt npx -y clarifyprompt-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about clarifyprompt
How do I install clarifyprompt in Claude Code?
Run claude mcp add clarifyprompt -e LLM_API_URL=<LLM_API_URL> -e LLM_API_KEY=<LLM_API_KEY> -e LLM_MODEL=<LLM_MODEL> -- npx -y clarifyprompt-mcp. The stdio variant uses --env and --transport stdio instead of -e.
What does clarifyprompt do?
It takes a raw prompt, adds context from your project files, and returns a version tuned for the chosen platform, with its syntax and parameters.
What do I need before it works?
An endpoint and key in LLM_API_URL, LLM_API_KEY, LLM_MODEL, plus Node.js 18 or later. Model calls go through your own key.