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

pb-ai-mcp

v1.0.20

Published

MCP Server for PowerBuilder PBL operations - list, export, import, compile, sync source code

Readme

pb-ai-mcp

PowerBuilder PBL 操作的 MCP 服务器,让 AI 能够直接读取、编辑、编译 PowerBuilder 工程。

功能特性

  • 查看 PBL 信息 - 获取 PBL 版本、格式、对象列表
  • 导出源码 - 导出单个或所有对象的源码
  • 导入源码 - 将修改后的源码导入 PBL(自动编译)
  • 同步源码 - 智能同步到本地目录,时间戳保护避免覆盖
  • 删除对象 - 从 PBL 中删除指定对象
  • 编译 PBL - 编译 PBL 中所有对象
  • 创建 EXE - 编译 PBL 为可执行文件

系统要求

  • Node.js >= 16.0.0
  • Windows (pb-cli.exe 是 32 位 .NET 程序)
  • PowerBuilder Runtime DLL (PBSpy.dll 依赖 ORCA SDK)

安装

npm install -g pb-ai-mcp

配置 AI 编辑器

Qoder/ Cursor

在 Settings > MCP 中添加:

{
  "mcpServers": {
    "pb-ai-mcp": {
      "command": "npx",
      "args": ["pb-ai-mcp"]
    }
  }
}

VS Code (Copilot)

.vscode/settings.json 中添加:

{
  "chat.mcp.servers": {
    "pb-ai-mcp": {
      "command": "npx",
      "args": ["pb-ai-mcp"]
    }
  }
}

MCP 工具列表

| 工具名 | 说明 | |--------|------| | pbl_library_info | 获取 PBL 库信息(版本、格式、对象列表) | | pbl_list_objects | 列出 PBL 中的源码对象,可按类型过滤 | | pbl_export_source | 导出单个对象的源码 | | pbl_export_all | 导出所有源码对象到目录 | | pbl_sync_source | 同步源码到本地目录(时间戳感知) | | pbl_import_source | 导入源码文件到 PBL | | pbl_delete_object | 删除 PBL 中的对象 | | pbl_compile | 编译 PBL 中所有对象 | | pbl_create_library | 创建新的 PBL 库 | | pbl_delete_library | 删除 PBL 库文件 | | pbl_create_exe | 编译 PBL 为 EXE 可执行文件 |

使用示例

AI 编辑源码工作流

  1. 同步源码到本地

    AI 调用: pbl_sync_source
    参数: pblPath="C:\project\app.pbl", baseDir="C:\project\pb_ai_src"
  2. 查看/编辑源文件

    • 源文件位于 pb_ai_src/app/ 目录
    • 窗口文件: w_main.srw
    • DataWindow: d_customer.srd
    • 函数: uf_calc.srf
  3. 导入修改后的源码

    AI 调用: pbl_import_source
    参数: pblPath="C:\project\app.pbl", srcFile="C:\project\pb_ai_src\app\w_main.srw", objectName="w_main"
  4. 编译验证

    AI 调用: pbl_compile
    参数: pblPath="C:\project\app.pbl"

查看 PBL 信息

AI 调用: pbl_library_info
参数: pblPath="C:\project\app.pbl"

输出示例:
PBL: C:\project\app.pbl
版本: 0600
格式: PBL 10+ (HDR/Unicode-ENT/DAT)
编码: Unicode (UTF-16LE)
对象数: 7

对象列表:
  app.sra  [Application]  1300 bytes  (SOURCE)  2024-01-15 10:30:00
  w_main.srw  [Window]  4600 bytes  (SOURCE)  2024-01-16 14:22:00

按类型列出对象

AI 调用: pbl_list_objects
参数: pblPath="C:\project\app.pbl", typeFilter="Window"

输出:
共 2 个对象 (过滤: Window):
1. w_main  [Window]  (w_main.srw)  4600 bytes  2024-01-16 14:22:00
2. w_detail  [Window]  (w_detail.srw)  8200 bytes  2024-01-17 09:15:00

对象类型与扩展名

| 类型 | 扩展名 | |------|--------| | Application | .sra | | Window | .srw | | Menu | .srm | | DataWindow | .srd | | Function | .srf | | Structure | .srs | | UserObject | .sru | | Query | .srq | | Pipeline | .srp | | Project | .srj |

支持的 PowerBuilder 版本

  • PB 10+ (HDR/Unicode-ENT/DAT 格式)
  • PB 9 (HDR/ANSI-ENT/DAT 格式)
  • PB 6-9 Classic (Block-based 格式)

故障排除

pb-cli.exe not found

确保 pb-cli.exePBSpy.dllpb-ai-mcp 在同一目录。

PBSpy.dll 加载失败

  • 检查是否安装了 PowerBuilder Runtime
  • 确保系统是 Windows(不支持 Linux/Mac)

导入源码失败

  • 检查源码语法是否正确
  • 查看编译错误信息定位问题
  • 确保对象类型匹配

许可证

MIT

相关链接

捐赠支持

如果你觉得这个项目帮助到了你,你可以请作者喝杯咖啡表示鼓励 ☕️