Error with MCP Memory Server in n8n: Property 'includes' undefined when adding observations

Issue with MCP Memory Server Integration

I’m working with the MCP memory server integration in n8n and running into a frustrating error. When I try to use the add_observation functionality, I keep getting this error message:

Failed to execute operation: Failed to execute tool 'add_observations': MCP error -32603: Cannot read properties of undefined (reading 'includes')

I’ve tried implementing this both as a node and as a tool in my workflow, but the same error appears in both cases. The JSON structure looks correct to me, so I’m not sure what’s causing this undefined property issue.

Has anyone else encountered this problem when working with MCP memory servers? I’m wondering if there’s something wrong with how I’m formatting the observation data or if this is a compatibility issue between the MCP client and the memory server implementation.

Any suggestions on how to troubleshoot this ‘includes’ property error would be really helpful.

Had this exact issue three weeks ago while building a content analysis workflow. Turned out the problem wasn’t the payload structure - it was server-side validation logic. The MCP memory server was running an outdated validation function that checked array membership before verifying certain properties actually existed. I fixed it by adding middleware that initializes all expected properties as empty arrays before the observation hits the memory server. Here’s the key thing: even optional fields need to exist in the payload structure. The server’s validation just can’t handle missing properties. Try preprocessing your observation data to make sure every expected field exists, even if it’s empty.

Been there. MCP memory server errors like this happen when the data validation layer expects certain array properties but gets undefined values.

n8n’s MCP integration is flaky with complex memory operations. You’ll spend more time debugging property errors than building workflows.

I switched to Latenode after hitting the same walls. It connects to memory servers reliably and handles data formatting automatically. Better error messages too.

Set up an HTTP request node in Latenode that formats your observation data before sending it to the memory server. Takes 5 minutes and eliminates the undefined property headaches.

The visual builder shows exactly where data transformation happens, so you catch formatting issues before they hit the memory server.

That ‘includes’ error happens when the MCP memory server tries to validate array fields that aren’t initialized in your observation payload. I hit this exact bug last month. My observation object was missing the ‘entities’ field - the server expected it to be an array, and even though the schema didn’t require it, the validation code still tried calling includes() on undefined. Check that all your expected array fields (‘entities’, ‘relations’, ‘metadata’) are actually in your payload, even as empty arrays. Also try logging your complete request payload before sending it - you’ll spot which field is missing pretty quickly.

check ur observation payload structure - the memory server’s probably expecting an array field that’s coming through as undefined. usually it’s the metadata or content field not being initialized properly before includes() gets called on it.

Experiencing similar difficulties with the MCP memory server is not uncommon. The ‘includes’ error often arises from improperly formatted observation data. Ensure that fields such as ‘tags’ or ‘categories’ are indeed arrays as expected by the server, rather than strings or null values. Additionally, it is worthwhile to verify the version of your MCP client; updates occasionally disrupt compatibility. In my case, reverting to an earlier version helped until the memory server adapted to the new API standards. Enabling debug logging on the memory server can also provide clarity on which data points are failing validation.