Three Silent Failures Building a Local MCP Server for Claude Code on Windows

duct_tape_and_agents · reddit · 2026-09-27

The author built a small local MCP server for Claude Code on Windows and hit three failures that produced zero errors, sharing them to save others an evening.

1. One backslash in .mcp.json makes the whole file ignored

Claude Code generated "C:\My Projects\MyApp\dist\cli.js"; \M is an invalid JSON escape, so the file fails to parse and Claude Code silently skips it — no approval prompt, no error, only a red "1" next to the filename in VS Code. Fix: use forward slashes, which Node handles fine on Windows.

2. stdout belongs to the protocol

With a stdio MCP server, stdout carries protocol messages; one stray console.log breaks the client. All logging must go to stderr.

3. The client only reads config at session start

After fixing the file and reloading, still nothing: Claude Code picks up servers when a chat starts and only reads .mcp.json from the folder VS Code has open, not the parent. Open the project root, start a fresh chat, then test.

What helped: the fastest test isn't /mcp but asking Claude to call one of your tools directly; the author had Claude Code record each lesson in CLAUDE.md ("MCP paths always use forward slashes", "never write to stdout in the MCP process") so it stops reintroducing the same bugs.

Original post →

More from coding & agent

coding & agent channel →