Clojars MCP 服务器
一个 模型上下文协议(MCP) 服务器,提供从 Clojars 获取依赖信息的功能,Clojars 是 Clojure 社区的工件存储库,用于 Cline、Roo Code、Cody、Claude Desktop 等。
安装
通过 npx 安装
使用 npx 直接运行 Clojars MCP 服务器是最快的方式:
npx clojars-deps-server
您也可以全局安装:
npm install -g clojars-deps-server
通过 Smithery 安装
通过 Smithery 自动安装 Clojars 依赖服务器用于 Claude Desktop:
npx -y @smithery/cli install clojars-deps-server --client claude
手动安装
- 克隆此仓库:
git clone https://github.com/yourusername/clojars-deps-server.git
cd clojars-deps-server
- 安装依赖:
npm install
- 构建服务器:
npm run build
- 将服务器添加到您的 Claude 配置:
对于 VSCode Claude 扩展,添加到 cline_mcp_settings.json(通常位于 macOS 的 ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/):
{
"mcpServers": {
"clojars-deps-server": {
"command": "node",
"args": ["/path/to/clojars-deps-server/build/index.js"]
}
}
}
对于 Claude 桌面应用,添加到 claude_desktop_config.json(通常位于 macOS 的 ~/Library/Application Support/Claude/):
{
"mcpServers": {
"clojars-deps-server": {
"command": "node",
"args": ["/path/to/clojars-deps-server/build/index.js"]
}
}
}
添加服务器配置后,Claude 将在启动时自动检测并连接到服务器。服务器的功能将列在 Claude 的系统提示中的“已连接的 MCP 服务器”下,使其可供使用。
功能
- 获取任何 Clojars 依赖的最新版本
- 检查特定版本的依赖是否存在
- 获取依赖版本历史记录(可配置限制)
- 简洁、专注的响应
- 通过 MCP 轻松集成到 Claude 中
工作原理
当此 MCP 服务器配置在 Claude 的设置中时,它将自动在 Claude 的系统提示中的“已连接的 MCP 服务器”部分可用。这使得 Claude 了解服务器的功能,并允许它通过 use_mcp_tool 命令使用提供的工具。
服务器暴露了三个工具:
get_clojars_latest_version
{
"name": "get_clojars_latest_version",
"description": "获取 Clojars 依赖(Maven 工件)的最新版本",
"inputSchema": {
"type": "object",
"properties": {
"dependency": {
"type": "string",
"description": "Clojars 依赖名称,格式为 \"group/artifact\"(例如 \"metosin/reitit\")"
}
},
"required": ["dependency"]
}
}
check_clojars_version_exists
{
"name": "check_clojars_version_exists",
"description": "检查 Clojars 依赖的特定版本是否存在",
"inputSchema": {
"type": "object",
"properties": {
"dependency": {
"type": "string",
"description": "Clojars 依赖名称,格式为 \"group/artifact\"(例如 \"metosin/reitit\")"
},
"version": {
"type": "string",
"description": "要检查的版本(例如 \"0.7.2\")"
}
},
"required": ["dependency", "version"]
}
}
get_clojars_history
{
"name": "get_clojars_history",
"description": "获取 Clojars 依赖的版本历史记录",
"inputSchema": {
"type": "object",
"properties": {
"dependency": {
"type": "string",
"description": "Clojars 依赖名称,格式为 \"group/artifact\"(例如 \"metosin/reitit\")"
},
"limit": {
"type": "number",
"description": "要返回的版本数量(默认:15,最大:100)",
"minimum": 1,
"maximum": 100
}
},
"required": ["dependency"]
}
}
工具名称和描述专门设计为帮助 Claude 理解这些工具用于从 Clojars 获取版本信息。当用户询问关于 Clojars 依赖时,Claude 可以根据以下因素识别这些工具适合该任务:
- 工具名称明确表明其用途
- 描述指定它们用于“Clojars 依赖(Maven 工件)”
- 示例格式展示了典型的 Clojars 依赖模式
