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

upload-reports-mcp

v0.0.2

Published

upload-reports MCP server

Readme

upload-reports-mcp

一个 MCP (Model Context Protocol) 服务器,用于将 HTML 代码上传到云服务器并获取可访问的 HTTP 链接。

功能

  • 接收 HTML 代码内容
  • 将 HTML 转换为文件对象
  • 上传到云服务器
  • 返回可访问的 HTTP 链接

快速开始

1. 安装

npm install -g upload-reports-mcp

或使用 npx 直接运行:

npx upload-reports-mcp@latest

2. 环境配置

在使用前需要配置两个环境变量:

| 环境变量 | 说明 | 可选值 | 默认值 | |---------|------|--------|--------| | TRANSPORT_TYPE | 传输方式 | stdio / http-stream / http | stdio | | KEY | 上传服务的 API 密钥 | 任意字符串 | 必需 |

配置方法:

# 方法1: 使用环境变量启动
export TRANSPORT_TYPE=stdio
export KEY="your-api-key"
npx upload-reports-mcp@latest

# 方法2: 命令行传递
TRANSPORT_TYPE=stdio KEY="your-api-key" npx upload-reports-mcp@latest

# 方法3: 使用 http 模式
TRANSPORT_TYPE=http KEY="your-api-key" npx upload-reports-mcp@latest

3. MCP 客户端配置

Claude Desktop 配置

~/.config/Claude/claude_desktop_config.json 中添加:

{
  "mcpServers": {
    "upload-reports": {
      "command": "npx",
      "args": ["-y", "upload-reports-mcp@latest"],
      "env": {
        "TRANSPORT_TYPE": "stdio",
        "KEY": "your-api-key"
      }
    }
  }
}

HTTP 模式配置

如果使用 HTTP 模式,客户端连接到:

http://localhost:3000/mcp

环境变量配置:

{
  "mcpServers": {
    "upload-reports": {
      "command": "npx",
      "args": ["-y", "upload-reports-mcp@latest"],
      "env": {
        "TRANSPORT_TYPE": "http",
        "KEY": "your-api-key"
      }
    }
  }
}

使用工具

upload_html_code_and_transfer_link

上传 HTML 代码并获取可访问链接的工具。

功能流程:

  1. 接收 HTML 代码字符串
  2. 自动转换为 HTML 文件对象
  3. 上传到服务器
  4. 返回 HTTP 链接

参数:

| 参数名 | 类型 | 必填 | 说明 | |--------|------|------|------| | code | string | ✅ | HTML 代码内容 |

请求示例:

{
  "code": "<html><body><h1>Hello World</h1></body></html>"
}

成功响应:

https://up.xinzine.top/reports/report_1704067200000.html

错误响应:

上传失败: <具体错误原因>

启动模式说明

stdio 模式(默认)

用于本地开发和 MCP 客户端直接集成:

npx upload-reports-mcp@latest

或指定环境变量:

TRANSPORT_TYPE=stdio KEY="your-key" npx upload-reports-mcp@latest

HTTP Stream 模式

用于 Web 应用和远程访问,服务器监听 http://localhost:3000/mcp

TRANSPORT_TYPE=http KEY="your-key" npx upload-reports-mcp@latest

调试

使用 MCP Inspector 进行调试:

# 调试 stdio 模式
npx @modelcontextprotocol/inspector npx upload-reports-mcp@latest

# 调试 HTTP 模式
TRANSPORT_TYPE=http KEY="your-key" npx @modelcontextprotocol/inspector npx upload-reports-mcp@latest

故障排除

Q: 提示找不到 api key?

A: 检查 KEY 环境变量是否正确设置。

Q: 上传超时?

A: 检查网络连接和上传服务器地址 https://up.xinzine.top 是否可访问。

Q: HTTP 模式无法连接?

A: 确保 TRANSPORT_TYPE=http 已设置,且客户端连接到 http://localhost:3000/mcp

许可证

MIT License

作者

橘子