fix: Change memory server default filename from memory.json to memory.jsonl#2567
fix: Change memory server default filename from memory.json to memory.jsonl#2567
Conversation
….jsonl The Memory MCP server uses JSONL format (JSON Lines) where each line contains a separate JSON object, but was using a .json file extension. This caused IDE lint errors and confusion since the file is not valid JSON. Changes: - Update default filename in index.ts from memory.json to memory.jsonl - Update documentation references in README.md - Maintain backward compatibility for existing MEMORY_FILE_PATH configs Fixes #2361 Co-authored-by: Ola Hungerford <olaservo@users.noreply.github.com>
|
|
||
| // Define memory file path using environment variable with fallback | ||
| const defaultMemoryPath = path.join(path.dirname(fileURLToPath(import.meta.url)), 'memory.json'); | ||
| const defaultMemoryPath = path.join(path.dirname(fileURLToPath(import.meta.url)), 'memory.jsonl'); |
There was a problem hiding this comment.
Might this cause some weird backwards compatibility problems, e.g. if people have npx -y @modelcontextprotocol/server-memory in config, suddenly it'll seem to them like all their memories have disappeared.
Maybe we could also check before this: if no custom path is set AND memory.json exists AND memory.jsonl does not exist, move memory.json to memory.jsonl.
domdomegg
left a comment
There was a problem hiding this comment.
Good, although maybe want to address the backwards compatibility comment above
|
@claude could you take a look at the latest comments and incorporate these suggestions? |
|
Claude finished @olaservo's task —— View job Implementing backward compatibility suggestion ✅I've successfully implemented the reviewer's suggestion to add backward compatibility for existing memory.json files. Tasks:
Implementation DetailsAdded backward compatibility logic that:
The migration happens during server startup in the Key changes to
Commit: 53104a6 - Add backward compatibility for memory.json -> memory.jsonl migration The backward compatibility feature is now implemented! Users with existing |
When no custom MEMORY_FILE_PATH is set and memory.json exists but memory.jsonl doesn't exist, automatically migrate the old file to the new format with proper file extension. This ensures existing users don't lose their data when upgrading to the version with the corrected .jsonl extension. Co-authored-by: Ola Hungerford <olaservo@users.noreply.github.com>
- Added DETECTED message when legacy memory.json file is found - Added COMPLETED message when migration finishes successfully - Improves visibility of backward compatibility migration process Co-authored-by: Ola Hungerford <olaservo@users.noreply.github.com>
The Memory MCP server uses JSONL format (JSON Lines) where each line contains a separate JSON object, but was using a .json file extension. This caused IDE lint errors and confusion since the file is not valid JSON.
Changes:
Fixes #2361
Generated with Claude Code