Skip to main content
Glama

⚡ PromptLint

Write prompts. Lint them. Test them. Ship them.

The developer toolkit for testing, analyzing, optimizing, and versioning AI prompts.

Live PlaygroundDocumentationVS Code ExtensionReport Bug

Tests PyPI version License: MIT Python 3.11+ MCP Server VS Code

  PROMPTLINT
      │
┌─────┼─────┐
↓     ↓     ↓
LINT  FIX  TEST
│     │     │
└─────┼─────┘
      ↓
 SCORE ENGINE ── (Quality • Security • Cost)

🚀 Quickstart

Install PromptLint in seconds:

pip install promptlint

1. Score a Prompt File

promptlint score prompt.txt

2. Full Diagnostic Analysis

promptlint analyze prompt.txt

3. Security Scan (Offline API Key & Injection Protection)

promptlint security prompt.txt

4. Auto-Fix Prompt

promptlint fix prompt.txt --output fixed_prompt.txt

Related MCP server: Clerk Chat MCP Server

🔥 Features at a Glance

Feature

Description

🛡️ Zero-Data Leak Security

100% offline scanner for AWS/OpenAI/GitHub secrets and prompt injection attacks.

Sub-10ms Rule Engine

25+ deterministic rules covering structure, clarity, ambiguity, conflicts, and cost.

🤖 Native MCP Server

Exposes lint_prompt and auto_fix_prompt to Claude Code, Antigravity, and Cursor.

🔌 VS Code Extension

Real-time red squiggly lint diagnostics in your IDE via Language Server Protocol (LSP).

🐍 Python AST Extractor

Automatically extracts and lints prompt strings directly out of .py source code.

Magic AI Rewriter

Optional --magic flag to trigger LLM-driven prompt architecture optimization.


🛠️ Usage & Commands

Usage: promptlint [OPTIONS] COMMAND [ARGS]...

Commands:
  analyze     Analyze a prompt and report quality issues.
  score       Show only the quality score for a prompt.
  security    Run a security scan on a prompt.
  tokens      Show token count and size statistics.
  fix         Apply deterministic or magic improvements to a prompt.
  diff        Compare two prompt versions and show quality changes.
  mcp         Start the Model Context Protocol (MCP) Server.
  lsp         Start the Language Server Protocol (LSP) Server.

Pipe & Stdin Support

echo "Write a blog post about AI. Make it good." | promptlint analyze -

Interactive Mode (No Arguments)

Simply type promptlint in your terminal to launch the interactive terminal wizard:

promptlint

🤖 AI Agent Integration (MCP Server)

PromptLint implements the Model Context Protocol (MCP) natively.

Add PromptLint to your MCP client configuration (Claude Code, Antigravity, Cursor):

{
  "mcpServers": {
    "promptlint": {
      "command": "promptlint",
      "args": ["mcp"]
    }
  }
}

Now your AI coding agents can automatically lint their own generated prompts before running them!


📊 Rules Reference Matrix

Rule ID

Category

Severity

Description

SEC001

Security

CRITICAL

Hardcoded secret key (AWS, OpenAI, GitHub, Anthropic)

SEC002

Security

ERROR

Potential prompt injection attempt / system override

STRUCT001

Structure

WARNING

Missing objective or clear task verb

STRUCT002

Structure

WARNING

Missing explicit output format specification

STRUCT005

Structure

INFO

Input context referenced without delimiter tags (<context> / ```)

CLAR001

Clarity

WARNING

Vague quality instructions ("make it good", "do your best")

AMB004

Ambiguity

WARNING

Hallucination risk ("feel free to guess", "invent facts")

CONF001

Conflicts

WARNING

Contradictory instructions (e.g. JSON vs Markdown, Concise vs Detailed)

EFF001

Efficiency

WARNING

Repeated instructions wasting tokens

EFF004

Efficiency

WARNING

Negative constraint overload (4+ "do not" statements)


🌐 Live Web Playground

Try PromptLint directly in your browser without installing anything:
👉 brixsoftworks.github.io/promptlint


🤝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

📄 License

This project is licensed under the MIT License — see the LICENSE file for details.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/brixsoftworks/promptlint'

If you have feedback or need assistance with the MCP directory API, please join our Discord server