Back to MCP directory
publicPublicdnsLocal runtime

shadow-cljs-mcp

shadow-cljs构建状态监控服务

article

README

🚀 阴影.cljs - MCP

一个模型上下文协议(MCP)服务器,用于监视 shadow - cljs 构建并提供实时构建状态更新,能为 LLM 验证构建状态提供便利。

🚀 快速开始

此 MCP 服务器连接到运行中的 shadow - cljs 实例并跟踪构建进度、失败和完成状态。它为 LLM 提供了一个 MCP 工具,用于在对 ClojureScript 文件进行更改后验证构建状态。

📦 安装指南

在你的 Cline/Cursor/Claude 等设置中添加以下内容:

{
  "mcpServers": {
    "shadow-cljs-mcp": {
      "command": "npx",
      "args": [
        "shadow-cljs-mcp"
      ],
      "disabled": false,
      "autoApprove": [],
      "timeout": 60
    }
  }
}

可选服务器位置:

{
  "mcpServers": {
    "shadow-cljs-mcp": {
      "command": "npx",
      "args": [
        "shadow-cljs-mcp",
        "--host",
        "localhost",
        "--port",
        "9630"
      ],
      "disabled": false,
      "autoApprove": [],
      "timeout": 60
    }
  }
}

--host--port 参数是可选的。如果没有提供,默认服务器将连接到 localhost:9630

💻 使用示例

基础用法

将以下内容添加到你的 LLM 的备注文件(例如 CLAUDE.md、cursorrules.md)中:

在任何编辑 ClojureScript 文件之后,使用 shadow-cljs-mcp 服务器的 get_last_build_status 工具来验证构建是否成功:

<use_mcp_tool>
<server_name>shadow-cljs-mcp</server_name>
<tool_name>get_last_build_status</tool_name>
<arguments>
{}
</arguments>
</use_mcp_tool>

这将显示:
- 构建状态(完成/失败)
- 编译的文件
- 任何错误或警告
- 构建持续时间和指标

高级用法

成功构建示例

{
  "status": "completed",
  "resources": 317,
  "compiled": 1,
  "warnings": 0,
  "duration": 0.609,
  "compiledFiles": [
    "path/to/your/file.cljs (505ms)"
  ]
}

失败构建示例

{
  "status": "failed",
  "message": "Build failed",
  "details": {
    // 错误信息
  }
}

📚 详细文档

LLM 集成

将特定内容添加到 LLM 的备注文件(如 CLAUDE.md、cursorrules.md)中,可在编辑 ClojureScript 文件后验证构建状态。

使用注意事项

⚠️ 重要提示

  • LLM 应该在每次对 ClojureScript 文件进行编辑后调用 get_last_build_status
  • 确保 shadow - cljs 在启动此服务器之前正在运行。

💡 使用建议

  • 编译错误将以详细方式显示,便于调试。
  • 成功构建会显示编译的文件及其耗时,可关注这些信息了解构建情况。

🔧 技术细节

此 MCP 服务器连接到运行中的 shadow - cljs 实例并跟踪构建进度、失败和完成状态。它为 LLM 提供了一个 MCP 工具,用于在对 ClojureScript 文件进行更改后验证构建状态。

要求

运行中的 shadow - cljs 实例(如果没有配置其他地址,默认为 localhost:9630

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client