Ep 22: Plug and Play — MCP Client Tool with GitHub & Filesystem Servers

⏱ Est. reading time: 9 min Updated on 4/9/2026

Episode Goal

Connect n8n Agent to two external services via MCP: GitHub Issues and local filesystem.

graph TB
    Agent[🤖 AI Agent] --> MCP1[🔌 MCP: GitHub]
    Agent --> MCP2[🔌 MCP: Filesystem]
    MCP1 -->|"SSE"| GH["🐙 GitHub Server (Docker)"]
    MCP2 -->|"SSE"| FS["📂 Filesystem Server (Docker)"]
    style MCP1 fill:#3b82f6,stroke:#2563eb,color:#fff

1. Deploy MCP Servers

services:
  mcp-github:
    image: ghcr.io/modelcontextprotocol/server-github:latest
    environment:
      - GITHUB_PERSONAL_ACCESS_TOKEN=${GITHUB_TOKEN}
    ports: ["3001:3001"]
    networks: [n8n_network]

  mcp-filesystem:
    image: ghcr.io/modelcontextprotocol/server-filesystem:latest
    volumes: [./shared-data:/data]
    command: /data
    ports: ["3002:3002"]
    networks: [n8n_network]

2. Configure MCP Client Tool

// Connection: SSE
// URL: http://mcp-github:3001/sse (Docker internal network)
// 
// n8n auto-discovers 20+ tools from the MCP Server!
// No manual Tool Descriptions needed — MCP is self-describing

3. Conversation Demo

sequenceDiagram
    participant User as 👤 User
    participant Agent as 🤖 Agent
    participant MCP as 🔌 MCP Client
    participant GH as 🐙 GitHub Server
    User->>Agent: "Search n8n-io/n8n for MCP issues"
    Agent->>MCP: search_issues({repo: "n8n-io/n8n", query: "MCP"})
    MCP->>GH: JSON-RPC call
    GH-->>MCP: 5 matching Issues
    Agent-->>User: Formatted Issue list

4. Security

// 1. Least privilege: GitHub Token with minimal scopes
// 2. Filesystem isolation: mount ONLY specific directories
// 3. Network isolation: MCP Servers on Docker internal network only

Next Episode

Ep 23 reverses roles — exposing n8n workflows as MCP Server for Claude Desktop / Cursor to call.