π§ MCP Workflow Builder β Visual DAG for MCP Tools
Drag-and-drop canvas for chaining MCP tools into multi-step pipelines. Export as standalone TypeScript scripts. React Flow frontend, Express backend, SQLite persistence.
π― What It Does
MCP Workflow Builder is a visual drag-and-drop canvas for chaining MCP (Model Context Protocol) tools into multi-step pipelines β no coding required. Connect MCP servers, drag tools onto a React Flow canvas, wire them into a directed acyclic graph (DAG), and execute with real-time streaming.
βββββββββββ βββββββββββ βββββββββββ
β Start β β β Tool A β β β Tool B β
βββββββββββ βββββββββββ βββββββββββ
β
β
βββββββββββ
β End β
βββββββββββ
π§± Tech Stack
| Component | Technology |
|---|---|
| Frontend | React 18, Vite 5, React Flow 11, Tailwind CSS 3 |
| Backend | Express 4, better-sqlite3 |
| SDK | @modelcontextprotocol/sdk |
| Streaming | Server-Sent Events (SSE) for real-time execution |
| Export | Standalone TypeScript script generation |
ποΈ Architecture
βββ client/
β βββ WorkflowCanvas.tsx # Main React Flow canvas
β βββ ToolPalette.tsx # Left sidebar with searchable tool list
β βββ component/
β β βββ ConditionNode.tsx
β β βββ ToolNode.tsx
β β βββ SubworkflowNode.tsx
β βββ MCPConnectionDialog.tsx # Add new MCP server
β βββ TemplateDialog.tsx # Load from template
β βββ ExecutionPanel.tsx # 200-line terminal log, SSE stream
β βββ ErrorBoundary.tsx
β βββ hooks/
β βββ useWorkflow.ts
β βββ useExecution.ts
β βββ useMCP.ts
β
βββ server/
β βββ routes/
β β βββ workflows.ts # CRUD for workflows
β β βββ mcp.ts # MCP server management
β β βββ execution.ts # Pipeline execution
β β βββ templates.ts # Template storage
β βββ services/
β β βββ execution-engine.ts # Topological sort, parameter binding, SSE
β β βββ mcp-connection.ts # stdio transport, tool discovery
β β βββ workflow-store.ts # SQLite CRUD
β β βββ template-store.ts # Template management
β β βββ export-generator.ts # TypeScript export
β β βββ execution-store.ts # History
β βββ data/workflows.db # SQLite database
β
βββ shared/
βββ types/
βββ index.ts # Shared TypeScript types
π§© Node Types
| Node Type | Purpose |
|---|---|
| Start | Entry point, defines initial parameters |
| End | Terminal node, collects final outputs |
| Input | User-input prompt/parameter node |
| Tool | Executes an MCP tool with parameter bindings |
| Condition | Branches based on expressions: ==, !=, >, <, >=, <=, contains, startsWith, isEmpty |
| Subworkflow | Nests another saved workflow as a step |
π Execution Engine
The execution engine (execution-engine.ts) processes the DAG:
- Topological sort with cycle detection (prevents infinite loops)
- Parameter binding:
{{nodeId.prop}}syntax resolves upstream outputs - Condition evaluation: branch expressions determine which path to follow
- Branch skipping: inactive branches get
skippedstatus - SSE streaming: real-time push of each stepβs result to the frontend
π¦ Templates
4 built-in templates to get started:
- Code Review: Analyze code β linter β security scan β report
- Data Pipeline: Fetch data β transform β validate β export
- Research: Web search β extract β summarize β save
- Custom: Empty canvas
π€ Export
Pipelines can be exported as standalone TypeScript scripts with zero external dependencies beyond @modelcontextprotocol/sdk:
import { Client } from '@modelcontextprotocol/sdk/client/index.js'
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'
const client = new Client({ name: 'exported-pipeline', version: '1.0.0' })
async function evaluate(step: Step, context: Map<string, any>): Promise<any> {
// Inline the pipeline logic
}
π Quick Start
# Start the server
cd server && npm install && npm start
# β Server on http://localhost:3001
# Start the client
cd client && npm install && npm dev
# β UI on http://localhost:5173
# Add an MCP server, drag tools onto the canvas
# Wire them together, hit execute
π‘ Why Itβs Interesting
MCP tools are powerful individually, but their real potential is in composition β chaining multiple tools together to solve complex tasks. The Workflow Builder makes this visual, interactive, and exportable. The DAG-based execution with parameter binding, conditional branching, and real-time SSE streaming turns a collection of individual MCP servers into a full pipeline orchestrator. The TypeScript export feature means your visual workflow becomes a deployable script β best of both worlds.