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

mcp-helper

v2.1.1

Published

MCP development assistant: scaffold MCP servers (Node SDK v2 / Go) with stdio + Streamable HTTP.

Readme

MCP Helper (mcp-cli)

用于脚手架化创建 Node(SDK v2) 或 Go MCP 服务端项目的命令行工具。

  • 默认文档:英文(见 README.md)
  • 本页为中文版本

项目概述

mcp-cli 可生成可运行的 MCP 服务器:

  • Node:@modelcontextprotocol/server + 可选 Hono Streamable HTTP

  • Go:官方 github.com/modelcontextprotocol/go-sdk

  • 传输:stdio 和/或 streamable-http(/mcp)

  • 带轮转的文件日志(stdio 下不会污染 stdout)

  • 可选 Node bootstrap(Prettier、Husky 等)

    2.x 为破坏性升级:无 Express、无 Legacy SSE、无 @modelcontextprotocol/sdk v1。

环境要求

  • Node.js 20+ 与 pnpm(CLI 与 Node 脚手架)
  • Go 1.25+(仅 Go 脚手架需要)

安装与运行

pnpm install
pnpm build
node build/cli.js --help

可选二进制:

pnpm build:bin

使用方法

mcp-cli init [name]

选项

| 参数 | 说明 | | ------------------------ | ------------------------------------------ | | -y, --yes | 跳过交互 | | -l, --lang <node\|go> | 语言(默认 node) | | -t, --transport <list> | stdio、streamable-http(默认 stdio) | | -b, --bootstrap | 仅 Node 的 bootstrap | | -s, --skip-install | 跳过依赖安装 |

示例

# Node
mcp-cli init my-mcp -y -l node -t stdio,streamable-http
cd my-mcp
pnpm debug
MCP_TRANSPORT=http pnpm start

# Go
mcp-cli init my-go-mcp -y -l go -t stdio,streamable-http
cd my-go-mcp && make tidy && make run-http

生成内容

Node 目录结构

面向 SOLID 的分层(仅生成所选传输 / 鉴权相关文件):

| 路径 | 职责 | | ------------------------ | ---------------------------------------- | | src/index.ts | 组合根:串联 config、logger、transport | | src/config.ts | 环境变量 / 应用配置 | | src/logger.ts | 可注入日志 + 文件轮转 | | src/server.ts | 组装 McpServer(不含传输) | | src/tools/ | Tool 注册(含 ping、echo;在此扩展) | | src/auth/bearer.ts | HTTP Bearer 鉴权(仅选 HTTP 时生成) | | src/transport/stdio.ts | stdio 适配器 | | src/transport/http.ts | Streamable HTTP / Hono 适配器 |

脚本:build、start、start:stdio / start:http、debug、build:bin。

扩展 Node 项目

  1. 新增 src/tools/my-tool.ts,导出 registerMyTool(server)
  2. 在 src/tools/index.ts 中注册
  3. pnpm build 后重启即可,无需改传输层

Go 目录结构

  • cmd/server/main.go — 官方 Go SDK 上的 ping / echo
  • internal/logger — stderr + 轮转文件日志
  • Makefile — build、run、run-stdio、run-http

共用环境变量

| 变量 | 含义 | | ------------------------------- | --------------------------------------- | | MCP_TRANSPORT | stdio | http(同时生成两种传输时) | | MCP_HOST / MCP_PORT | HTTP 监听地址 | | MCP_AUTH_TOKEN | HTTP /mcp 可选 Bearer | | MCP_LOG_LEVEL / MCP_LOG_DIR | 日志控制 |

不识别旧别名 sse / remote。

面向本 CLI 的开发

pnpm build
pnpm typecheck
pnpm test
pnpm format

发布

在 main 上、工作区干净时:

pnpm release                   # 交互式 bump,提交、打 tag、push
pnpm release -- patch          # 或 minor / major / prepatch / preminor / premajor
pnpm release -- --no-increment # 为当前 package.json 版本打 tag(例如首次发 2.x)
pnpm release -- --dry-run      # 预览,不写 git/npm

本地 不会 发 npm。推送 v* 标签后由 GitHub Actions 通过 npm Trusted Publishing(OIDC)发布并创建 GitHub Release。不需要 NPM_TOKEN;npmjs.com 上的 Trusted Publisher 需指向本仓库,工作流文件名为 publish.yml。

许可证

ISC