Back to MCP directory
publicPublicdnsLocal runtime

Shadow-CLJS Build Monitor

shadow-cljs构建状态监控服务

article

README

🚀 shadow-cljs-mcp

shadow-cljs-mcp是一个模型上下文协议(MCP)服务器,用于监控shadow-cljs构建,并实时提供构建状态更新,助力开发者及时掌握构建情况。

🚀 快速开始

shadow-cljs-mcp可帮助您监控shadow-cljs构建并获取实时状态更新。以下是使用前的安装和配置步骤。

📦 安装指南

在您的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

📚 详细文档

概述

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

LLM集成

添加到您的LLM笔记中

将以下内容添加到您的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应在每次编辑ClojureScript文件后调用get_last_build_status
  • 编译错误将以详细方式显示,便于调试。
  • 成功构建会显示编译的文件及其所用时间。
  • 确保在启动此服务器之前shadow-cljs正在运行。

前提条件

  • 运行中的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