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

image-mcp-server

v0.1.1

Published

Grok2 Image MCP Server

Downloads

24

Readme

Grok2 Image MCP Server

一个基于 Model Context Protocol (MCP) 的 Grok-2 图像生成服务。此服务允许聊天助手通过 MCP 协议使用 Grok-2 模型生成图像。

安装

使用 npx(推荐)

npx -y grok2-image-mcp-server
{
    "mcpServers": {
        "grok2_image": {
            "command": "npx",
            "args": [
                "grok2-image-mcp-server"
            ],
            "env": {
                "XAIAPI_KEY": "xAI Key"
            }
        }
    }
}

环境变量

XAIAPI_KEY -> xAI Key

XAIAPI_BASE_URL(可选) -> 请求接口代理,若不填则默认使用 https://api.x.ai/v1,遇到无法访问的情况可使用第三方代理,末尾以v1结束

示例:

XAIAPI_BASE_URL=https://api-proxy.me/xai/v1  //某个公开代理,不保证可用性

IMAGE_PROXY_DOMAIN(可选) -> 图片代理域名,若不填则返回默认的图片接口域名 imgen.x.ai,遇到无法访问的情况可使用第三方代理

示例:

IMAGE_PROXY_DOMAIN=https://image.proxy.workers.dev

使用 cloudflare workers 代理图片 URL

遇到图片无法访问的情况,可以考虑使用 cloudflare workers 代理图片 URL,复制以下代码到 cloudflare workers 中,并部署,随后绑定自定义域名,并在环境变量中配置 IMAGE_PROXY_DOMAIN 为自定义域名,例如 https://image.proxy.workers.dev

addEventListener('fetch', event => {
  event.respondWith(handleRequest(event.request))
})

const TARGET_DOMAIN = 'imgen.x.ai'

async function handleRequest(request) {

  const url = new URL(request.url)
  const targetUrl = `https://${TARGET_DOMAIN}${url.pathname}${url.search}`


  const init = {
    method: request.method,
    headers: request.headers,
    body: request.method === 'GET' || request.method === 'HEAD' ? undefined : request.body,
    redirect: 'follow'
  }


  const response = await fetch(targetUrl, init)


  const newHeaders = new Headers(response.headers)
  newHeaders.set('Access-Control-Allow-Origin', '*')

  return new Response(response.body, {
    status: response.status,
    statusText: response.statusText,
    headers: newHeaders
  })
}

许可证

MIT