-
Notifications
You must be signed in to change notification settings - Fork 9.1k
fix: Change memory server default filename from memory.json to memory.jsonl #2567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this change.
domdomegg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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