@yunfu-nx/error-pattern-library
v1.0.0
Published
智能错误模式库 - 积累错误解决方案,避免重复踩坑
Maintainers
Readme
Error Pattern Library
English
A smart error pattern library MCP server for Kiro IDE - accumulate error solutions and avoid stepping into the same pit twice.
Features
- Auto Capture - Record errors from terminal, editor, build process
- Smart Matching - Automatically search similar historical errors and solutions
- Solution Accumulation - Record fix methods, root cause analysis, prevention tips
- Statistics - Understand error distribution for targeted improvements
Installation
npx error-pattern-libraryConfiguration
Add to your .kiro/settings/mcp.json:
{
"mcpServers": {
"error-pattern-library": {
"command": "npx",
"args": ["error-pattern-library"],
"env": {
"STORAGE_PATH": ".kiro/errors"
},
"disabled": false,
"autoApprove": [
"capture_error",
"search_similar",
"get_statistics"
]
}
}
}Available Tools
| Tool | Description |
|------|-------------|
| capture_error | Capture and record a new error |
| record_solution | Record solution for an error |
| search_similar | Search similar errors and solutions |
| get_statistics | Get error statistics |
| get_error | Get error details |
| list_recent_errors | List recent errors |
| mark_resolved | Mark error as resolved |
Usage Examples
Capture an error:
capture_error({
errorMessage: "TypeError: Cannot read property 'map' of undefined",
source: "terminal",
file: "src/components/List.tsx",
line: 15
})Search similar errors:
search_similar({
errorMessage: "Cannot read property 'filter' of undefined"
})Record a solution:
record_solution({
errorId: "err_xxx",
description: "Add null check",
codeBefore: "users.map(u => u.name)",
codeAfter: "users?.map(u => u.name) ?? []",
rootCause: "API returns null",
preventionTip: "Use TypeScript strict mode"
})中文
智能错误模式库 MCP 服务器 - 积累错误解决方案,避免重复踩坑。
功能特性
- 错误自动捕获 - 记录终端、编辑器、构建过程中的错误
- 智能匹配 - 遇到新错误时,自动搜索相似历史错误和解决方案
- 解决方案沉淀 - 记录修复方式、根因分析、预防建议
- 统计分析 - 了解错误分布,针对性改进
安装
npx error-pattern-library配置
在 .kiro/settings/mcp.json 中添加:
{
"mcpServers": {
"error-pattern-library": {
"command": "npx",
"args": ["error-pattern-library"],
"env": {
"STORAGE_PATH": ".kiro/errors"
},
"disabled": false,
"autoApprove": [
"capture_error",
"search_similar",
"get_statistics"
]
}
}
}可用工具
| 工具 | 描述 |
|------|------|
| capture_error | 捕获并记录新错误 |
| record_solution | 为错误记录解决方案 |
| search_similar | 搜索相似错误和解决方案 |
| get_statistics | 获取错误统计信息 |
| get_error | 获取错误详情 |
| list_recent_errors | 列出最近的错误 |
| mark_resolved | 标记错误为已解决 |
数据存储
错误数据存储在 .kiro/errors/ 目录:
.kiro/errors/
├── index.json # 索引
├── errors/ # 错误记录
├── solutions/ # 解决方案
└── patterns/ # 错误模式License
MIT
