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

auto-api-mcp

v1.0.13

Published

Auto API - YApi接口信息获取工具,支持MCP协议

Readme

Auto API - YApi MCP 服务

一个基于 Model Context Protocol (MCP) 的 YApi 接口信息获取工具

🚀 功能特性

  • 📋 接口列表获取: 根据 YApi 分类页面 URL 获取接口列表
  • 📝 接口详情获取: 根据接口 ID 获取详细的请求/响应体信息
  • 🔧 环境变量支持: 支持通过环境变量配置认证信息
  • 🛡️ 错误处理: 完善的错误处理和用户友好的错误提示

📦 安装

NPM 安装

npm install -g auto-api-mcp

本地开发

git clone https://github.com/twelve-web/auto-api-mcp.git
cd auto-api-mcp
npm install
npm run build

🔧 配置

创建 .env 文件并添加 YApi 认证信息(可选):

YAPI_COOKIE="_yapi_token=your_token_here; _yapi_uid=your_uid_here"

🎯 在 MCP 客户端中使用

Claude Desktop 配置

~/Library/Application Support/Claude/claude_desktop_config.json 中添加:

{
  "mcpServers": {
    "auto-api-mcp": {
      "command": "auto-api-mcp",
      "env": {
        "YAPI_COOKIE": "_yapi_token=your_token; _yapi_uid=your_uid"
      }
    }
  }
}

使用 npx(推荐,无需安装)

{
  "mcpServers": {
    "auto-api-mcp": {
      "command": "npx",
      "args": ["--yes", "auto-api-mcp"],
      "env": {
        "YAPI_COOKIE": "_yapi_token=your_token; _yapi_uid=your_uid"
      }
    }
  }
}

其他 MCP 客户端

使用标准的 MCP 连接方式:

auto-api-mcp

🛠️ 可用工具

1. yapi_get_interfaces

获取指定分类下的接口列表

参数:

  • url (string): YApi 分类页面 URL,格式如 https://xxxxx.com/project/810/interface/api/cat_2783

示例:

工具: yapi_get_interfaces
参数: url = "https://xxxxx.com/project/810/interface/api/cat_2783"

2. yapi_get_interface_detail

获取指定接口的详细信息(请求体和响应体)

参数:

  • id (string): 接口 ID,来自接口列表中的 _id 字段
  • baseUrl (string, 可选): YApi 基础 URL,默认为 https://fxxxxx.com

示例:

工具: yapi_get_interface_detail
参数: id = "13955"

📖 使用流程

  1. 获取接口列表: 使用 yapi_get_interfaces 获取分类下的所有接口
  2. 复制接口 ID: 从返回结果中找到需要的接口,复制其 _id
  3. 获取接口详情: 使用 yapi_get_interface_detail 获取详细信息
  4. 生成类型定义: 基于返回的请求/响应体生成 TypeScript 类型

🔗 资源

项目还提供动态资源支持:

  • yapi://cat/{catId} - 获取指定分类的原始 JSON 数据

📄 License

MIT

🤝 贡献

欢迎提交 Issue 和 Pull Request!

📧 联系

如有问题,请提交 Issue 或联系作者。