-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Describe the bug
The MakerKit CLI MCP server violates the Model Context Protocol (MCP) by outputting plain text logs to stdout during initialization.
While some MCP clients might be lenient, the MCP specification strictly requires stdout to be reserved for JSON-RPC messages. Any additional text injected into the stream will cause protocol errors in strictly-compliant MCP clients (such as Google’s Antigravity IDE).
The error encountered is:
invalid character 'd' looking for beginning of value (Attempting to parse '[dotenv...' as JSON).
Root Cause 1: dotenv stdout pollution
The dotenv package (used in src/mcp.ts and src/index.ts) outputs initialization logs to stdout when executed in a directory without a .env.local file:
[dotenv@17.2.4] injecting env (0) from .env.local -- tip: ...
Because developers usually have .env.local files, this issue may remain hidden during testing. However, for a user starting a new project, this log is printed and breaks the standard MCP communication channel.
Root Cause 2: Hardcoded CLI Version
Running makerkit -v on @makerkit/cli@2.0.2 still outputs 2.0.0-beta.1. This is confirmed by checking src/version.ts:
export const CLI_VERSION = "2.0.0-beta.1";To Reproduce
- Run the MCP server in a directory where NO
.env.localfile exists. - Verify output via terminal:
npx --yes --quiet @makerkit/cli@latest makerkit-cli-mcp - Observe that
[dotenv...]is printed tostdoutbefore the server waits for stdin. This output corrupts the JSON-RPC stream.
Expected behavior
- All non-JSON output must be suppressed or redirected to
stderr.dotenvshould be configured to be quiet or logs should be intercepted. CLI_VERSIONshould match the actual package version.
Environment:- OS: macOS
- Package Version:
@makerkit/cli@2.0.2