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

@nxavis/pb-parser-mcp

v1.0.2

Published

PowerBuilder source file parser MCP server

Readme

PB Parser MCP Server

파워빌더(PowerBuilder) 소셜 파일인 .srd (DataWindow) 및 .srw (Window) 파일을 파싱하여, 내장된 쿼리 및 핵심 비즈니스 로직(이벤트, 함수 등)을 JSON 형태로 정제하여 추출하는 Model Context Protocol (MCP) 서버 구현체입니다.

이 서버를 연동하면, 복잡한 자체 포맷을 지닌 파워빌더 소스를 정규식에 기반해 사람이(또는 AI Agent가) 읽고 분석하기 쉬운 형태로 파악할 수 있습니다. 특히 한글 인코딩(CP949, UTF-16LE BOM)을 자동으로 감지하고 처리하여 인코딩 깨짐을 방지합니다.

기능 (Features)

  • DataWindow(.srd) 분석: PBSELECT(...) 내부의 구문 및 릴리즈 10 이상 특유의 테이블/컬럼/조건 구조에서 원시 테이블 명, 컬럼 정보 쿼리를 추출. 또는 직접 작성된 SQL="..." 구문을 파싱.
  • Window(.srw) 분석:
    • UI 객체(Component)의 타입 추출
    • 각 객체에 바인딩된 각 이벤트(Event)들의 파라미터 및 본문 로직
    • 전역 스크립트 이벤트 및 사용자 정의 함수(Function)
  • 메타데이터 및 카테고리 자동 분류:
    • 추출된 함수와 이벤트가 원본 스크립트 내의 몇 번째 줄(Line)에 위치하는지 계산하여 제공합니다.
    • 이름 패턴(예: wf_check..., clicked 등)을 분석하여 Business Logic, Validation, UI Event, CRUD, Search 등의 카테고리(Category) 속성을 자동으로 부여합니다.
    • 정규식 탐색을 최적화하여 대용량 스크립트에서도 빠르고 안정적으로 파싱합니다.
  • 안티-패턴 정적 분석 및 주석(비즈니스 룰) 자동 추출:
    • FOR 루프 후처리 누락 의심 사례나, 조건부 RETURN -1 예외 처리 등 마이그레이션 시 꼼꼼히 챙겨야할 주요 결함 포인트를 감별해 warnings 목록으로 알립니다.
    • 한글로 작성된 주요 비즈니스 규약 주석을 스크랩하여 businessRules 로 별도 제공합니다.
  • 자동 인코딩 변환: iconv-lite 패키지를 통해 파일 바이너리의 매직 넘버(BOM) 확인 후 UTF-16LE 혹은 CP949 로 디코딩하여 결과 반환

설치 및 빌드 (Installation & Build)

Node.js (v18 이상 권장) 환경에서 npm 도구를 활용하여 종속성을 설치하고 TypeScript를 컴파일합니다.

# 종속성 설치
npm install

# TypeScript 컴파일 (빌드)
npm run build

사용법 (Usage with MCP Client)

pb-parser-mcpstdio 전송 방식을 사용합니다. Cline 등 MCP를 지원하는 AI 에이전트 환경이나 claude-desktop 앱의 설정에 추가하여 사용할 수 있습니다.

MCP Config (클라이언트 설정 예시)

에이전트 클라이언트의 cline_mcp_settings.json 혹은 claude_desktop_config.json 등에 아래와 같이 등록하세요.

{
  "mcpServers": {
    "pb-parser": {
      "command": "npx",
      "args": ["-y", "@nxavis/pb-parser-mcp"],
      "env": {}
    }
  }
}

Tools (도구 목록)

위의 설정 후 AI를 통해 다음의 Tool(함수)을 자유롭게 호출할 수 있습니다.

parse_pb_file

주어진 파워빌더 소스 파일의 절대 경로를 받아 정제된 JSON 오브젝트를 반환합니다.

  • 파라미터

    • filePath (string, required): 읽어들일 파워빌더 .srd 또는 .srw 파일의 절대 경로.
  • 응답 (Returns)

    • srd 포맷의 경우: 추출된 Datawindow 쿼리들의 리스트
    • srw 포맷의 경우: 윈도우 컨트롤의 오브젝트 목록(objects), 이벤트 핸들러 목록(events), 함수 선언 및 바디(functions)
      • 각 Event와 Function 객체에는 이름(eventName, name), 파라미터(args), 구현부(body), 시작 줄 번호(line), 역할 분류(category)와 더불어 로직 상 누락이 의심되는 경고 텍스트 배열(warnings)과 핵심 주석 배열(businessRules)이 제공됩니다.