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

windy-civitai-mcp

v1.0.3

Published

MCP server and CLI tool for querying Civitai images from the Civitai API

Readme

windy-civitai-mcp

一个 MCP 服务器和 CLI 工具,用于从 Civitai API 查询图像。

安装

要使用此工具,您需要安装 Node.js 和 npm。

# 如果要全局安装
npm install -g windy-civitai-mcp

# 或者直接使用 npx,不需要全局安装
npx windy-civitai-mcp <command> [options]

使用

命令行界面 (CLI)

您可以使用 query 命令直接从终端查询 Civitai 图像:

npx windy-civitai-mcp query --username C29 --limit 10 --sort Newest
npx windy-civitai-mcp query --modelId 12345 --nsfw None

query 命令的可用选项:

  • -l, --limit <number>: 返回的图像数量限制 (默认: 5)
  • -p, --postId <number>: 帖子ID
  • -m, --modelId <number>: 模型ID
  • -v, --modelVersionId <number>: 模型版本ID
  • -u, --username <string>: 用户名
  • -n, --nsfw <string>: NSFW 过滤 (None, Soft, Moderate, Mature, X)
  • -s, --sort <string>: 排序方式 (Newest, Oldest, Most Reactions, Most Comments, Most Downloads)
  • -P, --period <string>: 时间段过滤 (Day, Week, Month, Year, AllTime)
  • -g, --page <number>: 页码

Model Context Protocol (MCP) 服务器

此包还包含一个 MCP 服务器,它公开了 civitai_image_query 工具。您可以使用 start-server 命令启动服务器:

npx windy-civitai-mcp start-server

服务器将自动在当前工作目录中查找 mcp-config.json 以配置工具和端口。

mcp-config.json 示例:

{
  "$schema": "https://mcp.dev/schemas/mcp-config.json",
  "name": "windy-civitai-mcp-server",
  "port": 3000,
  "tools": [
    {
      "name": "civitai_image_query",
      "description": "查询 Civitai 的图像信息",
      "implementation": {
        "type": "javascript",
        "path": "index.js",
        "function": "civitaiImageQuery"
      },
      "input_schema": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "number",
            "description": "返回的图像数量限制",
            "default": 5
          },
          "postId": {
            "type": "number",
            "description": "帖子ID"
          },
          "modelId": {
            "type": "number",
            "description": "模型ID"
          },
          "modelVersionId": {
            "type": "number",
            "description": "模型版本ID"
          },
          "username": {
            "type": "string",
            "description": "用户名"
          },
          "nsfw": {
            "type": "string",
            "description": "NSFW过滤 (None, Soft, Moderate, Mature, X)",
            "enum": ["None", "Soft", "Moderate", "Mature", "X"]
          },
          "sort": {
            "type": "string",
            "description": "排序方式 (Newest, Oldest, Most Reactions, Most Comments, Most Downloads)",
            "enum": ["Newest", "Oldest", "Most Reactions", "Most Comments", "Most Downloads"]
          },
          "period": {
            "type": "string",
            "description": "时间段过滤 (Day, Week, Month, Year, AllTime)",
            "enum": ["Day", "Week", "Month", "Year", "AllTime"]
          },
          "page": {
            "type": "number",
            "description": "页码"
          }
        }
      },
      "output_schema": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "description": "图像列表"
          }
        },
        "additionalProperties": true
      }
    }
  ]
}

配置为 MCP 客户端服务器

如果您正在使用 MCP 客户端(如 Cline)并希望将 windy-civitai-mcp 集成为服务器,您需要在客户端的 MCP 配置文件(例如 Cline 的 .mcp-config.json)中添加类似以下的配置:

{
  "mcpServers": {
    "windy-civitai-mcp": {
      "command": "npx",
      "args": ["windy-civitai-mcp", "start-server"],
      "disabled": false
    }
  }
}

此配置告诉 MCP 客户端如何启动 windy-civitai-mcp 服务器。配置完成后,您可以在客户端中使用 use_mcp_tool 命令与此服务器提供的 civitai_image_query 工具进行交互。

发布到 npm

要将此包发布到 npm,请导航到 civitai-mcp 目录并运行:

npm publish

请确保您已登录 npm (npm login) 并拥有必要的权限。

开发

要在本地开发,克隆仓库后,导航到项目目录并安装依赖项:

npm install

然后您可以测试 CLI:

node index.js query --username C29 --limit 5
node index.js start-server