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

mcp-oss-upload

v0.1.0

Published

MCP server that uploads files to Aliyun OSS and returns CDN URL

Readme

mcp-oss-upload

一个基于 Model Context Protocol (MCP) 的服务,提供 oss_upload 工具:上传本地文件到阿里云 OSS 并返回 CDN 链接。

安装

npm i mcp-oss-upload

或在本地开发目录运行:

npm install
npm start

MCP 客户端配置示例(无版本号引用)

在你的 MCP 客户端(如 Trae/Claude Desktop)中添加 stdio 服务器:

{
  "mcpServers": {
    "oss-upload": {
      "command": "node",
      "args": ["./node_modules/mcp-oss-upload/index.js"],
      "env": {
        "OSS_BUCKET": "dev-res-tishi",
        "OSS_ENDPOINT": "https://oss-cn-shanghai.aliyuncs.com",
        "OSS_ACCESS_KEY_ID": "<your-ak>",
        "OSS_ACCESS_KEY_SECRET": "<your-sk>",
        "CDN_URL": "https://dev-res.tishiii.com/"
      }
    }
  }
}

注意:配置不包含任何“之前的版本号”后缀,避免识别问题。

工具

oss_upload

入参:

  • file:必填,本地文件路径
  • objectKey:可选,自定义 OSS 对象键;默认:imgenx/YYYYMMDD/<文件名>
  • env:可选,dev|prod|stag;默认 dev(会从 huadan 项目的 application-*.yml 读取)
  • bucket|endpoint|accessKeyId|accessKeySecret|cdnUrl:可选,覆盖配置文件

返回:

{
  "objectKey": "imgenx/20251110/poster_female.jpg",
  "url": "https://dev-res.tishiii.com/imgenx/20251110/poster_female.jpg",
  "etag": "..."
}

配置来源

  • 默认从项目路径:huadan-backend-feature/huadan-backend-feature/src/main/resources/application-<env>.yml 读取:
    • oss.bucket
    • oss.endpoint
    • oss.access_key_id
    • oss.access_key_secret
    • cdn.url
  • 也可通过环境变量覆盖:OSS_BUCKETOSS_ENDPOINTOSS_ACCESS_KEY_IDOSS_ACCESS_KEY_SECRETCDN_URL

发布到 npm

  1. 确认登录:npm whoami
  2. 打包:npm run pack(生成 mcp-oss-upload-<version>.tgz
  3. 发布:npm publish

如需发布到你的 scope:修改 package.jsonname@<your-scope>/mcp-oss-upload