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

cnb-mcp-server

v0.1.1

Published

MCP Server for the cnb API, enabling file operations, repository management, search functionality, and more.

Readme

CNB MCP Server

CNB MCP Server 是一个面向 Model Context Protocol (MCP) 的服务端实现,基于MCP协议提供对 CNB API 的访问。该服务器允许AI模型通过标准化接口访问和操作CNB代码托管平台的资源。

项目概述

CNB MCP Server 将CNB的API功能包装为MCP协议标准,便于AI模型与CNB代码托管平台进行交互。它使AI助手能够:

  • 【x】搜索和管理代码仓库
  • 【 】读取和修改文件内容
  • 【x】处理Issues和评论
  • 以及更多CNB平台功能

功能特性

CNB MCP Server 提供了以下核心功能:

仓库管理

  • 创建新仓库
  • 搜索公共仓库
  • Fork现有仓库
  • 获取仓库信息

文件操作

  • 获取文件或目录内容
  • ~创建或更新单个文件~
  • ~在单个提交中批量推送多个文件~
  • ~删除文件~

分支管理

  • ~创建新分支~
  • ~获取分支信息~
  • ~设置分支保护规则~

Issue管理

  • 创建新Issue
  • 获取Issue列表和详情
  • 更新Issue状态和内容
  • 添加Issue评论

安装指南

前置条件

  • Node.js (v16或更高版本)
  • npm (v7或更高版本)
  • CNB平台访问令牌

安装步骤

# 克隆仓库
git clone https://cnb.cool/FFA/cnb-mcp-server.git
cd cnb-mcp-server

# 安装依赖
npm install

# 构建项目
npm run build

使用方法

作为命令行工具

# 直接运行
./build/index.js

# 或作为全局命令安装
npm install -g ./
cnb-mcp-server

与MCP Inspector集成测试

MCP Inspector是一个交互式工具,用于测试和调试MCP服务器:

# 启动Inspector测试界面
npm run inspector

# 开发模式(实时编译)
npm run watch

支持的MCP工具

CNB MCP Server 支持以下MCP工具:

  • search_repositories - 搜索CNB仓库
  • create_repository - 创建新的CNB仓库
  • get_file_contents - 获取文件或目录内容
  • ~create_or_update_file - 创建或更新单个文件~
  • ~push_files - 批量推送多个文件~
  • create_issue - 创建新Issue
  • fork_repository - Fork仓库
  • create_branch - 创建新分支
  • list_issues - 列出仓库Issues
  • update_issue - 更新Issue
  • add_issue_comment - 添加Issue评论
  • get_issue - 获取Issue详情
  • get_user_groups - 获取用户组织信息

MCP配置

安装

安装在 Claude , 在下面文件中添加配置:

在 MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json 在 Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "cnb-mcp-server": {
      "command": "node",
      "args":["path/to/build/index.js"],
      "env":{
        "CNB_ACCESS_TOKEN":"CNB_ACCESS_TOKEN"
      }
    }
  }
}

安全说明

  • 访问令牌应通过环境变量CNB_ACCESS_TOKEN提供,不要硬编码在代码中
  • 遵循最小权限原则,使用具有所需最小权限的令牌
  • 定期轮换访问令牌以增强安全性

开发指南

# 开发模式(实时编译)
npm run watch

# 运行Inspector进行测试
npm run inspector

# 运行测试
npm test

贡献指南

欢迎贡献代码和提出建议!请遵循以下步骤:

  1. Fork仓库
  2. 创建特性分支 (git checkout -b feature/amazing-feature)
  3. 提交更改 (git commit -m 'Add amazing feature')
  4. 推送到分支 (git push origin feature/amazing-feature)
  5. 创建Pull Request

许可证

本项目采用MIT许可证 - 详见LICENSE文件