Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README-zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,14 @@ MCP 的调用流程尽量保持简单:
```text
failed command output
-> e2f_get_latest_failure_brief
-> 如果有历史检索能力,用返回的 summary 先检索相似问题
-> 信息够就直接回答
-> 信息不够再调用 e2f_query_failure_evidence
-> 环境信息会影响判断时再调用 e2f_get_runtime_context
```

如果 Agent 环境里有历史检索能力,可以用 brief 返回的 `summary` 和其他紧凑诊断字段作为查询线索;不要把原始 `stdout` 或 `stderr` 直接送去检索。如果没有历史检索能力,就继续走原来的 MCP 流程,不需要额外依赖。

## Benchmark

仓库里有一组早期 benchmark 数据,位置是 `benchmarks/failures`。每个 case 只保留原始日志 `raw.log`,脚本会自己组装 MCP 输入并生成结果。
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,17 @@ The intended agent flow is:
```text
failed command output
-> e2f_get_latest_failure_brief
-> optional history search with the returned summary if available
-> answer if sufficient
-> e2f_query_failure_evidence only if more detail is needed
-> e2f_get_runtime_context only if environment context matters
```

If the agent environment provides a history-search capability, use the brief
`summary` and other compact diagnostic fields as the query seed. Do not search
with raw `stdout` or `stderr`. When no history search is available, follow the
same MCP flow without any extra dependency.

## Benchmark

The repository includes an early MCP benchmark dataset under `benchmarks/failures`.
Expand Down
2 changes: 2 additions & 0 deletions packages/mcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ MCP server for agent-facing frontend `error2fix` diagnosis workflows.

This package exposes compact frontend failure-analysis tools for IDEs and coding agents. It is currently focused on JavaScript/TypeScript frontend workflows such as package scripts, bundlers, framework compile errors, and dependency resolution. The client provides the raw failed command output, and the server returns small, structured responses that are safer for an LLM token budget than full log replay.

When the host agent has a history-search capability, use the returned brief `summary` and compact diagnostic fields to search for similar past failures. Do not pass raw `stdout` or `stderr` into history search. Without history search, use the same brief -> evidence -> runtime-context flow.

## Tools

- `e2f_get_latest_failure_brief`: compresses client-provided `stdout` and `stderr` into a diagnosis brief and creates a session.
Expand Down
1 change: 1 addition & 0 deletions packages/mcp/src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const WORKFLOW_DESCRIPTION = [
'Scope: use these tools for frontend JavaScript/TypeScript project failures such as npm/pnpm/yarn scripts, Vite, Next.js, React, Svelte, Tailwind, bundlers, test runners, dependency resolution, and framework compile errors.',
'Do not treat this server as a general-purpose diagnosis tool for arbitrary programming languages yet.',
'Recommended workflow: call e2f_get_latest_failure_brief first.',
'If historical context search is available, use the returned summary and compact diagnostic fields as the search query before requesting more evidence; never search with raw stdout or stderr.',
'If next.canAnswerFromDiagnosis is true, answer without requesting raw logs.',
'If more frontend failure evidence is needed, call e2f_query_failure_evidence with evidence IDs or suggested queries from the diagnosis.',
'Call e2f_get_runtime_context only when frontend command facts, package manager, runtime versions, workspace files, git state, or safe environment details affect the fix.',
Expand Down