Cover image
Try Now
2025-04-14

是一个用于 Cursor 编辑器的 MCP 工具 , 可以帮助你快速查看和使用 Swagger API 文档。

3 years

Works with Finder

0

Github Watches

0

Github Forks

0

Github Stars

Swagger Viewer MCP 工具

这是一个用于 Cursor 编辑器的 MCP 工具,可以帮助你快速查看和使用 Swagger API 文档。

功能特点

  • 自动读取用户根目录下的 swagger.json 配置文件
  • 实时监控配置文件变化,自动更新 API 文档
  • 支持模糊搜索 API 接口
  • 自动生成接口调用代码
  • 支持查看所有可用接口

安装

npm install

配置

在用户根目录下创建 swagger.json 文件,格式如下:

{
    "swaggerUrl": "https://your-swagger-api-url/swagger.json"
}

npx:

"swagger-viewer": {
      "command": "cmd",
      "swagger-viewer": {
      "command": "cmd",
      "args": ["/c", "npx", "-y", "@xc_angelwatch/swagger-viewer"]
    }
}

使用方法

该工具提供以下 MCP 接口:

  1. mcp_swagger_initialize(): 初始化工具,加载配置
  2. mcp_swagger_search(query): 搜索接口
  3. mcp_swagger_generate_code(path, method, language): 生成接口调用代码
  4. mcp_swagger_get_all_endpoints(): 获取所有可用接口

示例用法

// 初始化
await mcp_swagger_initialize();

// 搜索包含 "user" 的接口
const results = await mcp_swagger_search("user");

// 生成特定接口的代码
const code = await mcp_swagger_generate_code("/api/users", "GET", "javascript");

// 获取所有接口
const endpoints = await mcp_swagger_get_all_endpoints();

配置文件监控

工具会自动监控用户根目录下的 swagger.json 文件变化。当文件发生变化时,会自动重新加载最新的 API 文档。

支持的编程语言

目前支持生成以下语言的代码:

相关推荐

  • av
  • Führen Sie mühelos LLM -Backends, APIs, Frontends und Dienste mit einem Befehl aus.

  • 1Panel-dev
  • 🔥 1Panel bietet eine intuitive Weboberfläche und einen MCP -Server, um Websites, Dateien, Container, Datenbanken und LLMs auf einem Linux -Server zu verwalten.

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 llm 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Zusammenfassung der weltbesten LLM -Ressourcen.

  • rulego
  • ⛓️Rugele ist ein leichter, leistungsstarker, leistungsstarker, eingebetteter Komponenten-Orchestrierungsregel-Motor-Rahmen für GO.

  • sigoden
  • Erstellen Sie einfach LLM -Tools und -Argarten mit einfachen Bash/JavaScript/Python -Funktionen.

  • hkr04
  • Leichtes C ++ MCP (Modellkontextprotokoll) SDK

  • RockChinQ
  • 😎简单易用、🧩丰富生态 - 大模型原生即时通信机器人平台 | 适配 qq / 微信(企业微信、个人微信) / 飞书 / 钉钉 / diskord / telegram / slack 等平台 | 支持 Chatgpt 、 Deepseek 、 Diffy 、 Claude 、 Gemini 、 xai 、 ppio 、 、 ulama 、 lm Studio 、阿里云百炼、火山方舟、 siliconflow 、 qwen 、 mondshot 、 chatglm 、 sillytraven 、 mcp 等 llm 的机器人 / agent | LLM-basierte Instant Messaging Bots-Plattform, unterstützt Zwietracht, Telegramm, Wechat, Lark, Dingtalk, QQ, Slack

  • dmayboroda
  • On-Premise-Konversationslappen mit konfigurierbaren Behältern

  • modelscope
  • Bauen Sie LLM-Multi-Agent-Anwendungen auf einfachere Weise auf.

  • paulwing
  • Ein Test -Repository, das mit MCP -Dienst erstellt wurde

    Reviews

    3.8 (6)
    Avatar
    user_z1DJpp21
    2025-04-24

    I've been using swagger-viewer, created by xiezhuo0513, and it has significantly improved my workflow. The intuitive design and user-friendly interface make navigating API documentation a breeze. With no steep learning curve and seamless integration into my environment, it's become an indispensable tool in my development process. Highly recommend it to anyone looking for a reliable documentation viewer.

    Avatar
    user_HWVJX2Ek
    2025-04-24

    The Swagger Viewer by xiezhuo0513 is an exceptional tool for API documentation. It's user-friendly and streamlines the process of viewing and interacting with Swagger files. Highly recommend it!

    Avatar
    user_QQOqigCG
    2025-04-24

    As a dedicated user of mcp, I truly appreciate the Swagger-Viewer by xiezhuo0513. This tool is fantastic for seamless API documentation visualization, and it integrates smoothly with multiple languages. It provides clear and intuitive interfaces for developers, making API exploration effortless. Highly recommended!

    Avatar
    user_DltwAXrK
    2025-04-24

    I've been using swagger-viewer by xiezhuo0513 extensively and it has significantly improved my workflow. The intuitive interface and seamless integration with existing projects make it an indispensable tool for anyone developing APIs. The welcome message and straightforward starting URL guide users perfectly, and the language support ensures it's accessible to a wide audience. Highly recommend!

    Avatar
    user_fAazWaDe
    2025-04-24

    As a dedicated user of the swagger-viewer by xiezhuo0513, I am thoroughly impressed with its functionality. This tool provides a seamless and efficient way to view Swagger documentation directly within the application. It delivers an intuitive user interface and supports easy navigation through API endpoints. Highly recommend it to developers who regularly work with Swagger files. This has become an indispensable part of my development workflow!

    Avatar
    user_xfu4fncu
    2025-04-24

    "I recently started using Swagger Viewer by xiezhuo0513, and it's a game changer for visualizing Swagger documentation. The interface is clean and intuitive, making API design and review effortless. Highly recommend for developers looking to streamline their API workflow!"