使用说明
Clojars MCP服务器
A. 模型上下文协议(MCP) 提供从中获取依赖关系信息的工具的服务器 Clojars,Clojure社区的Cline、Roo Code、Cody、Claude Desktop等工件库。
安装
通过npx安装
使用Clojars MCP服务器的最快方法是直接用npx运行它:
npx clojars-deps-server
您还可以全局安装它:
npm install -g clojars-deps-server
通过Smithery安装
通过以下方式自动安装Claude Desktop的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
- 将服务器添加到您的Claude配置中:
对于VSCode Claude扩展,请添加 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将在启动时自动检测并连接到服务器。服务器的功能将在克劳德的系统提示中“连接的MCP服务器”下列出,使其可供使用。
特性
- 获取任何Clojars依赖项的最新版本
- 检查是否存在特定版本的依赖关系
- 获取具有可配置限制的依赖关系的版本历史记录
- 简单、专注的回答
- 通过MCP与Claude轻松集成
运作原理
当在Claude的设置中配置此MCP服务器时,它会在Claude系统提示的“已连接的MCP服务器”部分自动可用。这使Claude了解服务器的功能,并允许它通过 use_mcp_tool 命令。
服务器公开了三个工具:
get_clojars_latest_version
{
"name": "get_clojars_latest_version",
"description": "Get the latest version of a Clojars dependency (Maven artifact)",
"inputSchema": {
"type": "object",
"properties": {
"dependency": {
"type": "string",
"description": "Clojars dependency name in format \"group/artifact\" (e.g. \"metosin/reitit\")"
}
},
"required": ["dependency"]
}
}
check_clojars_version_存在
{
"name": "check_clojars_version_exists",
"description": "Check if a specific version of a Clojars dependency exists",
"inputSchema": {
"type": "object",
"properties": {
"dependency": {
"type": "string",
"description": "Clojars dependency name in format \"group/artifact\" (e.g. \"metosin/reitit\")"
},
"version": {
"type": "string",
"description": "Version to check (e.g. \"0.7.2\")"
}
},
"required": ["dependency", "version"]
}
}
get_clojars_history
{
"name": "get_clojars_history",
"description": "Get version history of a Clojars dependency",
"inputSchema": {
"type": "object",
"properties": {
"dependency": {
"type": "string",
"description": "Clojars dependency name in format \"group/artifact\" (e.g. \"metosin/reitit\")"
},
"limit": {
"type": "number",
"description": "Number of versions to return (default: 15, max: 100)",
"minimum": 1,
"maximum": 100
}
},
"required": ["dependency"]
}
}
工具名称和描述是专门为帮助Claude理解这些工具是用于从Clojars检索版本信息而设计的。当用户询问Clojars依赖关系时,Claude可以根据以下因素识别出这些工具适用于该任务:
- 工具名称明确表示其用途
- 描述指定它们用于“Clojars依赖关系(Maven工件)”
- 示例格式显示了典型的Clojars依赖模式
