图像查看器mcp
MCP服务器,使Claude能够查看配置目录中的图像,而无需手动上传。
特性
- 直接在Claude中查看图像 -无需拖放或上传
- 多目录支持 -根据需要配置尽可能多的图像目录
- 诊断工具 -列出目录并浏览可用图像
- 支持格式:PNG、JPG、JPEG、GIF、webp
工具
| 工具 | 说明 |
|---|---|
get_vault_image | 按文件名检索图像 |
list_directories | 列出已配置的目录及其状态 |
list_images | 列出特定目录中的所有图像 |
安装
选项1:构建和安装
git clone https://github.com/YOUR_USERNAME/image-viewer-mcp.git
cd image-viewer-mcp
npm install
npm run build然后双击 image-viewer.mcpb 安装在Claude Desktop中。
选项2:手动配置
添加到您的 claude_desktop_config.json:
{
"mcpServers": {
"image-viewer": {
"command": "node",
"args": [
"/path/to/image-viewer-mcp/server/index.js",
"--roots",
"/path/to/images,/another/path/to/images"
]
}
}
}目录之间用逗号分隔,没有空格。
配置
安装后,通过 .mcpb,在Claude Desktop中配置目录:
- 设置→ 扩展
- 查找“图像查看器”
- 添加包含图像的目录
用法
在克劳德:
"Show me diagram.png"
"List the configured image directories"
"What images are in directory 0?"
"Display the architecture screenshot"故障排除
“找不到图像”
- 跑
list_directories验证路径是否已配置并存在 - 跑
list_images查看每个目录中的可用文件 - 检查文件名拼写和扩展名
“未配置目录”
- 验证
--roots配置中的参数 - 配置更改后重新启动Claude Desktop
大图像失败
- 超过~1MB的图像可能超过MCP消息限制
- 查看前调整或压缩大图像
发展
npm install # Install dependencies
npm run validate # Validate manifest.json
npm run build # Build .mcpb extension
npm run clean # Remove build artifacts许可证
麻省理工学院
