Troubleshooting n8n: MCP Server Memory Issue - Unexpected Error When Adding Observations

Hey everyone! I’m trying to use the MCP server memory with n8n and I’m running into a weird error. I’ve set up the add_observation node but when I try to run it, I get this message:

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

I thought maybe it was because I was using it as a node instead of a tool, but I tried both ways and got the same result. I’m pretty sure my JSON is correct, but I’m starting to doubt myself.

Has anyone else run into this? I’m wondering if it’s a problem with how I’m setting things up or if there’s a bug in the MCP Client. Any ideas on how to fix this or what I might be doing wrong? I’d really appreciate some help figuring this out!

hey tom, i had same problem last week. turns out i forgot to include the ‘timestamp’ field in my json. double check ur payload has all required fields. also, try logging the input data before it hits the mcp node - helped me spot the issue. good luck mate!

I’ve been working with n8n and MCP server memory for a while now, and I’ve seen this error pop up before. In my experience, it’s often related to how the data is passed to the MCP Client.

One approach I’ve found useful is to use a ‘Function’ node right before the MCP node to thoroughly inspect the incoming data. Logging the entire input object can help in identifying discrepancies between what you expect and what MCP actually receives. Sometimes, even when the JSON appears correct, minor differences in the structure can lead to these errors.

Also, double-check that none of your fields are undefined or misspelled, as the error indicates an attempt to use ‘includes’ on an undefined value. If everything seems fine but the issue persists, consider verifying whether there are known version-specific bugs with the MCP Client that might be causing the problem.

I’ve encountered similar issues with the MCP server memory in n8n before. From my experience, this error often occurs when there’s a mismatch between the data structure you’re passing and what the MCP Client expects. Have you double-checked that all required fields in your JSON payload are present and correctly formatted? Also, ensure you’re using the latest version of the MCP Client node in n8n, as older versions might have compatibility issues.

One thing that helped me was to use the MCP API documentation as a reference and compare my payload structure with their examples. If everything looks correct there, you might want to try simplifying your payload to the bare minimum required fields and gradually add back complexity to pinpoint where the error occurs.

If the problem persists, it could indeed be a bug in the MCP Client. In that case, I’d recommend reaching out to n8n support or checking their GitHub issues to see if others have reported similar problems.