mcpField
P
prompyai

prompyai

Local
github.com/samouh-waleedAI & Agents1Updated 33w ago

About prompyai

prompyai is an MCP server for Claude CLI workflows that evaluates prompts against a local codebase and suggests rewrites. It indexes project structure, technology, code symbols, and session history to provide relevant context.

Key features

  1. 01Score prompts across four dimensions
  2. 02Suggest project-specific improvements
  3. 03Rewrite prompts with paths and symbols
  4. 04Index project context locally
  5. 05Use session history for multi-turn context

Use cases

  1. 01Make vague coding requests more specific
  2. 02Add relevant files and symbols to prompts
  3. 03Get a project stack and recent-file summary

MCP support

The prompyai MCP server exposes evaluate_prompt, get_context, and prompyai_toggle for prompt evaluation, project context, and control of automatic evaluation in Claude CLI.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"samouh-waleed-prompyai": {
"command": "npx",
"args": [
"-y",
"prompyai-mcp"
],
"env": {
"ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>"
}
}
}
}
Run commandnpx -y prompyai-mcp
Environment variables to set
ANTHROPIC_API_KEYSecretAnthropic API key for AI-powered suggestions (optional — free heuristic scoring works without it)

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmprompyai-mcp0.1.1

Tools

3

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
promptstringYesThe prompt text to evaluate
session_idstringNoClaude Code session ID for multi-turn context (optional)
active_filestringNoCurrently open file path (optional)
workspace_pathstringYesAbsolute path to the project workspace

Details

From the project README

prompyai-mcp

Context-aware prompt intelligence MCP server for Claude CLI. Scores your prompts against your real codebase and rewrites them with AI.

Install

claude mcp add prompyai -- npx prompyai-mcp serve

No sign-up. No config. Works immediately. Requires Node.js 20+.

What It Does

Every time you write a prompt in Claude CLI, PrompyAI automatically:

  1. Scores it (0–100) across Specificity, Context Completeness, Task Clarity, and File & Folder Anchoring
  2. Suggests improvements tailored to your project
  3. Rewrites the prompt with real file paths, verified symbols, and codebase context
Prompt Score: 43/100 [D]

  Specificity         3/25  ==..............
  Context Completeness 13/25  ========........
  Task Clarity        15/25  =========.......
  File & Folder Anchoring 10/25  ======..........

Key improvements:
  1. Expand your prompt with more context
  2. Add file paths using @mentions
  3. Specify what format you expect the output in

Try something more like:

  "Build the VS Code extension in packages/vscode-extension/ that integrates
   with the PrompyAI MCP server at packages/mcp-server/. It should provide
   real-time prompt scoring in the editor sidebar, show score breakdowns
   (specificity, context, clarity, anchoring), and offer a 'rewrite prompt'
   action. Use the shared types from packages/shared/."

AI Enhancement — Works for Everyone

PrompyAI uses a two-layer architecture:

  • API key users (ANTHROPIC_API_KEY set) → PrompyAI calls Claude Haiku directly for fast AI rewrites
  • Subscription users (no API key) → PrompyAI returns rich codebase context to Claude, which generates the enhanced prompt using your existing session

All users get AI-enhanced output. No separate API key required.

How It Knows Your Codebase

PrompyAI indexes your project locally:

  • File tree — structure, key folders, recently modified files
  • Tech stack — language, framework, ORM, test runner detection
  • Code symbols — functions, classes, interfaces extracted via the TypeScript Compiler API
  • Git state — branch, dirty files, recent changes
  • Session history — reads Claude Code conversation transcripts for multi-turn context

All indexing happens locally. Nothing is sent externally (except optional anonymous telemetry).

MCP Tools

evaluate_prompt

Auto-called on every user message. Scores your prompt against your project.

ParameterRequiredDescription
promptyesThe prompt text to evaluate
workspace_pathyesAbsolute path to your project
active_filenoCurrently open file path
session_idnoClaude Code session ID for multi-turn context
get_context

Returns your project summary: tech stack, recent files, key folders.

ParameterRequiredDescription
workspace_pathyesAbsolute path to your project
prompyai_toggle

Turn auto-evaluation on or off. Say "pause prompyai" or "enable prompyai" in Claude CLI.

Desktop Config

Alternatively, add to ~/.claude/claude_desktop_config.json:

{
  "mcpServers": {
    "prompyai": {
      "command": "npx",
      "args": ["prompyai-mcp", "serve"]
    }
  }
}

Environment Variables

VariableRequiredDescription
ANTHROPIC_API_KEYNoEnables direct AI suggestions via Claude Haiku (optional)
PROMPYAI_TELEMETRYNoSet to false to opt out of anonymous telemetry

CLI Commands

prompyai serve              # Start the MCP server (default)
prompyai doctor             # Run environment diagnostics
  --workspace <path>        # Workspace to check (default: cwd)

Programmatic API

import { WorkspaceIndexer, ScoringEngine } from 'prompyai-mcp';

const indexer = new WorkspaceIndexer();
const scorer = new ScoringEngine();

const fingerprint = await indexer.getFingerprint('/path/to/project');
const result = await scorer.evaluate('fix the auth', fingerprint);

console.log(result.display); // Pre-formatted score output
console.log(result.total);   // 0-100
console.log(result.grade);   // A-F

Links

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.