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

@thesenseinc/border-commerce-mcp

v0.1.1

Published

Read-only stdio MCP server that calls the Border Commerce public GraphQL API with an M2M token

Readme

@thesenseinc/border-commerce-mcp

Border Commerce の公開 API を読む、読み取り専用の MCP サーバー(stdio)。AI クライアント(Claude Code など)から、 自分のストアの注文・商品・在庫・発注を問い合わせられる。書き込み(注文の作成・更新など)はできない。

必要なもの

  • Node.js 22 以上(node --version で確認)。npx は Node.js に同梱されている
  • 公開 API の認証情報(client_id / client_secret)。ストアの管理者が Border Commerce の 設定 → 連携 → API・MCP 連携で、 用途「MCP」として発行する(1 組 = 1 ストア)。client secret は発行・ローテーションのときに 1 回だけ表示されるので、その場で下の手順のファイルに保存する
  • スコープは読み取りだけ(MCP 用の既定は orders:read / products:read / inventory:read)。 この MCP サーバーは書き込みをしないので、orders:write / products:write / customers:read_pii は要らない
  • 接続先の値(担当者から受け取る。秘密ではない): 公開 API の URL と Auth0 のドメイン

入手する

パッケージは border-commerce-mcp というコマンドを持つ。MCP クライアントが npx で起動するので、事前のインストールは要らない。 バージョンは必ず固定する(@0.1.1 のように)。固定しないと、MCP クライアントを起動するたびに知らないうちに更新される。

| 配り方 | MCP クライアントに登録するコマンド | | --- | --- | | npm レジストリから | npx -y @thesenseinc/[email protected] | | 受け取った tarball から | npx -y --package /絶対パス/thesenseinc-border-commerce-mcp-0.1.1.tgz -- border-commerce-mcp |

tarball の絶対パスを npx にそのまま渡すと、npx はファイルをコマンドとして実行しようとして失敗する。--package で渡す。

入っているバージョンは --version で確かめられる(例: npx -y @thesenseinc/[email protected] --version)。

設定(環境変数)

| 環境変数 | 内容 | | --- | --- | | BC_PUBLIC_API_URL | 公開 GraphQL のエンドポイント(https://<host>/api/v1/graphql) | | BC_AUTH0_DOMAIN | Auth0 のドメイン(ホスト名だけ。https:// やパスは付けない) | | BC_AUTH0_CLIENT_ID | M2M アプリの client ID | | BC_AUTH0_CLIENT_SECRET_FILE | client secret を 1 行だけ書いたファイルの絶対パス。ファイルは chmod 600(他のユーザーが読めると起動を止める) | | BC_AUTH0_CLIENT_SECRET | client secret そのもの。_FILE の代わり(両方は指定できない) | | BC_AUTH0_AUDIENCE | 省略可(既定 https://api.border-commerce.com) |

client secret の置き方

client secret を MCP クライアントの設定に直接書かない。 claude mcp add -e BC_AUTH0_CLIENT_SECRET=... とすると、 ~/.claude.json に平文で残る。代わりに secret を自分だけが読めるファイルに置き、そのパスを BC_AUTH0_CLIENT_SECRET_FILE で渡す。

mkdir -p ~/.config/border-commerce-mcp
chmod 700 ~/.config/border-commerce-mcp
# 入力した secret は画面にもシェルの履歴にも残らない(bash / zsh どちらでも動く)
( umask 077; printf 'client secret: '; stty -echo; IFS= read -r s; stty echo; echo
  printf '%s\n' "$s" > ~/.config/border-commerce-mcp/<store>.secret )

パスワードマネージャーや Secret Manager を使う場合も、そこから取り出してこのファイルに書けばよい(必須ではない)。

Claude Code に登録する

ストアごとに名前を付けて、ユーザー単位(--scope user)で登録する。<store> は自分で決める識別名。

claude mcp add --scope user border-commerce-<store> \
  -e BC_PUBLIC_API_URL=https://<host>/api/v1/graphql \
  -e BC_AUTH0_DOMAIN=<auth0-domain> \
  -e BC_AUTH0_CLIENT_ID=<client-id> \
  -e BC_AUTH0_CLIENT_SECRET_FILE=$HOME/.config/border-commerce-mcp/<store>.secret \
  -- npx -y @thesenseinc/[email protected]
  • 1 つのプロジェクトでだけ使うなら --scope local(そのディレクトリでだけ有効)
  • --scope project は .mcp.json に書かれてコミット対象になる。使う場合も secret は書かず、.mcp.json には ${VAR} の参照だけを書く
  • 確認: claude mcp get border-commerce-<store> が ✔ Connected になる。Claude Code の中では /mcp で見られる
  • 最初に get_store_info を呼ぶと、接続先のストアとスコープを確かめられる

更新する・解除する

  • 更新: 登録し直す(claude mcp remove border-commerce-<store> --scope user のあと、新しいバージョンで claude mcp add)
  • secret を取り替える: API・MCP 連携でローテーションし、表示された新しい secret でファイルを書き換える(登録はそのまま)
  • 解除: claude mcp remove border-commerce-<store> --scope user。使わなくなった secret のファイルも消し、API・MCP 連携で認証情報を失効させる

他の MCP クライアント

stdio の MCP サーバーを登録できるクライアントなら、同じコマンドと環境変数で使える。JSON の設定ファイルに書く形式なら次のとおり (Claude Desktop の claude_desktop_config.json など。secret はファイルのパスで渡す)。Claude Code 以外での動作は未確認。

{
  "mcpServers": {
    "border-commerce-<store>": {
      "command": "npx",
      "args": ["-y", "@thesenseinc/[email protected]"],
      "env": {
        "BC_PUBLIC_API_URL": "https://<host>/api/v1/graphql",
        "BC_AUTH0_DOMAIN": "<auth0-domain>",
        "BC_AUTH0_CLIENT_ID": "<client-id>",
        "BC_AUTH0_CLIENT_SECRET_FILE": "/Users/<you>/.config/border-commerce-mcp/<store>.secret"
      }
    }
  }
}

GUI のアプリはシェルの PATH を引き継がないことがある。npx が見つからないと言われたら、command を which npx の絶対パスにする。

複数のストアを使う

1 つの登録 = 1 ストア。 ストアはトークン(M2M アプリ)で決まり、ツールの入力では選べない。複数のストアを使うときは、 ストアごとに認証情報を発行し、名前(border-commerce-<store>)と secret のファイルを分けて登録する。

困ったとき

エラーメッセージには変数名だけが出て、secret の値は出ない。

| メッセージ | 対処 | | --- | --- | | 環境変数が足りないか不正です: <変数名> | その変数を見直す。URL は https だけ、Auth0 のドメインはホスト名だけ、_FILE は絶対パス | | BC_AUTH0_CLIENT_SECRET_FILE のファイルを他のユーザーが読めます | chmod 600 <ファイル> | | Auth0 のアクセストークンを取得できませんでした(HTTP 401 / 403) | client ID・secret の誤り、または認証情報が失効している。API・MCP 連携で状態を確かめ、必要ならローテーションしてファイルを書き換える | | ツールが UNAUTHORIZED / FORBIDDEN を返す | 認証情報が失効したか、ストアの公開 API が無効になっている。または必要なスコープ(orders:read など)が付いていない | | /mcp で接続できない | ターミナルで登録したコマンドに --version を付けて実行し、Node.js 22 以上で起動できるか確かめる |

アクセストークンは期限の前に自動で取り直すので、長く使っていても操作は要らない。