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

@be-link/api-fox-mcp

v0.1.0

Published

MCP package for api-fox

Readme

api-fox mcp

通过 Apifox 开放 API 实现 API 文档“导入(写入)”与“导出(读取)”的 MCP 工具。

要求

  • Node.js >= 18

快速开始

pnpm install
pnpm run build
APIFOX_TOKEN="Bearer <your-token>" pnpm run start

服务启动后默认监听:POST http://localhost:3000/mcp

脚本

  • build: 使用 tsc 构建到 dist/
  • start: 运行 dist/index.js
  • lint: 占位,无实际校验
  • test: 占位,无实际测试

说明

需要依赖:@modelcontextprotocol/sdkexpresszodcorsaxios

环境变量

  • APIFOX_TOKEN(必需):形如 Bearer xxx 的 Token
  • APIFOX_API_VERSION(可选):Apifox API 版本(默认 2024-03-28
  • APIFOX_LOCALE(可选):locale 查询参数(默认 zh-CN
  • MCP_TRANSPORT(可选):httpstdio,默认 http
  • PORT(可选):HTTP 端口,默认 3000
  • APIFOX_PROJECT_ID(推荐):Apifox 项目 ID(也可在调用时通过 arguments.projectId 传入)

MCP 工具

  • import-openapi:将 OpenAPI/Swagger 导入 Apifox 项目(写入)
    • projectId(可选):若未传入则使用环境变量 APIFOX_PROJECT_ID
    • input(必需):可传 { "url": "<swagger-url>" } 或直接传 OpenAPI 字符串
    • options(可选):对应 Apifox 导入接口的高级配置
      • targetEndpointFolderId:接口导入到的目标目录 ID
      • targetSchemaFolderId:数据模型导入到的目标目录 ID
      • endpointOverwriteBehavior:接口覆盖策略,支持 OVERWRITE_EXISTINGAUTO_MERGEKEEP_EXISTINGCREATE_NEW
      • schemaOverwriteBehavior:数据模型覆盖策略,支持与上同样的枚举
      • updateFolderOfChangedEndpoint:是否在覆盖时同步更新接口所在目录
      • prependBasePath:是否在导入路径前追加 basePath
      • targetBranchId:目标分支 ID,未指定默认为主分支
      • moduleId:目标模块 ID,不指定则导入默认模块
    • locale / apiVersion(可选):覆盖默认查询参数与 X-Apifox-Api-Version
  • export-openapi:从 Apifox 项目导出 OpenAPI/Swagger 文档(读取)
    • projectId(可选):若未传入则使用环境变量 APIFOX_PROJECT_ID
    • scope(可选):导出范围,默认 { "type": "ALL" }
      • type: "ALL":导出全部接口,可配 excludedByTags
      • type: "SELECTED_ENDPOINTS":指定 selectedEndpointIds(数组)
      • type: "SELECTED_TAGS":指定 selectedTags(数组)
      • type: "SELECTED_FOLDERS":指定 selectedFolderIds(数组)
    • options(可选):includeApifoxExtensionPropertiesaddFoldersToTags
    • oasVersion(可选):导出 OpenAPI 版本,可选 2.03.03.1(默认 3.1)
    • exportFormat(可选):JSONYAML(默认 JSON)
    • environmentIds(可选):环境 ID 数组
    • branchId / moduleId(可选):导出目标分支与模块
    • locale / apiVersion(可选):覆盖默认查询参数与 header

许可证

MIT