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

@kikyou/apikit-group-export

v1.0.1

Published

从 APIKit 分组链接映射出可用于 MCP 的接口 ID 列表

Readme

@kikyou/apikit-group-export

独立 Node.js 脚本项目,技术栈与 /Users/mac/mastergo-export 一致(原生 Node + Playwright 依赖结构),用于把 APIKit 的分组链接转换成 MCP 可识别的接口 ID 列表。

✨ 现已支持 MCP 服务器模式! 可直接集成到 Claude Desktop、Cursor 等 AI 工具中使用。

快速开始

方式一:MCP 服务器模式(推荐)

查看下方 🚀 MCP 服务器模式 章节了解如何配置 AI 工具。

方式二:传统命令行模式

使用方式(传统模式)

  1. 编辑根目录 config.json(运行时默认读取,无需再在命令行传参):
{
  "url": "https://<your-apikit-host>/home/api-studio/inside/<projectHashKey>/api/<groupId>/list?spaceKey=<spaceKey>",
  "token": "从浏览器复制的 Authorization 值",
  "pageSize": 100,
  "output": "./group-<groupId>.json"
}
  • token 优先从 Session Storagehttps://<your-apikit-host>eo_plug_base_info.authorization 复制;找不到时再从 Local StorageAuthorization 复制。
  1. 在终端执行:
npm start
 # 如需切换配置文件,可用环境变量:CONFIG_PATH=/path/to/another-config.json npm start

输出说明

脚本会生成如下 JSON(示例):

{
  "meta": {
    "spaceKey": "<spaceKey>",
    "projectHashKey": "lRnLlr...",
    "groupId": "3293623",
    "total": 390,
    "pageSize": 100
  },
  "apis": [
    {
      "apiID": 56245585,
      "apiName": "腾讯业务单元-新增",
      "apiURI": "/api/adq/organization/create",
      "groupPath": "1974772,1987989,1987992,1998209",
      "groupPathIds": ["1974772", "1987989", "1987992", "1998209"],
      "groupName": "腾讯账号",
      "mockEnable": true,
      "creator": "肖新明",
      "updater": "肖新明",
      "lastUpdateTime": "2025-11-18 18:25:22"
    }
  ]
}

apiID 即为 APIKit MCP 支持的文档 ID,可逐个在 MCP 中查询详情。


🚀 MCP 服务器模式(新功能)

本项目现已支持作为 MCP (Model Context Protocol) 服务器运行,可以让 AI 助手直接调用导出功能,无需手动配置 config.json

安装依赖

npm install

配置 AI 工具

Claude Desktop

编辑配置文件:

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

添加以下配置(推荐:将 token 配置在这里,避免每次都要告诉 AI):

{
  "mcpServers": {
    "apikit-export": {
      "command": "node",
      "args": ["/Users/mac/apikit-group-export/mcp-server.js"],
      "env": {
        "APIKIT_TOKEN": "<YOUR_APIKIT_TOKEN>"
      }
    }
  }
}

重要说明

  • APIKIT_TOKEN 设置为你的实际 token(从浏览器复制)
  • 配置后,使用时只需提供 URL,无需每次都提供 token
  • 需要更换 token 时,让 AI 帮你修改配置文件即可

Cursor

在 Cursor 设置中的 MCP 配置添加(推荐:将 token 配置在这里):

{
  "mcpServers": {
    "apikit-export": {
      "command": "node",
      "args": ["/Users/mac/apikit-group-export/mcp-server.js"],
      "env": {
        "APIKIT_TOKEN": "<YOUR_APIKIT_TOKEN>"
      }
    }
  }
}

在 AI 中使用

如果已配置 APIKIT_TOKEN 环境变量(推荐):

只需提供 URL 即可:

请帮我导出这个 APIKit 分组的所有接口:
https://<your-apikit-host>/home/api-studio/inside/xxx/api/xxx/list?spaceKey=<spaceKey>

如果未配置 token:

需要同时提供 URL 和 token:

请帮我导出这个 APIKit 分组的所有接口:
URL: https://<your-apikit-host>/home/api-studio/inside/xxx/api/xxx/list?spaceKey=<spaceKey>
Token: <YOUR_APIKIT_TOKEN>

AI 会自动调用 export_apikit_group 工具,返回完整的接口列表 JSON 数据。

MCP 工具参数

  • url (必需): APIKit 分组链接
  • token (可选): 授权 token(从浏览器复制)
    • 如果不提供,将使用配置中的 APIKIT_TOKEN 环境变量
    • 如果两者都没有,会报错提示
  • pageSize (可选): 每页接口数量,默认 100

获取 Token 的方法

  1. 打开浏览器访问 APIKit:https://<your-apikit-host>
  2. 打开开发者工具(F12)
  3. 优先从 Session Storageeo_plug_base_info.authorization 复制
  4. 如果找不到,从 Local StorageAuthorization 复制
  5. 将复制的 token 配置到 MCP 服务器的 env.APIKIT_TOKEN

本地测试 MCP 服务器

🚀 快速开始(推荐)

  1. 复制并配置 token
# 复制环境变量模板
cp .env.example .env

# 编辑 .env 文件,填入你的实际 token
# APIKIT_TOKEN=<YOUR_APIKIT_TOKEN>
  1. 一键启动调试
npm run dev

这会自动:

  • .env 文件加载 token
  • 启动 MCP Inspector
  • 在浏览器打开调试界面(http://localhost:6274)

在调试界面中,只需填写 url 参数即可测试,token 会自动使用 .env 中配置的值。

📋 可用的调试脚本

# 开发调试(从 .env 加载 token)
npm run dev

# 等同于
npm run inspect:env

# 不带 token 启动(测试时需要手动输入 token)
npm run inspect

# 直接运行 MCP 服务器(不启动调试界面)
npm run mcp

传统命令行模式