[
    {
        "id": "mcp-external-example",
        "type": "tab",
        "label": "External MCP Server Example",
        "disabled": false,
        "info": "This flow demonstrates connecting to an external MCP server (like Omnispindle) and calling tools.\n\n**Setup:**\n1. Ensure Omnispindle MCP server is running on localhost:8000\n2. Deploy this flow\n3. Click the inject nodes to test different operations\n\n**Features:**\n- Auto-connect to MCP server with SSE\n- Handshake discovery shows available tools\n- Add todo using direct tool call\n- List todos using MCP Tool node\n- View all responses in debug output"
    },
    {
        "id": "mcp-client-1",
        "type": "mcp-client",
        "z": "mcp-external-example",
        "name": "Omnispindle Client",
        "serverUrl": "http://localhost:8000",
        "connectionType": "sse",
        "autoConnect": true,
        "reconnect": true,
        "reconnectInterval": 5000,
        "timeout": 30000,
        "x": 200,
        "y": 120,
        "wires": [["debug-handshake", "debug-responses"]]
    },
    {
        "id": "debug-handshake",
        "type": "debug",
        "z": "mcp-external-example",
        "name": "Handshake & Tools",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 450,
        "y": 80,
        "wires": []
    },
    {
        "id": "debug-responses",
        "type": "debug",
        "z": "mcp-external-example",
        "name": "All Responses",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 450,
        "y": 160,
        "wires": []
    },
    {
        "id": "inject-add-todo",
        "type": "inject",
        "z": "mcp-external-example",
        "name": "Add Todo",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "request",
        "payload": "{\"method\":\"add_todo_tool\",\"params\":{\"description\":\"Test todo from Node-RED\",\"project\":\"node-red-contrib-mcp-server\",\"priority\":\"Medium\"}}",
        "payloadType": "json",
        "x": 100,
        "y": 220,
        "wires": [["mcp-client-1"]]
    },
    {
        "id": "inject-list-todos",
        "type": "inject",
        "z": "mcp-external-example",
        "name": "List Pending Todos",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "request",
        "payload": "{\"method\":\"list_todos_by_status_tool\",\"params\":{\"status\":\"pending\",\"limit\":10}}",
        "payloadType": "json",
        "x": 120,
        "y": 280,
        "wires": [["mcp-client-1"]]
    },
    {
        "id": "mcp-tool-1",
        "type": "mcp-tool",
        "z": "mcp-external-example",
        "name": "List Project Todos",
        "serverUrl": "http://localhost:8000",
        "toolName": "list_project_todos_tool",
        "toolParams": "{\"project\":\"node-red-contrib-mcp-server\",\"limit\":5}",
        "outputMode": "result",
        "timeout": 30000,
        "x": 320,
        "y": 340,
        "wires": [["debug-tool-output"]]
    },
    {
        "id": "inject-project-todos",
        "type": "inject",
        "z": "mcp-external-example",
        "name": "Get Project Todos",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "payload": "",
        "payloadType": "date",
        "x": 120,
        "y": 340,
        "wires": [["mcp-tool-1"]]
    },
    {
        "id": "debug-tool-output",
        "type": "debug",
        "z": "mcp-external-example",
        "name": "Tool Output",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 540,
        "y": 340,
        "wires": []
    },
    {
        "id": "comment-1",
        "type": "comment",
        "z": "mcp-external-example",
        "name": "External MCP Server Connection",
        "info": "This section shows how to connect to an external MCP server using SSE.\nThe client will automatically discover available tools on connection.",
        "x": 200,
        "y": 40,
        "wires": []
    },
    {
        "id": "comment-2",
        "type": "comment",
        "z": "mcp-external-example",
        "name": "Direct Tool Calls via Client",
        "info": "These inject nodes show how to call MCP tools directly through the client.\nUse the request topic with method and params in the payload.",
        "x": 150,
        "y": 180,
        "wires": []
    },
    {
        "id": "comment-3",
        "type": "comment",
        "z": "mcp-external-example",
        "name": "Dedicated Tool Node",
        "info": "The MCP Tool node provides a simplified interface for calling specific tools.\nPre-configure the tool name and parameters for easy reuse.",
        "x": 150,
        "y": 400,
        "wires": []
    }
] 
