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 🙏

© 2025 – Pkg Stats / Ryan Hefner

enos-aicoding-mcptools

v0.1.3

Published

EnOS AI Coding MCP Tools - Model Context Protocol tools for EnOS development, includes YApi integration, Wiki connection and other development tools

Readme

EnOS AI Coding MCP Tools

npm version Node.js Version License

EnOS AI Coding MCP Tools 是专为 EnOS 开发平台设计的 Model Context Protocol (MCP) 工具集,提供 YApi 接口管理功能,让你能够在 Cursor、Claude Desktop 等 AI 编程工具中直接操作 EnOS 开发相关资源。

✨ 特性

  • 🔍 智能搜索 - 按名称、路径、标签等多维度搜索 YApi 接口
  • 📖 接口详情 - 快速查看接口的完整定义(请求/响应结构、参数等)
  • ✏️ 接口管理 - 创建和更新接口定义,支持 JSON Schema 和表单数据
  • 📋 项目管理 - 列出项目、查看分类结构,轻松管理多个 YApi 项目
  • 性能优化 - 内置缓存机制,提高查询响应速度
  • 🔧 灵活配置 - 支持命令行参数、环境变量和配置文件
  • 🚀 双模式支持 - 支持 stdio 和 HTTP/SSE 两种运行模式
  • 📝 详细日志 - 可配置的日志级别,便于调试和监控

🎯 主要功能

接口查询和搜索

  • yapi_search_apis - 按项目、名称、路径、标签等条件搜索接口
  • yapi_get_api_desc - 获取特定接口的详细信息(请求/响应结构、参数等)
  • yapi_list_projects - 列出所有可访问的 YApi 项目
  • yapi_get_categories - 获取项目下的接口分类和接口列表

接口管理

  • yapi_save_api - 创建新接口或更新现有接口
    • 支持完整的接口定义(路径、方法、参数、请求体、响应等)
    • 支持 JSON Schema 和表单数据格式
    • 自动处理接口状态和分类管理

🚀 快速开始

方式一:使用 npx(推荐,无需安装)

  1. 获取 YApi Token

    • 登录 EnOS YApi 平台
    • 进入项目设置页面
    • 在 Token 配置中生成或查看 Token
  2. 配置 Cursor

    在 Cursor 设置文件(%APPDATA%\Cursor\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json 或类似位置)中添加:

{
  "mcpServers": {
    "enos-aicoding-mcptools": {
      "command": "npx",
      "args": [
        "-y",
        "enos-aicoding-mcptools",
        "--stdio",
        "--yapi-base-url=https://yapi.apaas-beta1.eniot.io",
        "--yapi-token=your_token_here",
        "--yapi-project-id=your_project_id"
      ]
    }
  }
}
  1. 重启 Cursor,开始使用!

方式二:使用环境变量

{
  "mcpServers": {
    "enos-aicoding-mcptools": {
      "command": "npx",
      "args": [
        "-y",
        "enos-aicoding-mcptools",
        "--stdio"
      ],
      "env": {
        "YAPI_BASE_URL": "https://yapi.apaas-beta1.eniot.io",
        "YAPI_TOKEN": "your_token_here",
        "YAPI_PROJECT_ID": "your_project_id",
        "YAPI_CACHE_TTL": "10",
        "YAPI_LOG_LEVEL": "info"
      }
    }
  }
}

方式三:本地开发模式

适合需要修改代码或调试的场景:

  1. 克隆和安装
git clone <repository-url>
cd kiro-mcp
pnpm install
  1. 配置环境变量

在项目根目录创建 .env 文件:

# YApi 基础配置(必需)
YAPI_BASE_URL=https://yapi.apaas-beta1.eniot.io
YAPI_TOKEN=your_token_here
YAPI_PROJECT_ID=your_project_id

# 服务器配置
PORT=3388

# 可选配置
YAPI_CACHE_TTL=10
YAPI_LOG_LEVEL=info
  1. 启动服务

SSE 模式(HTTP 服务,适合开发调试):

pnpm run dev

然后在 Cursor 中配置:

{
  "mcpServers": {
    "enos-aicoding-mcptools": {
      "url": "http://localhost:3388/sse"
    }
  }
}

Stdio 模式(生产环境推荐):

pnpm run build
node dist/cli.js --stdio

📖 使用指南

获取 YApi Token

  1. 登录你的 YApi 平台
  2. 进入项目设置页面
  3. 在 Token 配置中生成或查看 Token

使用示例

配置完成后,你可以在 Cursor 中直接使用自然语言与 AI 助手交互:

搜索接口

"帮我找一下用户登录相关的接口"

查看接口详情

"显示用户注册接口的详细信息,项目ID是 228,接口ID是 8570"

创建新接口

"帮我创建一个获取用户列表的接口,路径是 /api/users,使用 GET 方法,项目ID是 228,分类ID是 123"

更新接口

"更新用户登录接口,添加验证码参数,项目ID是 228,接口ID是 8570"

查看项目列表

"列出所有可用的 YApi 项目"

查看项目分类

"显示项目 228 下的所有接口分类和接口列表"

⚙️ 配置说明

命令行参数

| 参数 | 描述 | 示例 | 默认值 | | -------------------- | ----------------------------- | ---------------------------------------------- | ------ | | --yapi-base-url | YApi 服务器基础 URL | --yapi-base-url=https://yapi.apaas-beta1.eniot.io | https://yapi.apaas-beta1.eniot.io | | --yapi-token | YApi 访问令牌(必需) | --yapi-token=your_token_here | - | | --yapi-project-id | YApi 项目 ID(必需) | --yapi-project-id=123 | - | | --yapi-cache-ttl | 缓存时效(分钟) | --yapi-cache-ttl=10 | 10 | | --yapi-log-level | 日志级别 | --yapi-log-level=info | info | | --port | HTTP 服务端口(SSE 模式) | --port=3388 | 3388 | | --stdio | 启用 stdio 模式(MCP 必需) | --stdio | - |

环境变量

创建 .env 文件进行配置:

# 必需配置
YAPI_BASE_URL=https://yapi.apaas-beta1.eniot.io
YAPI_TOKEN=your_token_here
YAPI_PROJECT_ID=your_project_id

# 可选配置
PORT=3388                    # HTTP 服务端口
YAPI_CACHE_TTL=10           # 缓存时效(分钟)
YAPI_LOG_LEVEL=info         # 日志级别:debug, info, warn, error

日志级别说明

  • debug - 输出所有日志,包括详细的调试信息
  • info - 输出信息、警告和错误日志(默认)
  • warn - 只输出警告和错误日志
  • error - 只输出错误日志

配置优先级

配置优先级从高到低:命令行参数 > 环境变量 > 默认值

🛠️ 开发

项目结构

kiro-mcp/
├── src/
│   ├── index.ts          # 入口文件
│   ├── server.ts         # MCP 服务器实现
│   ├── config.ts         # 配置管理
│   ├── cli.ts            # CLI 入口
│   └── services/
│       └── yapi/         # YApi 服务实现
│           ├── api.ts    # API 客户端
│           ├── cache.ts  # 缓存管理
│           ├── logger.ts # 日志工具
│           └── types.ts  # 类型定义
├── dist/                 # 编译输出
├── package.json
└── README.md

可用脚本

# 构建项目
pnpm run build

# 类型检查
pnpm run type-check

# 开发模式(SSE)
pnpm run dev

# 开发模式(Stdio)
pnpm run dev:cli

# 代码检查
pnpm run lint

# 代码格式化
pnpm run format

# MCP 检查器(调试用)
pnpm run inspect

调试

使用 MCP Inspector 进行调试:

pnpm run inspect

然后在浏览器中打开显示的 URL 进行调试。

📦 安装要求

  • Node.js >= 18.0.0
  • pnpm(推荐)或 npm

🤝 贡献

欢迎提交 Issue 和 Pull Request!

📄 许可证

MIT

👤 作者

eric.zhang [email protected]

🔗 相关链接


注意:本项目专为 EnOS 开发平台设计,使用前请确保你有相应的 YApi 访问权限。