
Promptlint MCP
io.github.sean-sunagaku由 GitHub 账号 sean-sunagaku 发布v0.1.3更新于 Oct 24, 2026
Static linter for AI prompts: contradictions, redundancy, ambiguity, and fluff.
概览
检查英文 AI 提示词中的矛盾、冗余、歧义和废话,并可返回精简版本以节省 token。
- 可以做什么
- 这是一个针对英文散文式提示词的静态分析器,适用于系统提示词、智能体指令和工具描述。它提供两个工具:lint_prompt 返回一行摘要以及包含评分、问题和 token 数量的完整 JSON;trim_prompt 返回精简后的提示词和节省统计。规则涵盖成对的对立指令、近似重复的句子、过长的围栏代码示例、指代不明的代词以及礼貌性废话。两个工具都是纯函数且无状态。
- 适用场景
- 适合在编写或审阅系统提示词和智能体指令时使用,以便在发送前发现隐蔽的矛盾或冗余表述。也适合从冗长提示词中回收 token。它不是代码检查工具,只处理英文散文。
- 运行要求
- 需要 Node.js 18 或更高版本。作为本地 stdio 进程运行,通常通过 npx -y promptlint-mcp 或全局安装启动。未声明任何账户、API 密钥、环境变量或请求头,工具不使用网络或文件系统访问。
安装
在 SourceWeft 中
- 打开 控制台中的 Promptlint MCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
promptlint-mcp
[npm] [npm downloads] [GitHub stars] [MIT License] [Node 18+] [MCP compatible]
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.
Quick demo
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.
Why
- Contradictions:
"be concise"+"be thorough"ships silently and wastes tokens on every request. promptlint flags paired opposites (length / tone / frequency / commenting / asking) aserror. - Redundancy: near-duplicate sentences (Jaccard > 0.6) get one
warnapiece — delete one. - Ambiguous pronouns:
"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. - Long code examples: fenced code blocks over ~1200 chars or 30 lines
trigger a
warn— examples are almost always trimmable to shape-only. - Politeness fluff:
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
Install both the CLI and the MCP server in one go:
Two binaries are placed on your $PATH:
Run without installing
From source (hacking on it)
Requires Node >= 18. Zero runtime deps other than the MCP SDK.
CLI usage
Default human report
A clean prompt (see examples/good-prompt.md) returns score 100/100 with
zero issues — silence is a feature.
--json for machine consumption
Empty 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.
Stdin
The report header shows promptlint <stdin>.
Other flags
Exit codes
MCP server usage
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:
Tools exposed
Both tools are pure / idempotent. No network, no filesystem, no state.
Rules
Score formula: 100 - (errors*25 + warns*10 + infos*3), then clamped to <=59
if any error exists and <=79 if 2+ warnings exist. Severity ceilings are a
traffic-light: any error = red zone, regardless of count.
Pricing & Roadmap
Free (OSS, MIT)
- CLI (
node src/cli.mjs) — all three modes (report / JSON / trim), all 5 rules. - MCP server (
node src/mcp.mjs) — both tools, unlimited use. - No account, no telemetry, no network.
Pro (planned, $9/mo)
- Team-shared custom rule dictionary (your project's bannned phrases, required headers, forbidden contradictions).
- Per-project lint history with diff view.
- Cross-project token-savings dashboard ("your team saved 1.2M tokens this month").
Pro is not shipped yet. No signup form today — 👍 the early-access issue (#1) to register interest. We DM invites in 👍 order.
Development
Smoke test
Expected: exit 1 (2 error contradictions), score in the low teens, all
rules firing. If this drifts, a rule regressed.
Baseline
examples/good-prompt.md must always score 100/100 with 0 issues. If
a change breaks that, the change is wrong.
Adding a rule
Rules live in src/linter.mjs. Each rule is a plain function:
Add it to the issues array inside lint() and append its ID to the RULES
export. If it targets prose (not code), run it against the maskCodeBlocks()
copy so fenced examples don't trigger it. If it needs sentence splitting,
reuse splitSentences (quote-aware) or splitSentencesPreservingDelims
(quote-aware, keeps delimiters for the trimmer).
Contradictions
Extend CONTRADICTION_PAIRS at the top of src/linter.mjs. Each entry is:
Existing labels: length, tone, frequency, prohibition, commenting,
asking.
Community
- 💬 Discussions — questions, ideas, prompt war stories
- 🐛 Issues — bugs, feature requests
- ⭐ Star the repo if it saves you tokens — discovery helps other AI users find it.
How this was built
This package was produced end-to-end by two AI agent teams:
- ai-auto-improve-app — built and polished the product. Customer AI uses the tool and writes feedback → Developer AI patches the code → repeat. Each round's commit (
round-001…round-003) is the developer-AI's response to that round's customer-AI feedback. - ai-launch-team — published and distributed it. 5 sub-agents handled npm publish, GitHub Release, awesome-mcp PRs, Discussions threads, social copy drafts, and SVG/PNG asset generation.
Combined, this took the product from "empty repo" to "v0.1.2 on npm + 2 awesome-mcp PRs + 2 Discussions seed threads + 4 Issues + full social drafts" with the only manual step being the platform-mandated SMS / OTP authentications (X account creation, npm 2FA setup) — the rest was AI.
License
MIT — see LICENSE.
来源:README.md,提交 8a31da8
工具
0版本历史
1- v0.1.3最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分