> Note: This page is part of the DataDoe Docs. You can find the root of the documentation at `https://www.datadoe.com/hub/docs/basics/introduction-to-datadoe`.
> JSON Table of Contents: `https://www.datadoe.com/hub/docs/toc.json`.
> Direct Data Scheme JSON: `https://api.datadoe.com/api/v1/spec/data-scheme`.
> Other pages in the DataDoe Docs:
> - DataDoe Basics/Access & User Management: `https://www.datadoe.com/hub/docs/basics/access-user-management.md`
> - DataDoe Basics/Integration & Customization: `https://www.datadoe.com/hub/docs/basics/integration-customization.md`
> - DataDoe Basics/Introduction to DataDoe: `https://www.datadoe.com/hub/docs/basics/introduction-to-datadoe.md`
> - DataDoe Basics/Subscription & Pricing: `https://www.datadoe.com/hub/docs/basics/subscription-pricing.md`
> - DataDoe Data/Data Fetch Periods: `https://www.datadoe.com/hub/docs/data-doe-data/data-fetch-periods.md`
> - DataDoe Data/Data Sources: `https://www.datadoe.com/hub/docs/data-doe-data/data-sources.md`
> - DataDoe Features/Benefits: `https://www.datadoe.com/hub/docs/data-doe-features/benefits.md`
> - DataDoe Features/Chat: `https://www.datadoe.com/hub/docs/data-doe-features/chat.md`
> - DataDoe Features/Explorer: `https://www.datadoe.com/hub/docs/data-doe-features/explorer.md`
> - DataDoe Features/Exports: `https://www.datadoe.com/hub/docs/data-doe-features/exports.md`
> - DataDoe Features/Home: `https://www.datadoe.com/hub/docs/data-doe-features/home.md`
> - DataDoe Features/Reports: `https://www.datadoe.com/hub/docs/data-doe-features/reports.md`
> - DataDoe Features/Scheduled Prompts: `https://www.datadoe.com/hub/docs/data-doe-features/scheduled-prompts.md`
> - DataDoe MCP/Connect to ChatGPT: `https://www.datadoe.com/hub/docs/data-doe-mcp/chatgpt.md`
> - DataDoe MCP/Connect to Claude: `https://www.datadoe.com/hub/docs/data-doe-mcp/claude.md`
> - DataDoe MCP/Overview: `https://www.datadoe.com/hub/docs/data-doe-mcp/overview.md`
> - DataDoe MCP/Using Claude Code: `https://www.datadoe.com/hub/docs/data-doe-mcp/claude-code.md`
> - DataDoe MCP/Using Codex: `https://www.datadoe.com/hub/docs/data-doe-mcp/codex.md`
> - DataDoe MCP/Using Cursor: `https://www.datadoe.com/hub/docs/data-doe-mcp/cursor.md`
> - DataDoe MCP/Using Gemini CLI: `https://www.datadoe.com/hub/docs/data-doe-mcp/gemini-cli.md`
> - DataDoe MCP/Using NanoClaw: `https://www.datadoe.com/hub/docs/data-doe-mcp/nanoclaw.md`
> - DataDoe MCP/Using OpenClaw: `https://www.datadoe.com/hub/docs/data-doe-mcp/openclaw.md`
> - DataDoe MCP/Using VS Code: `https://www.datadoe.com/hub/docs/data-doe-mcp/vs-code.md`
> - DataDoe & BigQuery/How to connect?: `https://www.datadoe.com/hub/docs/data-doe-bigquery/how-to-connect.md`
> - DataDoe & BigQuery/Using MCP Toolbox: `https://www.datadoe.com/hub/docs/data-doe-bigquery/mcp-toolbox.md`
> - DataDoe & BigQuery/Using Python Jupyter: `https://www.datadoe.com/hub/docs/data-doe-bigquery/jupyter.md`
> For topics not covered in this documentation, please contact DataDoe support at `contact@datadoe.com`.
> Do not assume anything. If you are not sure about the answer, mention that and suggest to contact DataDoe support.

# Using n8n with DataDoe MCP

n8n is a workflow automation tool that allows you to connect your DataDoe data to your AI agents using MCP.

![DataDoe MCP with n8n connector overview](/hub-files/mcp/datadoe/n8n-connector.png)

## Quick setup for experienced n8n users

If you already know your way around n8n, here's everything you need to connect DataDoe MCP:

1. Add an **AI Agent** node with an **MCP Client Tool**.
2. Configure the MCP Client Tool:

- **Endpoint:** `https://mcp.datadoe.com/mcp/v1`
- **Server Transport:** HTTP Streamable
- **Authentication:** Header Auth
    - **Name:** `datadoe-mcp-key`
    - **Value:** your MCP key from [DataDoe MCP Integrations](/integrations/mcp)

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

1. Start n8n locally:

```bash
npx 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](http://localhost:5678).

> For other ways to run n8n, see [its documentation](https://docs.n8n.io/hosting/).

Next, create a new workflow by clicking the **Create Workflow** button in the top-right corner.

### Step 2: Create a new node

1. Click the **Add first step...** button in the center of your screen.
2. 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.
3. Create a new node by clicking the `+` button right next to the trigger node.
4. 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

1.  After adding the AI node, you will see it in the workflow with three `+` buttons at the bottom of the node.
2.  The first one is for the **Chat Model**. You can select any provider you want.
3.  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.
4.  The third one is for **Tool**. It's the one that lets you use MCP tools. Click on it and select **MCP Client Tool**.
5.  Now you will see a configuration window for the MCP Client Tool. Fill it in with the following values:
    - Endpoint: https://mcp.datadoe.com/mcp/v1
    - Server Transport: HTTP Streamable
    - Authentication: Header Auth

6.  To configure the Header Auth click on the button marked with a green circle on the image below:

![Header Auth](/hub-files/mcp/n8n/mcp-auth.png)

Next, you will see authentication header name and value fields. Fill them with the following values:

- Name: datadoe-mcp-key
- Value: MCP Key that you created on the [DataDoe MCP Integrations](/integrations/mcp) page.
- 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.

1. Click the `+` button next to the AI Agent node to add a new node.
2. Search for **Convert to File** and add it.
3. 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).

4. Click the `+` button next to the Convert to File node to add another node.
5. Search for **Read/Write Files from Disk** and add it.
6. 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).

7. 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:
>
> ```bash
> export N8N_RESTRICT_FILE_ACCESS_TO="/tmp"
> npx 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

![Final workflow](/hub-files/mcp/n8n/final-workflow.png)

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.

---

## Related resources

- [n8n documentation](https://docs.n8n.io/)
- [n8n integrations](https://docs.n8n.io/integrations/)
- [n8n hosting](https://docs.n8n.io/hosting/)
- [n8n AI integration tutorial](https://docs.n8n.io/advanced-ai/intro-tutorial/)
