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

nei-mcp-server

v1.1.1

Published

MCP Server for NEI platform - enables AI assistants to query NEI interface definitions

Readme

NEI MCP Server

Model Context Protocol (MCP) 服务器,让 AI 助手(Claude Desktop、Cursor 等)可以直接查询 NEI 接口定义。

功能

  • get_interface: 获取单个接口的详细定义,包括请求/响应参数及关联数据类型
  • list_interfaces: 列出项目中的所有接口,支持按 HTTP 方法和路径筛选
  • get_datatypes: 获取项目中的数据类型定义

安装

使用 npx(推荐)

无需安装,直接配置 MCP 使用:

{
  "mcpServers": {
    "nei": {
      "command": "npx",
      "args": ["-y", "nei-mcp-server"],
      "env": {
        "NEI_PRIVATE_TOKEN": "你的 NEI Private Token"
      }
    }
  }
}

全局安装

npm install -g nei-mcp-server

配置

获取 NEI Private Token

  1. 登录 NEI 平台
  2. 进入个人设置 → API Token
  3. 复制 Private Token

Token 配置方式

支持以下方式配置 Token(按优先级排序):

  1. 命令行参数

    {
      "mcpServers": {
        "nei": {
          "command": "npx",
          "args": ["-y", "nei-mcp-server", "--token", "your-token-here"]
        }
      }
    }
  2. MCP 配置环境变量(推荐)

    {
      "mcpServers": {
        "nei": {
          "command": "npx",
          "args": ["-y", "nei-mcp-server"],
          "env": {
            "NEI_PRIVATE_TOKEN": "your-token-here"
          }
        }
      }
    }
  3. 系统环境变量

    export NEI_PRIVATE_TOKEN="your-token-here"
  4. 本地 nei-ts-helper 配置文件(零配置)

    如果你已经使用过 nei-ts-helper CLI 工具并保存过 Token,MCP Server 会自动读取 ~/.nei-ts-helper/config.json 中的配置,无需额外设置!

    // MCP 配置无需指定 Token
    {
      "mcpServers": {
        "nei": {
          "command": "npx",
          "args": ["-y", "nei-mcp-server"]
        }
      }
    }

在 AI 助手中使用

Claude Desktop

编辑 ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "nei": {
      "command": "npx",
      "args": ["-y", "nei-mcp-server"],
      "env": {
        "NEI_PRIVATE_TOKEN": "your-token-here"
      }
    }
  }
}

重启 Claude Desktop 后,你可以这样使用:

请帮我查看 NEI 接口 12345 的定义

Cursor

编辑 .cursor/mcp.json

{
  "mcpServers": {
    "nei": {
      "command": "npx",
      "args": ["-y", "nei-mcp-server"],
      "env": {
        "NEI_PRIVATE_TOKEN": "your-token-here"
      }
    }
  }
}

工具说明

get_interface

获取单个接口的详细定义。

参数:

  • interface_id (必填): NEI 接口 ID
  • include_datatypes (可选): 是否包含关联的数据类型定义,默认 true

示例返回:

# 接口: 获取用户信息

- **ID**: 12345
- **路径**: /api/user/info
- **方法**: GET
- **描述**: 获取当前登录用户的信息

## 请求参数
无请求参数

## 响应参数
- `id`: Number (必填) - 用户 ID
- `name`: String (必填) - 用户名称
- `avatar`: String (可选) - 头像 URL

list_interfaces

列出项目中的所有接口。

参数:

  • project_id (必填): NEI 项目 ID
  • filter (可选): 筛选条件
    • method: 按 HTTP 方法筛选(GET、POST 等)
    • path_pattern: 按路径模式筛选

示例返回:

# 项目接口列表 (共 15 个)

| ID | 方法 | 路径 | 名称 | 描述 |
|---|---|---|---|---|
| 12345 | GET | /api/user/info | 获取用户信息 | 获取当前登录用户的信息 |
| 12346 | POST | /api/user/update | 更新用户信息 | 更新用户基本信息 |

get_datatypes

获取项目中的数据类型定义。

参数:

  • project_id (必填): NEI 项目 ID
  • type_ids (可选): 指定要获取的数据类型 ID 列表

开发

# 安装依赖
pnpm install

# 开发模式
pnpm run dev

# 构建
pnpm run build

# 测试
pnpm run test

License

ISC