Skip to content

dotenv v17 writes info message to stdout, breaking JSON-RPC in Claude Code MCP #154

Description

@StefanGentz

Bug Description

When starting the Postman MCP Server (Minimal) as an MCP server in Claude Code Desktop, the server fails to initialize with the following error:

MCP Postman MCP Server (Minimal): Invalid JSON-RPC message: [dotenv@17.2.2] injecting env (0) from .env -- tip: ⚙️ load multiple .env files with { path: ['.env.local', '.env'] }

Root Cause

In dotenv v17.x, dotenv.config() writes an informational message to stdout when no .env file is found. MCP servers communicate exclusively via stdout using JSON-RPC, so any non-JSON output on stdout breaks the protocol parser.

Affected file: dist/src/index.js, line 86:

dotenv.config();

Fix

Pass { quiet: true } to suppress the stdout output:

dotenv.config({ quiet: true });

Environment

  • Postman MCP Server version: 2.3.6
  • dotenv version: 17.2.2
  • Claude Code Desktop on macOS (Apple Silicon)

Impact

The MCP server fails to start entirely — all Postman tools are unavailable until the local dist/src/index.js is patched manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions