Prompyai

io.github.samouh-waleed由 GitHub 账号 samouh-waleed 发布v0.1.1更新于 Oct 24, 2026

Scores your prompts against your real codebase — context-aware prompt intelligence

已验证STDIO仅桌面开发者工具AI 与机器学习

概览

AI 生成的概览

在 Claude CLI 中根据本地代码库对提示词打分并重写,结合文件路径、符号和 git 状态提供上下文。

可以做什么
PrompyAI 从具体性、上下文完整性、任务清晰度以及文件与文件夹锚定四个维度对每条提示词进行 0-100 打分,并给出改进建议,再用真实文件路径和已验证的符号重写提示词。它在本地索引项目:文件树、检测到的技术栈、通过 TypeScript 编译器 API 提取的代码符号、git 分支与改动文件,以及 Claude Code 会话记录。工具包括 evaluate_prompt、get_context 和用于暂停或启用自动评估的 prompyai_toggle。
适用场景
适合在 Claude CLI 中频繁编写提示词、希望获得基于真实代码库的提示词质量反馈的开发者。当提示词经常缺少文件路径或上下文、又不想离开会话时尤其有用。
运行要求
通过 npx 启动的本地进程(npm 包 prompyai-mcp),需要 Node.js 20+。无需注册或配置。可选的 ANTHROPIC_API_KEY 可启用通过 Claude Haiku 直接进行 AI 重写;不设置时会把上下文返回给 Claude 进行增强。可选 PROMPYAI_TELEMETRY 可设为 false。
安装前请注意
会读取本地项目文件、git 状态和 Claude Code 对话记录用于索引。除非将 PROMPYAI_TELEMETRY 设为 false,否则默认开启匿名遥测。若提供 ANTHROPIC_API_KEY,提示词和代码库上下文可能被发送至 Anthropic 用于重写;不提供时增强过程不会进行外部调用。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Prompyai,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

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

bash
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:

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

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

Programmatic API

typescript
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 outputconsole.log(result.total);   // 0-100console.log(result.grade);   // A-F

Links

License

MIT

来源:packages/mcp-server/README.md,提交 df67118

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分