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

ecommerce-mcp-cli

v1.0.1

Published

MCP (Model Context Protocol) CLI for Ecommerce Generator

Readme

Ecommerce MCP CLI

MCP (Model Context Protocol) CLI 工具,用于将 Ecommerce Generator 服务连接到 Claude Desktop 等 AI 客户端。

安装

全局安装(推荐)

npm install -g ecommerce-mcp-cli
# 或
pnpm add -g ecommerce-mcp-cli
# 或
yarn global add ecommerce-mcp-cli

使用 npx(无需安装)

npx ecommerce-mcp-cli

使用方法

1. 获取 MCP Token

在 Ecommerce Generator 网站的"MCP Token"页面创建一个 Token。

2. 设置环境变量

export MCP_TOKEN=your-token-here
export API_URL=http://localhost:3000  # 可选,默认为 http://localhost:3000

3. 启动服务

ecommerce-mcp

4. 配置 Claude Desktop

在 Claude Desktop 配置文件中添加:

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

{
  "mcpServers": {
    "ecommerce-generator": {
      "command": "ecommerce-mcp",
      "env": {
        "MCP_TOKEN": "your-token-here",
        "API_URL": "http://localhost:3000"
      }
    }
  }
}

5. 重启 Claude Desktop

配置完成后,重启 Claude Desktop 即可使用 MCP 服务。

环境变量

| 变量名 | 必需 | 默认值 | 说明 | |--------|------|--------|------| | MCP_TOKEN | 是 | - | MCP 认证 Token(从网站获取) | | API_URL | 否 | http://localhost:3000 | Ecommerce Generator API 地址 | | DEBUG | 否 | - | 启用调试日志 |

MCP Tools

当前支持的 MCP Tools:

| Tool 名称 | 描述 | 参数 | |-----------|------|------| | get_user_credits | 获取用户积分余额 | 无 | | get_user_products | 获取用户产品列表 | limit (可选,默认 10) | | get_user_tasks | 获取用户任务列表 | status (可选), limit (可选,默认 10) |

开发

构建

npm run build
# 或
pnpm build

本地测试

# 开发模式(监听文件变化)
npm run dev

# 直接运行
MCP_TOKEN=test-token node dist/cli.js

发布到 npm

# 1. 更新版本号
npm version patch  # 或 minor, major

# 2. 构建
npm run build

# 3. 发布
npm publish

故障排查

Token 无效

  • 检查 MCP_TOKEN 环境变量是否正确设置
  • 确认 Token 未被撤销或过期

连接失败

  • 检查 API_URL 是否指向正确的服务地址
  • 确认 Ecommerce Generator 服务正在运行

Tools 不工作

  • 确认用户有足够的权限访问相关数据
  • 启用调试日志:DEBUG=1 ecommerce-mcp

许可证

MIT