影子cljs-mcp
](https://badge.fury.io/js/shadow-cljs-mcp)
一个模型上下文协议(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服务器连接到正在运行的影子cljs实例,并跟踪构建进度、失败和完成情况。它提供了一个MCP工具,LLM可以在更改ClojureScript文件后使用该工具验证构建状态。
LLM集成
添加到您的LLM笔记
将以下内容添加到LLM的笔记文件中(例如,CLAUDE.md、cursorules.md):
After any edits to ClojureScript files, use the shadow-cljs-mcp server's get_last_build_status tool to verify the build succeeded:
shadow-cljs-mcp
get_last_build_status
{}
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
}
}使用说明
- LLM应在每次编辑ClojureScript文件后调用get_last_build_status
- 编译错误将详细显示,以便于调试
- 成功的构建显示了编译了哪些文件以及它们花了多长时间
- 启动此服务器之前,请确保shadow cljs正在运行
需求
- 正在运行shadow cljs实例(如果没有另行配置,默认为localhost:9630)
