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

glm-cogview-mcp

v1.0.4

Published

智谱AI CogView图像生成MCP服务器 - 支持文生图功能

Readme

glm-cogview-mcp

智谱AI CogView图像生成MCP服务器 - 为Claude Desktop和其他MCP客户端提供文生图功能。

功能特性

  • 🎨 支持智谱AI的CogView系列模型(cogview-4-250304、cogview-4、cogview-3-flash)
  • 🖼️ 自定义图像尺寸和质量
  • ⚙️ 可选水印控制
  • 🔒 通过环境变量安全管理API密钥
  • 📦 易于通过npx集成到MCP客户端

安装

方式一:通过npx使用(推荐)

无需安装,直接在Claude Desktop配置文件中使用:

{
  "mcpServers": {
    "glm-cogview-mcp": {
      "command": "npx",
      "args": ["glm-cogview-mcp"],
      "env": {
        "ZHIPU_API_KEY": "你的智谱API密钥"
      }
    }
  }
}

方式二:全局安装

npm install -g glm-cogview-mcp

然后在Claude Desktop配置:

{
  "mcpServers": {
    "glm-cogview-mcp": {
      "command": "glm-cogview-mcp",
      "env": {
        "ZHIPU_API_KEY": "你的智谱API密钥"
      }
    }
  }
}

配置

获取智谱API密钥

  1. 访问 智谱AI开放平台
  2. 注册并登录账号
  3. 在控制台创建API密钥

Claude Desktop配置文件位置

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

完整配置示例

{
  "mcpServers": {
    "glm-cogview-mcp": {
      "command": "npx",
      "args": ["-y", "glm-cogview-mcp"],
      "env": {
        "ZHIPU_API_KEY": "your-api-key-here"
      }
    }
  }
}

注意:使用 -y参数可以自动确认安装,避免交互式提示。

使用方法

配置完成后,重启Claude Desktop,你就可以在对话中使用图像生成功能了:

基础用法

请帮我生成一张图片:一只可爱的橘猫坐在窗台上晒太阳

指定模型

使用cogview-4-250304模型生成:未来城市的夜景,赛博朋克风格

自定义参数

生成一张高清图片:
- 描述:宁静的山水画,水墨风格
- 尺寸:1920x1080
- 质量:hd
- 不要水印

可用工具

generate_image

生成图像的主要工具。

参数:

  • prompt (必需): 图像的文本描述
  • model (可选): 模型版本
    • cogview-4-250304 (最新版本)
    • cogview-4 (默认)
    • cogview-3-flash
  • quality (可选): 图像质量
    • hd: 高清质量(耗时更长)
    • standard: 标准质量(默认)
  • size (可选): 图片尺寸,如 1024x1024, 512x512, 1920x1080
  • watermarkEnabled (可选): 是否添加水印,默认为 true
  • userId (可选): 终端用户ID,用于跟踪和审计

示例:

{
  "prompt": "一只在月光下的狼,写实风格",
  "model": "cogview-4-250304",
  "quality": "hd",
  "size": "1024x1024",
  "watermarkEnabled": false
}

开发

本地开发

git clone <your-repo-url>
cd glm-cogview-mcp
npm install
npm run build

测试

# 开发模式运行
npm run dev

# 构建
npm run build

本地测试MCP服务器

在Claude Desktop配置中使用本地路径:

{
  "mcpServers": {
    "glm-cogview-mcp": {
      "command": "node",
      "args": ["/path/to/glm-cogview-mcp/dist/index.js"],
      "env": {
        "ZHIPU_API_KEY": "your-api-key-here"
      }
    }
  }
}

注意事项

  • ⏰ 生成的图片链接有效期为30天,请及时保存
  • 🔑 请妥善保管你的API密钥,不要提交到代码仓库
  • 💰 使用API会消耗智谱AI的额度,请注意账户余额
  • 🛡️ 所有生成的内容会经过智谱AI的安全审核

支持的模型

| 模型名称 | 描述 | 推荐用途 | | ---------------- | -------- | -------------- | | cogview-4-250304 | 最新版本 | 最佳质量和效果 | | cogview-4 | 标准版本 | 平衡质量和速度 | | cogview-3-flash | 快速版本 | 快速生成 |

许可证

MIT

作者

zijie

贡献

欢迎提交Issue和Pull Request!

相关链接