You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cb23b2b
Browse filesBrowse the repository at this point in the historyBrowse files
Explains why `npx -y @modelcontextprotocol/server-memory` causes
"Unexpected non-whitespace character after JSON at position 127" errors
in WSL2, and provides two workarounds: global npm install and direct
node invocation. Fixesmodelcontextprotocol#3013.
Copy file name to clipboardExpand all lines: src/memory/README.md
+53Lines changed: 53 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -236,6 +236,59 @@ Alternatively, you can add the configuration to a file called `.vscode/mcp.json`
236
236
}
237
237
```
238
238
239
+
### Troubleshooting: WSL2 JSON parse errors
240
+
241
+
When running the server via `npx -y @modelcontextprotocol/server-memory` inside WSL2, you may encounter errors like:
242
+
243
+
```
244
+
Unexpected non-whitespace character after JSON at position 127
245
+
```
246
+
247
+
This is caused by `npx` writing package resolution output to stdout before handing off to the server. Since MCP's stdio transport uses stdout exclusively for JSON-RPC messages, those extra bytes corrupt the stream. The server code itself is not at fault.
Both options bypass `npx` at server startup, eliminating the stdout pollution.
291
+
239
292
### System Prompt
240
293
241
294
The prompt for utilizing memory depends on the use case. Changing the prompt will help the model determine the frequency and types of memories created.
0 commit comments