Static linter for AI prompts: contradictions, redundancy, ambiguity, and fluff.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Lint AI prompts like code. Save tokens. Catch contradictions.
A static analyzer for AI prompts β system prompts, agent instructions, tool descriptions β that runs as a CLI and as an MCP server so Claude Code (or any MCP-aware agent) can lint prompts before sending them.
Run promptlint on a typical (silently broken) system prompt:
Two error-level contradictions caught, score clamped to 14/100, 60 tokens (16%) reclaimable via --trim.
And here's --trim in action on a small input:
See docs/promo/ for posting drafts and the (TODO) asciinema cast.
"be concise" + "be thorough" ships silently and
wastes tokens on every request. promptlint flags paired opposites
(length / tone / frequency / commenting / asking) as error.warn
apiece β delete one."use it" / "handle that" without a mid-sentence
referent is flagged with a line number. Start-of-sentence capitals do NOT
count as referents, so normal English doesn't false-positive.warn β examples are almost always trimmable to shape-only.Please / Thanks / I hope this helps / Let me know ifβ¦ / Feel free toβ¦ are detected, counted, and (with --trim)
stripped while keeping your actual imperatives intact.Scope: English prompts, prose β not source code. A Japanese prompt or a file of JavaScript will look clean even if it isn't.
Install both the CLI and the MCP server in one go:
Two binaries are placed on your $PATH:
| Bin | What it is |
|---|---|
promptlint | the CLI (lint a file or stdin) |
promptlint-mcp | the MCP server (stdio transport) |
Requires Node >= 18. Zero runtime deps other than the MCP SDK.
A clean prompt (see examples/good-prompt.md) returns score 100/100 with
zero issues β silence is a feature.
--json for machine consumptionEmpty input adds "note": "empty input". Pure-fluff input (e.g. "Thanks!")
that would otherwise trim to empty instead returns the original with
"trimmerFallback": true β a safe drop-in never hands a blank prompt to your
LLM.
--trim to print trimmed output (for piping)Fenced code blocks are preserved verbatim. Quoted strings ("β¦") and inline
backticks (`β¦`) are masked before fluff removal so example text survives
untouched.
The report header shows promptlint <stdin>.
| Code | Meaning |
|---|---|
| 0 | no errors (warn/info ok) |
| 1 | at least one error-severity issue |
| 2 | bad usage (missing file, read failure, etc.) |
Register with Claude Code in one command (no clone, no global install needed):
Or add this to ~/.claude.json (user scope) or project .mcp.json
(project scope):
If you've globally installed the package, the absolute-path form also works
and skips npx's first-run download:
| Tool | Input | Returns |
|---|---|---|
lint_prompt | { text: string } | Two text content items: [0] human one-line summary ("score: X/100 Β· issues: N Β· tokens: A β B β¦"), [1] full JSON of the lint() result (parse with JSON.parse(result.content[1].text)). |
trim_prompt | { text: string } | Two text content items: [0] the trimmed prompt, [1] a savings footer ("Saved N tokens (P%). Original: A, trimmed: B."). Does NOT resolve contradictions, redundancy, or ambiguity β run lint_prompt for those. |
Both tools are pure / idempotent. No network, no filesystem, no state.
| ID | Severity | What it catches | Example trigger |
|---|---|---|---|
contradiction | error | Paired opposing directives on length / tone / frequency / prohibition / commenting / asking | "be concise" + "be thorough" |
redundancy | warn | Two sentences with Jaccard word-set similarity > 0.6 | Two paragraphs that both say "respond in English" with different wording |
long-example | warn | Fenced code block > 1200 chars or > 30 lines | A 40-line helper function pasted inline |
ambiguous-pronoun | info | it / this / that / these / those with no mid-sentence concrete referent | "Use it to figure out what to do." |
trailing-fluff | info | Politeness / filler: please, thanks, I hope this helps, let me know ifβ¦, feel free toβ¦, sorry, certainly/absolutely/of course | "Please refactor the code. Thanks!" |
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/promptlint-mcp)<a href="https://allmcps.com/mcp/promptlint-mcp"><img src="https://allmcps.com/api/badge/promptlint-mcp?style=directory" alt="Promptlint MCP on AllMCPs" /></a>