First MCP Triger Serveur Workflow

Describe the problem/error/question

Hi everyone,

I’m trying to build a workflow that uses an MCP Server Trigger to return the temperature of a location (via the OpenWeatherMap API).

The idea is:

  • MCP Server Trigger receives a request
  • I set a zipcode and country
  • I fetch the weather using HTTP Request
  • I format the response using a Code node

:backhand_index_pointing_right: My problem: I can’t finalize the MCP Server Trigger part so that it properly returns the weather data. At the moment, I’m not sure how to connect the output from the Code node so the MCP Server actually sends it back.

Does anyone have an example or guidance on how to return the response correctly from the MCP Server Trigger?


What is the error message (if any)?

No explicit error, but the MCP Trigger doesn’t return anything when I test it.


Please share your workflow


Share the output returned by the last node

Currently, my Code node returns this JSON:

{
  "ville": "Paris",
  "temperature": "18°C",
  "ressenti": "17°C",
  "meteo": "clear sky",
  "humidite": "55%",
  "vent": "3 m/s"
}

But I’m not sure if this is the correct format for the MCP Server Trigger to return as output.


Information on your n8n setup

  • n8n version: 1.113.3
  • Database: Postgres 16 (alpine image)
  • n8n EXECUTIONS_PROCESS setting: own (default)
  • Running n8n via: Docker
  • Operating system: Debian 13 (Linux)

The way I would do it is as follows, I would connect two tools to the MCP Server - one to get the weather, using the http request tool and another one to format the weather using the code tool.

Here is an example of using it:

And here is my chat with the agent:

Me: 
What's the weather in Paris, zip code 75015

AI:
Le temps à Paris, code postal 75015, est le suivant:

Ville       : Paris 15
Température : 14.36°C
Ressenti    : 13.86°C
Humidité    : 77%
Vent        : 2.57 m/s

The output from the format_weather was:

Instead of formatting with MCP Server tooling, the same could be achieved by prompting AI Agent itself, of course.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.