Summary
base-builder-mcp uses StdioServerTransport, but the server also writes debug and operational logs to stdout using console.log().
For an MCP server using stdio transport, stdout should be reserved for MCP protocol messages.
Writing regular logs to the same stream can interfere with MCP communication and may cause parsing, initialization, or tool-call failures.
Affected files
index.ts
sidebar.ts
tools.ts
Problem
The MCP server uses stdio transport:
const transport = new StdioServerTransport();
server.connect(transport);
However, sidebar.ts writes directly to stdout:
console.log('Successfully fetched and updated sidebar content');
console.log(sidebarContent);
tools.ts also writes to stdout during tool execution:
console.log("Received request for guide:", guideLink);
console.log("Fetching from URL:", githubRawUrl);
console.log("Successfully fetched guide content");
console.log("Processing with ChatGPT...");
console.log("Successfully processed guide content");
The server can also print the complete sidebar content to stdout.
Steps to reproduce
- Clone the repository:
git clone https://github.com/base/base-builder-mcp
cd base-builder-mcp
npm install
-
Configure the project as a stdio MCP server.
-
Start the MCP server and capture stdout.
-
Observe regular text output such as:
Successfully fetched and updated sidebar content
-
Call the BuildOnBase tool.
-
Additional console.log() messages are written to the same stdout stream used by StdioServerTransport.
Expected behavior
stdout should contain only MCP protocol messages.
Application logs and debug output should be written to stderr.
Actual behavior
Normal application logs are written to stdout while the MCP stdio transport is active.
Impact
Depending on the MCP client, this may cause:
- MCP initialization failures
- malformed protocol messages
- JSON parsing errors
- failed tool calls
- intermittent MCP connection issues
Printing the complete sidebar also sends a large amount of unrelated data to the protocol stream.
Suggested fix
Move diagnostic logging to stderr.
For example:
console.error("Received request for guide:", guideLink);
The full sidebar dump should also be removed:
console.log(sidebarContent);
A dedicated logger that always sends diagnostic output to stderr would prevent the problem from being reintroduced.
Suggested test
Add an integration test that:
- Starts the MCP server over stdio.
- Captures stdout.
- Executes a
BuildOnBase tool request.
- Verifies that stdout contains only valid MCP protocol messages.
Summary
base-builder-mcpusesStdioServerTransport, but the server also writes debug and operational logs tostdoutusingconsole.log().For an MCP server using stdio transport,
stdoutshould be reserved for MCP protocol messages.Writing regular logs to the same stream can interfere with MCP communication and may cause parsing, initialization, or tool-call failures.
Affected files
index.tssidebar.tstools.tsProblem
The MCP server uses stdio transport:
However,
sidebar.tswrites directly to stdout:tools.tsalso writes to stdout during tool execution:The server can also print the complete sidebar content to stdout.
Steps to reproduce
git clone https://github.com/base/base-builder-mcp cd base-builder-mcp npm installConfigure the project as a stdio MCP server.
Start the MCP server and capture stdout.
Observe regular text output such as:
Call the
BuildOnBasetool.Additional
console.log()messages are written to the same stdout stream used byStdioServerTransport.Expected behavior
stdoutshould contain only MCP protocol messages.Application logs and debug output should be written to
stderr.Actual behavior
Normal application logs are written to stdout while the MCP stdio transport is active.
Impact
Depending on the MCP client, this may cause:
Printing the complete sidebar also sends a large amount of unrelated data to the protocol stream.
Suggested fix
Move diagnostic logging to stderr.
For example:
The full sidebar dump should also be removed:
A dedicated logger that always sends diagnostic output to stderr would prevent the problem from being reintroduced.
Suggested test
Add an integration test that:
BuildOnBasetool request.