Always Authenticate Your Server!
Configured with Execute Command, Execute Command Tool, Execute Workflow Trigger, Mcp Trigger, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- Trigger
- Code
- Routing
- Subworkflow
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| FileSystem MCP Server | Trigger | Mcp Trigger | See node parameters |
| ListDirectory | Code | Execute Command Tool | See node parameters |
| CreateDirectory | Code | Execute Command Tool | See node parameters |
| When Executed by Another Workflow | Trigger | Execute Workflow Trigger | See node parameters |
| Operation | Routing | Switch | See node parameters |
| readOneOrMultipleFiles | Code | Execute Command | See node parameters |
| ReadFiles | Subworkflow | Tool Workflow | See node parameters |
| WriteFiles | Subworkflow | Tool Workflow | See node parameters |
| writeOneOrMultipleFiles | Code | Execute Command | See node parameters |
| SearchDirectory | Code | Execute Command Tool | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
None declared. HTTP requests and Code nodes may still need configuration.
Workflow notes
1. Set up an MCP Server Trigger
1. Set up an MCP Server Trigger
Always Authenticate Your Server!
Always Authenticate Your Server!
Before going to production, it's always advised to enable authentication on your MCP server trigger.
2. Use Custom Workflow Tool for More Complex Commands
2. Use Custom Workflow Tool for More Complex Commands
Try It Out!
Try It Out!
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!
Always Authenticate Your Server!
Always Authenticate Your Server!
Purpose and structure
This folder contains the Always Authenticate Your Server! workflow. Its executable nodes use executeCommand, executeCommandTool, executeWorkflowTrigger, mcpTrigger, switch, toolWorkflow. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
FileSystem MCP Server, When Executed by Another Workflow
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Executeworkflow/0872_Executeworkflow_Executecommandtool_Create_Triggered.json MIT; preserve source notices.