Discourse MCP ユーザー APIキー生成エラー Nodejs 20

GitHubリポジトリではイシューが有効になっていませんが、他の場所に投稿すべきか教えてください!

ユーザーAPIキージェネレーターを実行すると、次のエラーが発生します。

Decrypting payload…
[2025-12-01T16:38:59.409Z] ERROR Failed to decrypt payload: RSA_PKCS1_PADDING is no longer supported for private decryption.

これは、nodejs 20以降、デフォルトでサポートされなくなったようです。

その投稿ではパディングオプションを再度有効にする回避策について言及されていますが、それはその後無効になったようです。

$ NODE_OPTIONS='--security-revert=CVE-2023-46809' npx @discourse/mcp@latest generate-user-api-key --site https://example.com --save-to discourse-mcp.json  --scopes "read"
node: --security-revert= は NODE_OPTIONS では許可されていません

数か月前にこのコードがhttps://github.com/discourse/discourse-mcp/blob/51f144fff8847647d1ba7354d5bc1fe661110a43/src/user-api-key-generator.tsで最近追加されたため、少し混乱しています。おそらく皆さんは管理者生成のキーを使用しているのでしょうか?

投稿が新しいトピックに分割されました: MCPのデフォルトクエリパラメータの幻覚

お使いのOS、NodeJS、OpenSSLのバージョンは何ですか?

私の方では、以下で正常に動作します。

Linux
Node 24.5
OpenSSL 3.6.0


◄ 0s ◎ npx @discourse/mcp@latest generate-user-api-key \
             --site https://meta.discourse.org \
             --save-to profile.json

🔑 Discourse User API Key Generator

Site: https://meta.discourse.org
Scopes: read,write

Generating RSA key pair...
✓ Key pair generated

Please visit this URL to authorize the application:

https://meta.discourse.org/user-api-key/new?application_name=Discourse+MCP&client_id=discourse-mcp&scopes=read%2Cwrite&public_key=-----BEGIN+PUBLIC+KEY-----blablabla----END+PUBLIC+KEY-----&nonce=1764619683010

After authorizing, you will be redirected to a URL like:
  discourse://auth_redirect?payload=<encrypted_payload>

Or you may see the encrypted payload displayed on the page.

Paste the encrypted payload here:  longkey

Decrypting payload...
✓ User API Key retrieved successfully

✓ Saved to profile: profile.json

{
  "success": true,
  "profile": "profile.json"
}

◄ 16s ◎ node --version
v24.5.0

◄ 0s ◎ openssl --version
OpenSSL 3.6.0 1 Oct 2025 (Library: OpenSSL 3.6.0 1 Oct 2025)
「いいね!」 2
$ node --version
v22.15.0
$ openssl -v
OpenSSL 3.6.0 1 Oct 2025 (Library: OpenSSL 3.6.0 1 Oct 2025)

nvm経由でnode 24に切り替えたところ、動作しました!それがきっかけで、Unable to use RSA_PKCS1_PADDING with v22+ - `--security-revert` suggests CVE-2024-PEND · Issue #55628 · nodejs/node · GitHub を見つけましたが、これはnode < 24では決して動作しないと結論づけられています。

discourse-mcp/package.json at 858e5bd5092c7d31693554046db34f98671a8cb9 · discourse/discourse-mcp · GitHub\u003e=24 に更新すべきだと思います。

ありがとうございます!

「いいね!」 2

良い考えですね。

「いいね!」 2