Hi everyone,
I’ve been experimenting with building a ChatGPT-compatible MCP server in n8n, but I’ve run into an annoying issue.
I’m following the official MCP docs here:
https://platform.openai.com/docs/mcp
According to the spec, the MCP server must support search and fetch. A correct search response should look like this:
{
"content": [
{
"type": "text",
"text": "{\"results\":[{\"id\":\"doc-1\",\"title\":\"...\",\"url\":\"...\"}]}"
}
]
}
Here’s my setup so far:
-
I’ve built an MCP server in n8n.
-
The
searchandfetchtools each point to separate n8n workflows.
The problem:
The MCP server ends up wrapping the result from the tools with [ and ], so ChatGPT receives it as a nested array. That breaks functionality in the ChatGPT MCP client.
I can’t figure out how to get n8n to just return the tool result as is, without this extra wrapping.
Has anyone tried something similar, or know a way around this bracket-wrapping behavior in n8n?