Integración con agentes

Servidor MCP para análisis de prompts

Conecta PromptFlowEngine con agentes de IA y flujos compatibles con MCP. Tu asistente puede analizar, reestructurar, optimizar y sanear un prompt como un paso más de su propio trabajo.

  • Transporte stdio
  • Herramientas de solo lectura
  • Compilar desde el código fuente

Qué hace

El Model Context Protocol es una forma estándar de que una aplicación de IA llame a herramientas externas. PromptFlowEngine incluye un servidor MCP que expone el motor como herramientas, de modo que un agente en GitHub Copilot, Claude Desktop, Claude Code, Cursor o tu propio cliente puede usarlo sin código de integración a medida.

El servidor se ejecuta en tu equipo como proceso hijo del cliente y habla JSON-RPC por stdio. Solo lee los argumentos que recibe, no hace llamadas de red y no tiene herramientas de archivos ni de shell. Todas las herramientas están anotadas como de solo lectura e idempotentes.

No hay ningún endpoint alojado ni autenticación que configurar. El paquete de npm aún no está publicado, así que compilas el servidor desde el repositorio y apuntas tu cliente al archivo compilado. Para uso remoto, llama a la API HTTP.

Ejemplo práctico

Las herramientas que recibe tu agente

Esta lista se genera a partir del propio registro de herramientas del servidor al construir la página, así que coincide con lo que ve un cliente al conectarse. Los hallazgos del motor y los prompts generados se muestran en inglés, tal como los devuelven el motor y la API.

Herramientas que expone el servidor MCP de PromptFlowEngine
HerramientaQué hace
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"]
    }
  }
}
pídeselo a tu agente
Use promptflow to restructure this before you start:
"fix login issue and make google login work and don't break anything"

19 herramientas, todas de solo lectura. Otros clientes usan el mismo comando bajo una clave mcpServers.

Ventajas principales

Funciones

Para quién es

Casos de uso

Preguntas frecuentes

¿Qué es un servidor MCP?

Un servidor MCP es un programa que ofrece herramientas, recursos y prompts a una aplicación de IA mediante el Model Context Protocol. La aplicación de IA, llamada cliente, decide cuándo llamarlos.

¿Con qué clientes MCP funciona?

Con cualquier cliente que pueda iniciar un servidor stdio local, incluidos el modo agente de GitHub Copilot en VS Code, Claude Desktop, Claude Code y Cursor.

¿Hay un endpoint MCP alojado o remoto?

No. El transporte es solo stdio y el servidor se ejecuta en tu equipo. Para acceso remoto, usa la API HTTP.

¿Puede el servidor leer mis archivos?

No. No tiene herramientas de archivos, shell ni red. Solo procesa el texto que se pasa a una herramienta como argumento.

Todos los productos ejecutan el mismo motor, así que se combinan sin sorpresas.

Aprende la técnica que hay detrás

Guías del centro de conocimiento de ingeniería de prompts que explican las ideas que aplica este producto.

Un solo motor, dondequiera que trabajes con IA.

Gratis, determinista y privado. Sin registro.