智能体集成

用于提示词分析的 MCP 服务器

将 PromptFlowEngine 连接到 AI 智能体和兼容 MCP 的工作流。你的助手可以把分析、重构、优化和脱敏提示词作为自身工作中的一个步骤。

  • stdio 传输
  • 只读工具
  • 从源码构建

功能介绍

Model Context Protocol 是 AI 应用调用外部工具的标准方式。PromptFlowEngine 提供一个 MCP 服务器,把引擎以工具的形式开放出来,因此 GitHub Copilot、Claude Desktop、Claude Code、Cursor 或你自己的客户端中的智能体无需定制的胶水代码即可使用它。

服务器作为客户端的子进程运行在你的电脑上,通过 stdio 使用 JSON-RPC 通信。它只读取收到的参数,不发起网络调用,也没有文件或 shell 工具。每个工具都标注为只读且幂等。

没有托管的端点,也无需配置身份验证。npm 包尚未发布,因此你需要从仓库构建服务器,并让客户端指向构建好的文件。如需远程使用,请调用 HTTP API。

实际示例

你的智能体可用的工具

这份列表在构建页面时由服务器自身的工具注册表生成,因此与客户端连接后看到的内容一致。 引擎的检查结果和生成的提示词以英文显示,与引擎和 API 返回的内容完全一致。

PromptFlowEngine MCP 服务器提供的工具
工具作用
optimize_promptOptimize a prompt with deterministic, verified transforms (duplicates, filler, optional sections). Every candidate is checked to preserve all sentences, requirements, code, and variables; the original is kept if nothing is better. Returns the selected prompt, token savings, quality score, and what changed.
optimize_prompt_pipelineRun the optimization pipeline and return per-stage results plus token and estimated cost metrics, in the result shape used by the PromptFlow VS Code extension.
compress_promptRemove exact duplicate sentences and extra whitespace without rewriting any wording.
validate_promptCheck a prompt for missing objective or output format, ambiguity, conflicting instructions, duplicates, prompt-injection patterns, secrets, and undelimited variables. isValid is false only when a critical issue exists.
estimate_tokensCount tokens and estimate input cost for a model. "exact" is true only for OpenAI models with a loaded tokenizer; other providers are approximate. Costs are estimates from a reference price table.
analyze_promptDetect intent, task type, technical domain, requested output, requirements, and entities (languages, frameworks, file paths, identifiers).
extract_entitiesExtract languages, frameworks, libraries, cloud platforms, services, technologies, file paths, identifiers, URLs, and commands.
summarize_contextExtractive summary: the first N unique, non-empty sentences of a context block, in order. Does not rank or rewrite.
score_promptScore prompt quality 0-100: 100 minus a penalty per issue (critical 30, warning 10, info 3; capped at 50 with any critical issue), with per-dimension scores and suggestions.
evaluate_promptFull quality report: overall score, grade, eight quality dimensions with the checks that failed, and every finding with why it matters and how to fix it.
compare_promptsCompare two prompts: token and estimated cost delta, quality delta per dimension, and which findings were resolved or introduced.
scan_prompt_securityPrompt-injection risk (0-100, signature-based, with threat ids), sensitive-data counts by category, undelimited template variables, and destructive operations. Never returns detected secret values.
scan_sensitive_dataScan text for credentials, cloud secrets, and PII with local deterministic detectors. Returns offsets and per-category counts, never the sensitive values.
sanitize_promptReplace detected sensitive data with placeholders such as [REDACTED_API_KEY]. Returns the sanitized text and counts, never the original values. Use before sending a prompt to an external model.
restructure_promptTurn a loosely written request into a sectioned engineering prompt: Role, Objective, Context, Requirements, Constraints, Edge cases, Testing, Acceptance criteria, Expected output. Only sections with content appear. The author's clauses are kept and reordered; for software tasks, fixed engineering guidance chosen by intent and topic is added, and every line is labeled "prompt" or "engine" so additions can be reviewed. Set scaffold=false to reorganize without adding guidance.
convert_structured_payloadConvert a JSON payload to TOON (Token-Oriented Object Notation) and say whether to use it. Returns token counts for pretty JSON, compact JSON and TOON, a round-trip check (the TOON must decode back to the same value), and the recommendation: "toon" only when it round-trips and saves at least 5 % over compact JSON, otherwise "json". Lossless or it keeps JSON.
simulate_costSimulate what a prompt costs across models at a request volume, from catalog list prices (labelled simulated, never a bill). Optionally optimizes the prompt first and reports hypothetical savings. Flags models whose context window is too small.
analyze_context_budgetMeasure the context sources you intend to send with a prompt: tokens and share per source, context-window usage with an output reserve, sensitive data (categories and counts only), instruction-like text in retrieved sources, and duplicates. Reads only the text passed in; never reads files.
run_prompt_testsRun a regression suite against a prompt. Assertions check the prompt (contains, not_contains, matches, max_tokens, min_quality, no_finding, max_severity, has_variables, max_injection_risk, no_sensitive_data, output_format) and, when a case carries a recorded model response, the response (response_valid_json, response_has_keys, response_contains, response_max_chars). With baseline_prompt, also runs the suite on the baseline and lists cases that regressed. No model is called.
.vscode/mcp.json
{
  "servers": {
    "promptflow": {
      "type": "stdio",
      "command": "node",
      "args": ["/absolute/path/to/checkout/packages/mcp-server/dist/bin.js"]
    }
  }
}
让你的智能体执行
Use promptflow to restructure this before you start:
"fix login issue and make google login work and don't break anything"

共 19 个工具,全部只读。其他客户端在 mcpServers 键下使用相同的命令。

主要优势

功能

适用人群

使用场景

常见问题

什么是 MCP 服务器?

MCP 服务器是通过 Model Context Protocol 向 AI 应用提供工具、资源和提示词的程序。AI 应用(称为客户端)决定何时调用它们。

它适用于哪些 MCP 客户端?

任何能够启动本地 stdio 服务器的客户端,包括 VS Code 中的 GitHub Copilot 智能体模式、Claude Desktop、Claude Code 和 Cursor。

有托管或远程的 MCP 端点吗?

没有。传输方式仅为 stdio,服务器运行在你的电脑上。如需远程访问,请使用 HTTP API。

服务器能读取我的文件吗?

不能。它没有文件、shell 或网络工具,只处理作为参数传给工具的文本。

所有产品都运行同一个引擎,组合使用时不会出现意外差异。

了解背后的技巧

来自提示词工程知识中心的指南,讲解本产品所运用的理念。

无论在哪里使用 AI,都是同一个引擎。

免费、确定性、保护隐私。无需注册。