Skip to main content

Build your own FileSystem MCP server

Workflow preview

Workflow preview
100%
Build your own FileSystem MCP server preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This template is for self hosted n8n instances only. This n8n demonstrates how to build a simple FileSystem MCP server. Connecting to this server allows MCP clients and agents to list, read and cre...

Best for

  • File Management automation workflows
  • AI RAG automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.mcptrigger, n8n-nodes-base.executecommandtool, n8n-nodes-base.executeworkflowtrigger, n8n-nodes-base.switch, n8n-nodes-base.executecommand, @n8n/n8n-nodes-langchain.toolworkflow

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Jimleuk.

Original n8n.io source

1.1 Workflow description

Title
Build your own FileSystem MCP server
Workflow name
Build your own FileSystem MCP server

This template is for self-hosted n8n instances only.

This n8n demonstrates how to build a simple FileSystem MCP server. Connecting to this server allows MCP clients and agents to list, read and create directories and files on the local machine or remote server.

This MCP example is based off an official MCP reference implementation which can be found here -https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem

How it works

  • A MCP server trigger is used and connected to 5 tools: 3 Execute Command tools and 2 custom workflow tools.
  • The 3 Execute Command tools allow for listing, searching and creating directories.
  • The 2 custom workflow tools are for reading and writing files to disk.
  • Special care has been to not allow the MCP agent to execute arbitrary linux commands on the target server. This is achieved by only allowing the agent to provide parameters such as filenames and paths rather than raw commands.

How to use

  • This Filesystem MCP server will write to the server which hosts the n8n instance - this can be your local machine or a remove server. If your target filesystem is on neither, then modify the commands to connect to the desired server.
  • Connect your MCP client by following the n8n guidelines here - https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.mcptrigger/#integrating-with-claude-desktop
  • Try the following queries in your MCP client:
    • "Please help me list all folders under the project directory."
    • "Help me create a bash script to send a notification to Slack."
    • "Search for the log file on the 22nd April and read its contents. What was the cause of the outage?"

Requirements

  • Linux file system for this example template. Feel free to modify if working on Windows.
  • MCP Client or Agent for usage such as Claude Desktop - https://claude.ai/download

Customising this workflow

  • Implement the moving and renaming of files by adding more custom workflow tools to the MCP server.
  • Remember to set the MCP server to require credentials before going to production and sharing this MCP server with others!

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - FileSystem MCP Server

Type / Role
@n8n/n8n-nodes-langchain.mcpTrigger - mcpTrigger
Config choices
Version 1

Block 4 - ListDirectory

Type / Role
n8n-nodes-base.executeCommandTool - executeCommandTool
Config choices
Version 1

Block 5 - CreateDirectory

Type / Role
n8n-nodes-base.executeCommandTool - executeCommandTool
Config choices
Version 1

Block 6 - When Executed by Another Workflow

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1.1

Block 7 - Operation

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 8 - readOneOrMultipleFiles

Type / Role
n8n-nodes-base.executeCommand - executeCommand
Config choices
Version 1

Block 9 - ReadFiles

Type / Role
@n8n/n8n-nodes-langchain.toolWorkflow - toolWorkflow
Config choices
Version 2.1

Block 10 - WriteFiles

Type / Role
@n8n/n8n-nodes-langchain.toolWorkflow - toolWorkflow
Config choices
Version 2.1

Block 11 - writeOneOrMultipleFiles

Type / Role
n8n-nodes-base.executeCommand - executeCommand
Config choices
Version 1

Block 12 - SearchDirectory

Type / Role
n8n-nodes-base.executeCommandTool - executeCommandTool
Config choices
Version 1

Block 13 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Build your own FileSystem MCP server
Complexity intermediate
Nodes 14
Categories File Management, AI RAG
Author Jimleuk
Published 21 Apr 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3630/3630.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Build your own FileSystem MCP server do?

This template is for self hosted n8n instances only. This n8n demonstrates how to build a simple FileSystem MCP server. Connecting to this server allows MCP clients and agents to list, read and cre...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your File Management, AI RAG use case.