Clojars MCP 服务器是一个基于模型上下文协议 (MCP) 的服务器,它能提供工具从Clojars(Cline、Roo Code、Cody、Claude Desktop 等 Cлопаре的社区 artifact 存储库)获取依赖信息,为相关开发工作提供便利。
你可以按照以下不同方式安装并使用Clojars MCP服务器。
运行 Clojars MCP Server 最简单的方法是通过 npx,执行以下命令:
npx clojars-deps-server
你也可以选择全局安装:
npm install -g clojars-deps-server
要通过 Smithery 自动安装 Clojars 依赖服务器,可执行以下命令:
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
cline_mcp_settings.json(通常位于 ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/ 在 macOS 上):{
"mcpServers": {
"clojars-deps-server": {
"command": "node",
"args": ["/path/to/clojars-deps-server/build/index.js"]
}
}
}
- 对于 Claude 桌面应用程序,添加到 `claude_desktop_config.json`(通常位于 `~/Library/Application Support/Claude/` 在 macOS 上):
{
"mcpServers": {
"clojars-deps-server": {
"command": "node",
"args": ["/path/to/clojars-deps-server/build/index.js"]
}
}
}
在添加服务器配置后,Claude 在启动时会自动检测并连接到服务器。服务器的功能将在 Claude 的系统提示下列出于“Connected MCP Servers”部分,使其可供使用。
当此 MCP 服务器配置在 Claude 的设置中时,它会自动成为 Claude 的系统提示下“Connected MCP Servers”部分中的可用选项。这使 Claude 意识到服务器的功能,并允许它通过 use_mcp_tool 命令使用提供的工具。
服务器暴露了两个工具:
{
"name": "get_clojars_latest_version",
"description": "获取 Clojars 依赖项的最新版本(Maven artifact)",
"inputSchema": {
"type": "object",
"properties": {
"dependency": {
"type": "string",
"description": "Clojars 依赖项名称,格式为 \"组/工件\"(例如 \"metosin/reitit\")"
}
},
"required": ["dependency"]
}
}
{
"name": "check_clojars_version_exists",
"description": "检查特定版本的 Clojars 依赖项是否存在",
"inputSchema": {
"type": "object",
"properties": {
"dependency": {
"type": "string",
"description": "Clojars 依赖项名称,格式为 \"组/工件:version\"(例如 \"metosin/reitit:latest\" 或 \"org.example/library:1.0.0\")"
}
},
"required": ["dependency"]
}
}
当用户询问关于 Clojars 依赖项的问题时,Claude 可以根据以下内容识别这些工具是适当的: