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

mcp-faker-json

v1.1.4

Published

MCP server for mock faker json

Readme

mcp-faker-json

背景

在前端开发过程中,我们常常需要在接口尚未完成的阶段进行 mock 数据处理。通常的做法是根据后端提供的接口文档进行开发,同时使用第三方库(如 json-schema-faker)生成模拟数据。然而,实际使用中常会遇到诸如枚举值缺失、字段语义不清等问题,导致 mock 数据效果不理想。

为了解决这些痛点,我们结合 AIMCP 服务,自动解析接口文档,生成更贴合业务的高质量 mock 数据,大幅提升开发效率与数据真实感。

功能特性

  • 支持通过 YApi 接口文档地址一键生成 mock 数据,智能识别类型注释,生成合理的数据
  • 支持stdio/sse/http transport
  • 支持命令式创建token 配置文件

快速开始

要求

  • nodejs >= 18.16.1
  • vscode,cursor或其他MCP客户端

安装

在VSCode安装

将此内容添加到你的VSCode MCP配置文件.vscode/mcp.json中。更多信息请参见VSCode MCP文档

{
  "servers": {
    "mcpfakerjson": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "mcp-faker-json@latest"],
    }
  }
}

在cursor安装

将此内容添加到cursor配置文件.cursor/mcp.json中。更多信息请参见cursor MCP

{
  "mcpServers": {
    "faker-json": {
      "command": "npx",
      "args": ["-y", "mcp-faker-json@latest"]
    }
  }
}

配置token

在开始使用前,需要先配置token。访问yapi文档需要token。

  • 可以在url上携带。例如https://xxx/xxx?token=xxx

  • 环境变量配置

    {
      "servers": {
        "mcpfakerjson": {
          "type": "stdio",
          "command": "npx",
          "args": ["-y", "mcp-faker-json@latest"],
          "env": {
            "YAPI_TOKEN": "xxxx"
          }
        }
      }
    }
  • 配置文件(推荐,不同的项目会有不同的token,根据projectId映射token)。环境变量读取配置文件的路径可以通过环境变量配置YAPI_TOKEN_CONFIG,默认从path.join(os.homedir(), ".yapi-token.json")读取。

    {
      "servers": {
        "mcpfakerjson": {
          "type": "stdio",
          "command": "npx",
          "args": ["-y", "mcp-faker-json@latest"],
          "env": {
            "YAPI_TOKEN_CONFIG": "xxxx"
          }
        }
      }
    }
      
    // yapi-token.json内容
    {
      "项目ID": "your token"
    }

快速创建token配置文件

为了方便用户快速创建配置文件。可以使用提供的命令npx mcp-faker-json@latest -c。目前只支持默认在path.join(os.homedir(), ".yapi-token.json")创建。

1.1.1版本 支持通过读取YAPI_TOKEN_CONFIG环境变量读取路径创建

vscode使用示例

具体参考传送门

  1. vscode设置启用mcp服务。打开设置页面搜索 chat mcp
  2. 打开.vscode/mcp.json的文件,点击start
  3. vscode右上角打开ai聊天页面
  4. 聊天框 配置agent
  5. 在输入框输入链接发送,并选择continue

最终ai会输出mock数据~大功告成!

Cursor使用示例

传送门。可以参考官方文档这里就不再说明了。