# Discourse MCP User API Key Generator Error Nodejs \>20

**URL:** https://meta.discourse.org/t/discourse-mcp-user-api-key-generator-error-nodejs-20/390073
**Category:** Support
**Tags:** mcp
**Created:** [December 1, 2025, 4:56pm UTC](https://meta.discourse.org/t/discourse-mcp-user-api-key-generator-error-nodejs-20/390073 "2025-12-01T16:56:38Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![deviantintegral](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deviantintegral/32/263008_2.png) [@deviantintegral](https://meta.discourse.org/u/deviantintegral)
#### Post date: [December 1, 2025, 4:56pm UTC](https://meta.discourse.org/t/discourse-mcp-user-api-key-generator-error-nodejs-20/390073/1 "2025-12-01T16:56:38Z")

</div>

Issues aren’t enabled in the GitHub repository, but please let me know if I should post this somewhere else!

When I run the User API Key generator, I get the following error:

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

```

It looks like this has been unsupported by default since nodejs 20.

> [@User API keys should use OAEP padding](https://meta.discourse.org/t/user-api-keys-should-use-oaep-padding/354056):
>
> A minor issue and maybe a bigger one: There’s a required nonce param that’s not mentioned in the documentation: def require\_params %i[public\_key nonce scopes client\_id application\_name].each { |p| params.require(p) } end Now the trickier issue. Discourse calls the public\_encrypt method with no arguments: That means the padding argument defaults to PKCS1\_PADDING. From the [Ruby documentation](https://docs.ruby-lang.org/en/3.2/OpenSSL/PKey/RSA.html): Encrypt string with the public key. padding defaults to [PKCS1\_PADDING](https://docs.ruby-lang.org/en/3.2/OpenSSL/PKey/RSA.html#PKCS1_PADDING), which is known to be…

While that post mentions a workaround to re-enable the padding option, that appears to have been disabled since.

```plaintext
$ 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= is not allowed in NODE_OPTIONS

```

I’m a little confused, because the code for this was recently added in [discourse-mcp/src/user-api-key-generator.ts at 51f144fff8847647d1ba7354d5bc1fe661110a43 · discourse/discourse-mcp · GitHub](https://github.com/discourse/discourse-mcp/blob/51f144fff8847647d1ba7354d5bc1fe661110a43/src/user-api-key-generator.ts) a few months ago. Perhaps everyone is just using admin generated keys?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [December 1, 2025, 8:11pm UTC](https://meta.discourse.org/t/discourse-mcp-user-api-key-generator-error-nodejs-20/390073/3 "2025-12-01T20:11:02Z")

</div>

A post was split to a new topic: [MCP’s default query parameter hallucination](https://meta.discourse.org/t/mcps-default-query-parameter-hallucination/390091)

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [December 1, 2025, 8:10pm UTC](https://meta.discourse.org/t/discourse-mcp-user-api-key-generator-error-nodejs-20/390073/4 "2025-12-01T20:10:30Z")

</div>

> [@deviantintegral](#):
>
> When I run the User API Key generator, I get the following error:
> 
> ```plaintext
> Decrypting payload…
> [2025-12-01T16:38:59.409Z] ERROR Failed to decrypt payload: RSA_PKCS1_PADDING is no longer supported for private decryption.
> 
> ```
> 
> It looks like this has been unsupported by default since nodejs 20.

What OS, NodeJS and OpenSSL version are you running?

It works fine for me on

Linux  
Node 24.5  
OpenSSL 3.6.0

```plaintext

◄ 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-----%0A&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)

```

---

<div class="post-metadata">

### Author: ![deviantintegral](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deviantintegral/32/263008_2.png) [@deviantintegral](https://meta.discourse.org/u/deviantintegral)
#### Post date: [December 2, 2025, 1:20pm UTC](https://meta.discourse.org/t/discourse-mcp-user-api-key-generator-error-nodejs-20/390073/5 "2025-12-02T13:20:04Z")

</div>

```plaintext
$ node --version
v22.15.0
$ openssl -v
OpenSSL 3.6.0 1 Oct 2025 (Library: OpenSSL 3.6.0 1 Oct 2025)

```

I just switched to node 24 via nvm and it worked! That led me to find [Unable to use RSA\_PKCS1\_PADDING with v22+ - `--security-revert` suggests CVE-2024-PEND · Issue #55628 · nodejs/node · GitHub](https://github.com/nodejs/node/issues/55628) which ends with saying that this will _never_ work on node \< 24.

I suppose [discourse-mcp/package.json at 858e5bd5092c7d31693554046db34f98671a8cb9 · discourse/discourse-mcp · GitHub](https://github.com/discourse/discourse-mcp/blob/858e5bd5092c7d31693554046db34f98671a8cb9/package.json#L45) should be updated to `>=24`.

Thanks!

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [December 2, 2025, 2:28pm UTC](https://meta.discourse.org/t/discourse-mcp-user-api-key-generator-error-nodejs-20/390073/6 "2025-12-02T14:28:56Z")

</div>

> [@deviantintegral](#):
>
> I suppose [discourse-mcp/package.json at 858e5bd5092c7d31693554046db34f98671a8cb9 · discourse/discourse-mcp · GitHub](https://github.com/discourse/discourse-mcp/blob/858e5bd5092c7d31693554046db34f98671a8cb9/package.json#L45) should be updated to `>=24`.

Good idea

> <https://github.com/discourse/discourse-mcp/pull/19>
>
> Updates minimum Node.js requirement from 18 to 24.
> 
> The \`generate-user-api-key\` …tool uses \`RSA\_PKCS1\_PADDING\` which is no longer supported in Node.js versions below 24, causing runtime errors during API key generation.
> 
> \*\*Changes:\*\*
> \- Bump \`engines.node\` to \`\>=24\` in package.json
> \- Update version to 0.1.11
> \- Add breaking change entry to CHANGELOG.md
> 
> Fixes https://meta.discourse.org/t/discourse-mcp-user-api-key-generator-error-nodejs-20/390073
