npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mcp-ask-image

v1.0.1

Published

MCP Server for ask_image - automatically describe images using vision models

Downloads

305

Readme

ask-image MCP Server

MCP 工具,用于在主模型不支持图片识别时,调用视觉模型获取图片的文字描述。

安装

npm install -g mcp-ask-image

安装后即可在全局使用 ask-image 命令。

环境变量

| 变量名 | 必填 | 默认值 | 说明 | |--------|------|--------|------| | ASK_IMAGE_API_KEY | 是 | - | API 密钥 | | ASK_IMAGE_BASE_URL | 否 | https://opencode.ai/zen/go/v1 | API 基础地址(兼容 OpenAI 格式) | | ASK_IMAGE_MODEL | 否 | qwen3.7-plus | 使用的视觉模型名称 | | ASK_IMAGE_MAX_TOKENS | 否 | 4096 | 最大输出 token 数 |

配置示例

opencode

1. 注册 MCP Server

opencode.jsonmcpServers 中添加:

{
  "mcpServers": {
    "ask-image": {
      "command": "ask-image",
      "env": {
        "ASK_IMAGE_API_KEY": "your-api-key"
      }
    }
  }
}

2. 安装并配置 opencode-easy-vision 插件

安装插件(需要 opencode CLI v1.3.4+):

# 全局安装(所有项目生效)
opencode plugin opencode-easy-vision --global

# 项目级安装(仅当前目录生效)
opencode plugin opencode-easy-vision

或手动在 opencode.jsonplugins 数组中添加:

{
  "plugins": [
    "opencode-easy-vision"
  ]
}

然后创建 opencode-easy-vision.jsonc 配置文件,使不支持识图的模型自动通过此 MCP 分析图片:

{
  // 启用插件的模型列表
  // 通配符: "*" = 所有, "provider/*" = 指定 provider 所有模型,
  // "*/model" = 任意 provider 指定模型, "provider/model" = 精确匹配
  "models": [
    "*"
  ],

  // MCP 工具名称,固定为 ask-image_ask_image
  "imageAnalysisTool": "ask-image_ask_image",

  // 自定义提示模板,支持以下变量:
  //   {imageList}  — 换行分隔的 "- Image N: /path"
  //   {imageCount} — 图片数量
  //   {toolName}   — MCP 工具名
  //   {userText}   — 用户原始文本 (可为空)
  // 设为 null 使用内置默认模板
  "promptTemplate": null,

  // 粘贴图片暂存目录,null 使用系统临时目录 + opencode-easy-vision/
  "tempDir": null,

  // 插件启动时清理超过此小时数的临时文件
  "cleanupAfterHours": 24
}

配置项说明:

| 字段 | 类型 | 默认值 | 说明 | |------|------|--------|------| | models | string[] | ["*"] | 启用插件的模型列表 | | imageAnalysisTool | string | - | MCP 工具名,固定为 ask-image_ask_image | | promptTemplate | string | null | 自定义提示模板,支持变量插值,null 使用默认模板 | | tempDir | string | null | 图片暂存目录,null 使用系统临时目录 | | cleanupAfterHours | number | 24 | 临时文件过期清理时间(小时) |

Claude Desktop

claude_desktop_config.json 中添加:

{
  "mcpServers": {
    "ask-image": {
      "command": "ask-image",
      "env": {
        "ASK_IMAGE_API_KEY": "your-api-key"
      }
    }
  }
}

工具

ask_image

当主模型不支持图片识别时,调用此工具获取图片的文字描述。

参数:

| 参数 | 必填 | 说明 | |------|------|------| | image_path | 是 | 图片文件的本地绝对路径 | | prompt | 否 | 自定义分析提示词,默认进行详细通用描述 |

支持格式: PNG、JPEG、GIF、WebP

限制: 单张图片不超过 20MB,超过 1024px 的图片会自动压缩。