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

@neigri/yapi-mcp-server

v1.0.0

Published

YApi MCP Server - 从YApi文档链接读取接口信息并提供给大模型

Downloads

18

Readme

YApi MCP Server (Go版本)

一个用Go语言实现的Model Context Protocol (MCP) 服务器,用于从YApi文档链接读取接口信息并提供给大模型使用。

特性

  • 🚀 使用Go实现,性能优异
  • 📦 支持通过npm/npx发布和使用
  • 📖 从YApi文档链接读取单个接口信息
  • 📚 获取YApi项目中所有接口列表
  • 🔍 在YApi项目中搜索接口
  • 🔌 支持YApi API和HTML页面解析

快速开始

方式1: 通过npx使用(推荐)

npx -y yapi-mcp-server@latest

方式2: 本地构建

# 安装Go依赖
go mod download

# 构建
make build
# 或
go build -o bin/yapi-mcp-server .

# 运行
./bin/yapi-mcp-server

在Claude Desktop中配置

在Claude Desktop的配置文件中添加:

{
  "mcpServers": {
    "yapi-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "yapi-mcp-server@latest"
      ],
      "env": {
        "YAPI_BASE_URL": "http://your-yapi-instance.com",
        "YAPI_TOKEN": "your-token-optional"
      }
    }
  }
}

如果发布到私有npm仓库:

{
  "mcpServers": {
    "yapi-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@your-scope/yapi-mcp-server@latest"
      ],
      "env": {
        "YAPI_BASE_URL": "http://your-yapi-instance.com",
        "YAPI_TOKEN": "your-token-optional"
      }
    }
  }
}

可用工具

MCP服务器提供以下工具:

1. get_yapi_interface

从YApi文档链接读取单个接口信息。

参数:

  • url (string, 必需): YApi文档链接

2. get_yapi_project_interfaces

获取YApi项目中所有接口的列表。

参数:

  • project_url (string, 必需): YApi项目URL或项目ID

环境变量

  • YAPI_BASE_URL: YApi实例的基础URL(可选)
  • YAPI_TOKEN: YApi访问令牌(可选,用于API访问)

项目结构

yapi-mcp-server/
├── main.go              # 主程序入口
├── yapi_parser.go       # YApi解析器实现
├── go.mod               # Go模块定义
├── package.json         # npm包配置
├── Makefile            # 构建脚本
├── scripts/
│   └── build.js        # npm构建脚本
├── README.md           # 项目说明
├── QUICKSTART.md       # 快速开始指南
└── 发布指南.md         # 发布指南

开发

本地开发

# 安装Go依赖
go mod download
go mod tidy

# 运行
go run .

# 构建
make build

# 构建多平台
make build-all

测试

# 运行测试(需要先编写测试)
go test ./...

发布到私有npm仓库

详细步骤请参考 发布指南.md

许可证

MIT License

贡献

欢迎提交Issue和Pull Request!