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

sbh-mcp

v1.0.0

Published

The SBH MCP servers.

Downloads

14

Readme

📚 SBH MCP Server

Model Context Protocol (MCP) adapter dành cho hệ thống Sổ Bán Hàng (SBH) – giúp kết nối tự động giữa n8n và API của SBH một cách chuẩn hóa, nhanh chóng và có thể mở rộng.


🚀 Mục tiêu của dự án

Dự án này cung cấp MCP Server (dựa trên fastmcp + Node.js) để thực thi các business tools cho hệ sinh thái SBH. Nó đóng vai trò như cầu nối giữa n8n workflow (frontend)hệ thống backend SBH, qua chuẩn MCP của OpenAI.


🧩 Khi nào sử dụng?

  • Khi bạn cần tích hợp SBH vào luồng workflow tự động (ví dụ: xử lý hóa đơn, sản phẩm, khách hàng...).
  • Khi bạn muốn xây dựng các "tools" có thể gọi từ ChatGPT hoặc custom agent.
  • Khi bạn cần chuẩn hóa cách gọi API SBH qua mô hình command-based.

🖼️ Kiến trúc hệ thống

graph TD
    A[n8n Workflow] --> B[MCP Client]
    B --> C[MCP Server<br/>Node.js + fastmcp]
    C --> D[SBH API]

✨ Tính năng chính

  • 🧠 Dễ tích hợp vào n8n workflow hoặc OpenAI custom GPT
  • 🔒 Giao tiếp an toàn qua signature + timestamp
  • 🧪 Tích hợp kiểm thử (Vitest), linting (ESLint), và chuẩn mã hóa
  • 📦 Viết bằng TypeScript với cấu trúc module rõ ràng

🛠️ Yêu cầu hệ thống

  • Node.js >= 18
  • pnpm package manager

⚙️ Cài đặt và khởi chạy

Cài đặt dependencies

pnpm install

Phát triển (Development)

# Chạy kèm hot reload
pnpm dev:watch

# Chạy thủ công (không auto-reload)
pnpm dev

Kiểm thử & format

pnpm test        # chạy unit tests
pnpm lint        # kiểm tra code style
pnpm format      # format lại toàn bộ codebase

📦 Build Production

pnpm clean       # xoá build cũ
pnpm build       # build TypeScript
pnpm start       # chạy production mode
pnpm preview     # build + start thử nghiệm

🧪 Kiểm thử endpoint MCP

Sử dụng MCP Inspector:

npx @modelcontextprotocol/inspector node dist/index.js

Hoặc dùng FastMCP CLI (trực tiếp source):

npx fastmcp dev src/index.ts

📄 Thông tin bổ sung


🧠 Ghi chú cho Dev

  • Cấu trúc dự án được tổ chức theo module TypeScript.
  • Sử dụng zod cho validation và type safety.
  • Thêm tool mới? → Xem file src/index.ts để biết cách thêm tool mới.
  • Cấu hình môi trường được quản lý qua .env file.