shadow-cljs上下文监控服务器
一种模型上下文协议服务器,用于监控 shadow-cljs 构建并为 ClojureScript 项目提供实时构建状态更新,允许大型语言模型(LLM)在进行代码更改后验证构建状态。
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"shadow-cljs-mcp": {
"args": [
"shadow-cljs-mcp",
"--host",
"localhost",
"--port",
"9630"
],
"autoApprove": [],
"command": "npx",
"disabled": false,
"timeout": 60
}
}
}
该服务需要配置环境变量:HOST、PORT
可用工具 (1 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
get_last_build_status
Get the status of the last shadow-cljs build including any warnings or errors. Call this after making edits to ClojureScript files to verify if the build succeeded or failed.
该工具无需必填参数,直接调用即可
服务介绍
shadow-cljs-mcp
一个 Model Context Protocol (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 实例,并跟踪构建进度、失败和完成情况。它提供了一个 MCP 工具,LLMs 可以使用该工具在修改 ClojureScript 文件后验证构建状态。
LLM 集成
添加到您的 LLM 笔记
将以下内容添加到您的 LLM 的笔记文件中(例如,CLAUDE.md, cursorrules.md):
After any edits to ClojureScript files, use the shadow-cljs-mcp server's get_last_build_status tool to verify the build succeeded:
<use_mcp_tool>
<server_name>shadow-cljs-mcp</server_name>
<tool_name>get_last_build_status</tool_name>
<arguments>
{}
</arguments>
</use_mcp_tool>
This will show:
- Build status (completed/failed)
- Which files were compiled
- Any errors or warnings
- Build duration and metrics
示例工具响应
成功构建:
{
"status": "completed",
"resources": 317,
"compiled": 1,
"warnings": 0,
"duration": 0.609,
"compiledFiles": [
"path/to/your/file.cljs (505ms)"
]
}
构建失败:
{
"status": "failed",
"message": "Build failed",
"details": {
// Error information
}
}
使用说明
- LLMs 应该在每次编辑 ClojureScript 文件后调用 get_last_build_status
- 编译错误会详细显示以便于调试
- 成功构建会显示编译了哪些文件以及耗时多久
- 在启动此服务器之前,请确保 shadow-cljs 正在运行
要求
- 正在运行的 shadow-cljs 实例(如果未另行配置,默认为 localhost:9630)