Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[stdout-intercepted] prefix leaks into normal sf CLI stdout from mcp-provider-aura-experts and mcp-provider-lwc-experts bundles

Open
#41 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
javascript, node.js
Domain
cli, tooling

Research direction

Start with the bundled index.bundle.js files in mcp-provider-aura-experts and mcp-provider-lwc-experts and trace where the process.stdout.write wrapper is installed during module evaluation. Reproduce with sf plugins --core, then verify that normal CLI stdout is unchanged while the interceptor remains active for the MCP server's stdio transport.

Written by the indexing model from the issue text.

Description

investigating
Summary

After installing @salesforce/mcp , every line written to stdout by the sf CLI (for any command, not just the MCP server) is prefixed with [stdout-intercepted] . The interceptor is unconditionally installed at module load time inside the bundled mcp-provider-aura-experts and mcp-provider-lwc-experts packages, so it activates during oclif's plugin discovery for all sf invocations — even when the MCP server is not being started.

Environment
  • OS: Windows 11 (PowerShell 5.1, also reproduced in cmd.exe and powershell -NoProfile; not VS Code-related)
  • Salesforce CLI: @salesforce/cli 2.128.5
  • Node: bundled with sf installer (C:\Program Files\sf\client\bin\node.exe)
  • Plugin: @salesforce/mcp 0.30.7 (user-installed)
    • Bundled: @salesforce/mcp-provider-aura-experts 0.3.7
    • Bundled: @salesforce/mcp-provider-lwc-experts 0.7.0
  • Install location: C:\Users\<me>\AppData\Local\sf\node_modules\@salesforce\mcp
  • VS Code: 1.117.0 with Salesforce Extension Pack (Salesforce CLI Integration)
Steps to reproduce
  1. Install the plugin: sf plugins install @salesforce/mcp
  2. Run any non-MCP sf command, e.g.:
    sf plugins --core
    
Actual output (truncated)
AccessibilityVisionExpert: no reviewers loaded for maturity level >= GA
SLDSExpert: no reviewers loaded for maturity level >= GA
UtamExpert: no reviewers loaded for maturity level >= GA
[stdout-intercepted] @oclif/plugin-autocomplete 3.2.45 (core)
[stdout-intercepted] @oclif/plugin-commands 4.1.45 (core)
[stdout-intercepted] @oclif/plugin-help 6.2.43 (core)
...
[stdout-intercepted] @salesforce/mcp 0.30.7
[stdout-intercepted] agent 1.32.20 (core)
[stdout-intercepted] apex 3.9.20 (core)
...

Note: the *Expert: no reviewers loaded… warnings go to stderr and are not prefixed; everything written to stdout is.

Expected output

No [stdout-intercepted] prefix on stdout for normal CLI commands. The interceptor should only be active when the MCP server is actually running over stdio transport.

Root cause (verified locally)

The string stdout-intercepted appears in two bundled provider files shipped inside the plugin:

  • …\AppData\Local\sf\node_modules\@salesforce\mcp\node_modules\@salesforce\mcp-provider-aura-experts\index.bundle.js
  • …\AppData\Local\sf\node_modules\@salesforce\mcp\node_modules\@salesforce\mcp-provider-lwc-experts\index.bundle.js

Verified with:

Select-String -Path "$env:LOCALAPPDATA\sf\node_modules\@salesforce\mcp\node_modules\@salesforce\mcp-provider-*-experts\index.bundle.js" -Pattern "stdout-intercepted" -SimpleMatch

Both files match. The string does not exist anywhere else in the sf install (C:\Program Files\sf\client), in %LOCALAPPDATA%\sf\node_modules outside these two bundles, in global npm, in VS Code, or in any user PowerShell profile ($PROFILE does not exist). No NODE_OPTIONS or oclif/sf env vars are set.

These bundles appear to install a process.stdout.write wrapper at module-evaluation time. Because oclif loads every plugin's manifest/module at CLI startup, the wrapper is installed for every sf invocation — not only when the MCP server is started.

Impact
  • All stdout from sf is corrupted, breaking JSON consumers, scripts that pipe sf … --json, downstream tools, and CI logs.
  • VS Code Salesforce Extension Pack commands that shell out to sf and parse its JSON/stdout are broken, including:
    • SFDX: Retrieve Source from Org / Retrieve This Source from Org
    • SFDX: Deploy Source to Org / Deploy This Source to Org
    • Org Browser (fails to load metadata listings)
  • Workaround today is sf plugins uninstall @salesforce/mcp, which removes MCP functionality entirely.
Dominant language
No language data
Stars
1
Forks
1
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from forcedotcom/mcp

All issues in forcedotcom/mcp

Similar issues

More CLI issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.