That's it — your AI Agent can now use all DataDoe MCP tools. Read on if you'd like a detailed walkthrough or an example of saving responses to a file.
Full walkthrough
Step 1: Run n8n locally and create a new workflow
Start n8n locally:
bash
1npx n8n
This command will download everything you need to run n8n locally and start it. After that, you can open the n8n web interface in your browser at http://localhost:5678.
Next, create a new workflow by clicking the Create Workflow button in the top-right corner.
Step 2: Create a new node
Click the Add first step... button in the center of your screen.
Select your desired trigger node. For this example, we will use the On chat message trigger. It matches our use case of asking the agent about the data.
Create a new node by clicking the + button right next to the trigger node.
Select AI, and then select AI Agent. You can pick other options too, but this one is the most generic and lets you use any LLM provider you want.
Step 3: Configure the AI node
After adding the AI node, you will see it in the workflow with three + buttons at the bottom of the node.
The first one is for the Chat Model. You can select any provider you want.
The second one is for Memory. It will be used to store the context of the conversation (what was said before and what was answered). Pick anything that suits you best. The default one is fine for this example.
The third one is for Tool. It's the one that lets you use MCP tools. Click on it and select MCP Client Tool.
Now you will see a configuration window for the MCP Client Tool. Fill it in with the following values:
Allowed HTTP Request Domains: You can leave it as it is or change it to your preference.
After that click on the Save button to save the configuration.
Step 4: Save the AI response to a file
In this example we will take the AI Agent's response and save it as a Markdown file on your local filesystem.
Click the + button next to the AI Agent node to add a new node.
Search for Convert to File and add it.
Configure the Convert to File node:
Operation: Text to File
Text Input Field: drag the output from the AI Agent node (the output field) into the Text input, or use the expression {{ $json.output }}.
File Name: give it a name, for example datadoe-report.md.
Encoding: UTF-8 (default is fine).
Click the + button next to the Convert to File node to add another node.
Search for Read/Write Files from Disk and add it.
Configure the Read/Write Files from Disk node:
Operation: Write File to Disk
File Path: set the full path where you want to save the file, for example /tmp/datadoe-report.md.
Input Binary Field:data (this is the default binary field name from Convert to File).
Click Test workflow to run the full chain. Your AI Agent will query DataDoe, and the response will be saved to the file path you specified.
The Read/Write Files from Disk node requires n8n to have access to the filesystem. When running locally, you need to allow access to the target directory before starting n8n:
Replace /tmp with the path you want n8n to write to. If you run n8n in Docker, make sure to mount the target directory as a volume as well.
Final workflow
To run the workflow, type your message in the chat input at the bottom of the screen and click the Send button. The response will be saved to the file path you specified.