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

wps-mcp

v1.1.0

Published

WPS多维表格数据访问工具

Readme

AI-WPS MCP

WPS 多维表格数据访问工具,为 AI 助手提供 WPS 表格操作和 AirScript 脚本生成能力。

🚀 快速开始

1. 获取配置信息

  • API Token: 从 WPS 多维表格设置中获取(表格→设置→开发者工具→API Token)
  • File ID: 多维表格 URL 中的文件 ID
  • Script ID: 部署 AirScript 后获得的脚本 ID

2. 在 Cursor 中配置

方法一:通过 Cursor 设置界面

  1. 打开 Cursor 设置 → MCP 选项卡
  2. 点击"Add new global MCP server"
  3. 填写:
    • Name: wps-mcp
    • Command: npx
    • Args: wps-mcp --apiToken your_token --fileId your_file_id --scriptId your_script_id

方法二:配置文件方式~/.cursor/mcp.json 中添加:

{
  "mcpServers": {
    "wps-mcp": {
      "command": "npx",
      "args": [
        "wps-mcp",
        "--apiToken", "your_token",
        "--fileId", "your_file_id", 
        "--scriptId", "your_script_id"
      ]
    }
  }
}

重启 Cursor MCP 服务:Cmd+Shift+P → "MCP: Restart All Servers"

💡 使用 npx 方式无需预先安装,Cursor 会自动下载并运行最新版本的 MCP 服务器。

📋 功能

  • 表格操作: 获取表格列表、表格信息和字段结构
  • AirScript 生成: 智能生成符合 WPS 规范的脚本代码,参考经营情况统计脚本的最佳实践
  • 代码优化: 自动优化和验证生成的脚本,包含完整的错误处理和日志记录
  • 最佳实践: 生成的代码遵循示例脚本的结构化设计和编码规范

🎯 代码生成特色

基于 src/airscript/airscript-example.js 经营情况统计脚本的最佳实践,生成的 AirScript 代码具有以下特点:

📝 完整的文档和注释

  • 详细的 JSDoc 注释,包含函数描述、参数说明、返回值
  • @customfunction 标记,符合 WPS AirScript 规范
  • 清晰的代码注释和功能说明

🏗️ 结构化设计

  • 常量定义: 使用 SHEET_IDSFIELD_NAMES 进行配置管理
  • 模块化函数: 将复杂功能拆分为独立的工具函数
  • 核心工具函数:
    • sumFieldValues() - 字段值汇总计算
    • getRecordsFromSheet() - 分页获取表格记录
    • formatDate() - 日期格式化工具

🛡️ 健壮的错误处理

  • 完整的 try-catch 错误捕获
  • 详细的错误信息记录和上下文
  • 优雅的错误降级处理

📊 丰富的日志系统

  • 结构化的日志输出格式
  • 操作进度和结果的详细记录
  • 便于调试和问题排查的日志信息

✅ 数据验证和边界检查

  • 参数类型验证和范围检查
  • 数据完整性验证
  • 边界条件的安全处理

🔧 WPS API 最佳实践

  • 正确的分页数据获取方式
  • 高效的批量操作处理
  • 符合 WPS 表格 API 规范的调用方式

🔧 使用示例

在 Cursor 中直接对话:

获取所有表格列表
生成一个客户管理的 AirScript 脚本

📚 更多信息

📄 许可证

MIT