Skip to content

bug: MCP add_memory tool silently fails to store memories #1274

@brentkearney

Description

@brentkearney

Pre-submission checklist | 提交前检查

  • I have searched existing issues and this hasn't been mentioned before | 我已搜索现有问题,确认此问题尚未被提及
  • I have read the project documentation and confirmed this issue doesn't already exist | 我已阅读项目文档并确认此问题尚未存在
  • This issue is specific to MemOS and not a general software issue | 该问题是针对 MemOS 的,而不是一般软件问题

Bug Description | 问题描述

The MCP server example (examples/mem_mcp/simple_fastmcp_serve.py) passes memory_content as a plain string to the messages field in the /product/add API payload:

payload = {
    "user_id": user_id,
    "messages": memory_content,  # plain string
}

The /product/add endpoint expects messages to be a list of chat message objects. When a plain string is passed, the SimpleStruct MemReader silently skips it — no error is raised, the API returns success, but no memory is actually stored.

How to Reproduce | 如何重现

  1. Start the MCP server with simple_fastmcp_serve.py
  2. Call the add_memory tool with any content
  3. API returns success
  4. Call search_memories — nothing is found

Environment | 环境信息

  • Python version: 3.11
  • Operating System: Linux (Raspberry Pi / aarch64)
  • MemOS version: v2.0.8 (also present in v2.0.9 — file unchanged)
  • Deployment: Docker

Additional Context | 其他信息

Fix is a one-line change — wrap the content as a chat message object:

"messages": [{"role": "user", "content": memory_content}]

PR: #1275

Willingness to Implement | 实现意愿

  • I'm willing to implement this myself | 我愿意自己解决
  • I would like someone else to implement this | 我希望其他人来解决

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions