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

pm-on-rails

v0.1.1

Published

CLI to connect Claude Code to PM on Rails via MCP (device flow + stdio proxy)

Readme

pm-on-rails

Claude Code から PM on Rails を MCP 経由で使うための CLI。

ADR-020 で確定した「Device Flow + OS キーチェーン + ローカル stdio プロキシ」を 1 本のコマンドにまとめた配布形態。トークンは Claude Code 設定や .mcp.json には書かれない。

インストール

npm install -g pm-on-rails
# あるいは npx で
npx pm-on-rails --help

Node 20+ が必要。keytar は postinstall でネイティブビルドされる (ビルドツールが無い環境では自動的に ~/.config/pm-on-rails/credentials.json の chmod 0600 ファイルにフォールバックする)。

クイックスタート

# 1. PAT を発行 (ブラウザが開いて承認 → CLI に降ってくる)
pm-on-rails login

# 2. Claude Code に MCP として登録
pm-on-rails mcp install

# 3. Claude Code を再起動するとツールが見える
claude

サブコマンド

| コマンド | 用途 | |---|---| | pm-on-rails login | デバイス認証フローで PAT を取得しキーチェーンに保存 | | pm-on-rails logout | ローカル認証情報を削除 (--revoke でサーバ側も失効) | | pm-on-rails whoami | 現在の認証情報を表示 (Workspace / scopes / 有効期限) | | pm-on-rails mcp install [--scope user\|project\|local] | claude mcp add のラッパ | | pm-on-rails mcp uninstall | claude mcp remove のラッパ | | pm-on-rails mcp status | Claude Code 登録状況 + /mcp 到達性チェック | | pm-on-rails mcp proxy | (hidden) Claude Code から起動される stdio ↔ HTTP リレー | | pm-on-rails token list | 発行済み PAT 一覧 | | pm-on-rails token revoke <id> | PAT を失効 | | pm-on-rails config set api_url <url> | API URL を変更 (自己ホスト向け) | | pm-on-rails config get [<key>] | 設定取得 |

環境変数

| 変数 | 用途 | |---|---| | PM_ON_RAILS_API_URL | API URL を上書き (config.json より優先) | | PM_ON_RAILS_TOKEN | PAT を上書き (CI / 短命セッション用) | | PM_ON_RAILS_DEBUG | エラー時にスタックトレースを表示 | | XDG_CONFIG_HOME | 設定/フォールバック認証ファイルのルートを変更 |

トークン保存先

| OS | 保存先 | |---|---| | macOS | Keychain (pm-on-rails / <api_url>) | | Linux | libsecret / kwallet (keytar 経由) | | Windows | Credential Manager (keytar 経由) | | フォールバック | ~/.config/pm-on-rails/credentials.json (chmod 0600) |

トークンは ~/.claude.json.mcp.json には 一切書き込まれない。 チームで .mcp.json を commit しても安全。

トラブルシュート

pm-on-rails login を要求される

PAT が無効か失効している。再度 pm-on-rails login してください。

claude コマンドが見つからない

Claude Code をインストール: https://docs.claude.com/claude-code

MCP サーバ "pm-on-rails" は既に登録されています

pm-on-rails mcp install -y で確認をスキップして再登録、または pm-on-rails mcp uninstall してから install。

/mcp が 403

PAT に必要な scope が付与されていません。pm-on-rails logout 後、 pm-on-rails login で scope を選び直してください。

keytar がインストールに失敗する

ネイティブビルドツールが無い CI 等では keytar のビルドが失敗します。 その場合は CLI は自動的に ~/.config/pm-on-rails/credentials.json の chmod 0600 ファイルにフォールバックします。PM_ON_RAILS_TOKEN 環境変数 でも代替できます。

開発

cd cli
pnpm install
pnpm build     # tsup で dist/index.js (shebang 付き) を生成
pnpm typecheck # tsc --noEmit
node dist/index.js --help

関連

  • ADR-020: docs/adr/020-pm-on-rails-mcp-server-multi-user.md
  • ADR-011: モノレポ first (cli/ はリポジトリ root 配下のサブパッケージ)