
Structurizr DSL Debugger for Cursor

2025.04.12
0
JavaScript调试工具IDE 插件开发效率
Structurizr DSL Debugger for Cursor 是一个专为 Cursor IDE 设计的工具,用于调试 Structurizr DSL 语法问题。该工具通过 Model Context Protocol (MCP) 与 Cursor IDE 集成,提供实时的 Structurizr DSL 错误检测、分析和修复建议。
View on GitHub
Overview
基本能力
产品定位
Structurizr DSL Debugger for Cursor 是一个专为 Cursor IDE 设计的调试工具,用于实时检测和修复 Structurizr DSL 语法错误。
核心功能
- 🔍 实时错误检测 - 自动捕获 Structurizr DSL 文件中的语法错误
- 🛠️ 修复建议 - 提供智能建议以修复常见的 DSL 错误
- 🔄 浏览器集成 - 连接到 Chrome 中的 Structurizr 页面以监控错误
- 🧩 Cursor IDE 集成 - 通过 MCP 工具无缝集成到 Cursor IDE
- ⚙️ 可配置 - 支持自定义 Structurizr 端口配置
- 📊 错误历史记录 - 维护捕获的错误日志以供审查
适用场景
- 在 Cursor IDE 中开发 Structurizr DSL 时实时检测语法错误
- 需要快速修复 Structurizr DSL 语法错误的场景
- 需要记录和分析 Structurizr DSL 错误历史的场景
工具列表
- npm start - 启动 DSL 调试器(默认端口 8080)
- npm run debug - 使用交互式提示启动调试器
- npm run capture - 直接捕获错误
- npm run errors - 查看捕获的错误
- simplified-dsl-debugger.js - 简化版调试器
常见问题解答
- Chrome 连接问题:确保 Chrome 以
--remote-debugging-port=9222
参数运行 - MCP 工具问题:验证 MCP 服务器是否运行,或尝试使用简化版调试器
- 端口冲突:如果端口 8080 被占用,可以更改 Structurizr 端口或更新调试器配置
使用教程
使用依赖
- Node.js 14+
- Cursor IDE
- 启用远程调试的 Google Chrome
- 本地运行的 Structurizr Lite(通常端口 8080)
安装教程
- 克隆仓库:
bash git clone https://github.com/your-username/structurizr-dsl-debugger.git cd structurizr-dsl-debugger
- 安装依赖:
bash npm install
- 设置 Cursor IDE 集成:
bash npm run setup
调试方式
- 启动 Structurizr Lite:
bash docker run -it --rm -p 8080:8080 -v /path/to/workspace:/workspace structurizr/lite
- 启动 Chrome 并启用远程调试:
bash google-chrome --remote-debugging-port=9222 http://localhost:8080
- 启动 DSL 调试器:
bash npm start
- 在 Cursor IDE 中使用 MCP 工具:
connectToBrowser: { "debugPort": 9222, "structurizrPort": 8080 } getDslErrors: { "count": 5 } clearDslErrors: {} fixDslError: { "line": 776, "fix": "dynamic ContainerName ErrorHandlingFlow {" }