Skip to content

Commit 956e36e

Browse files
authored
fix: prevent dotenv from outputting to STDIO in MCP mode (#91)
- Add { quiet: true } to dotenv.config() call - Prevents dotenv log messages from interfering with MCP JSON-RPC communication - Fixes "Unexpected token" JSON parsing errors in Claude Desktop - No functional changes to environment variable loading behavior Resolves STDIO pollution that breaks MCP protocol in STDIO transport mode.
1 parent c723c89 commit 956e36e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/utils/config.util.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ class ConfigLoader {
6868
);
6969

7070
try {
71-
const result = dotenv.config();
71+
// Use quiet mode to prevent dotenv from outputting to STDIO
72+
// which interferes with MCP's JSON-RPC communication
73+
const result = dotenv.config({ quiet: true });
7274
if (result.error) {
7375
methodLogger.debug(
7476
'[src/utils/config.util.ts@loadFromEnvFile] No .env file found or error reading it',

0 commit comments

Comments
 (0)