flow-diagram
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@flow-diagramCreate a flow diagram for a product checkout process."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Flow diagram generator and MCP
LLMs don't always generate the best flow diagrams. Use this MCP integration to build better visuals.
Features
Flow Diagram build functions
Server features powered by Express
MCP tools integration (including <list the specific MCP tools used, e.g. OpenAI, LangChain, etc.>)
Diagram visualization using Mermaid and other supported formats (SVG, HTML, JSON, text)
Testing powered by Jest
Quick Start
# Install dependencies
npm install
# Build the project
npm run build
# Run the demo
npm run demo
# Start the MCP server
npm run mcp:devVisual Comparison
See the difference between LLM-generated flow-chart and LLM + MCP-generated diagrams.
Built using the same prompt.
Can you make a complicated flow diagram for my adventure "choose your own adventure series". It should start at 1 place, then based on certain decisions, lead you down some paths. In the end, everything should lead you back to a single now.
Use whatever fantasy events you want to. Think "dungeons and dragons".
Generate an svg file [(WITHOUT)] using my flow-diagram mcp.Brute-force SVG
(examples/adventure-flow.svg)
MCP-Generated SVG
(examples/dragon-slayer.svg)
Key Differences
Feature | Brute-force SVG | MCP-Generated |
Dimensions | Fixed at 1200x1400 | Auto-calculated (2600x800) |
Complexity | ~140 lines of SVG | Generated from ~35 nodes, 3 Tool Calls |
Modification | Manual SVG edits | Modify via API |
Scalability | Manual scaling | Automatic fitting |
Maintenance | High effort | Low effort |
The MCP-generated diagram automatically sizes to fit all content, while the manually created one uses fixed dimensions that may not accommodate future changes.
Basic Usage
import { createFlowDiagram, visualizeDiagram } from './src/index';
// Create a simple flow diagram
const diagram = createFlowDiagram({ title: 'My Process' });
// Add nodes
const startId = diagram.addNode({
label: 'Start',
type: 'start',
style: { backgroundColor: '#e8f5e8' }
});
const processId = diagram.addNode({
label: 'Process Data',
type: 'process',
style: { backgroundColor: '#e3f2fd' }
});
const endId = diagram.addNode({
label: 'End',
type: 'end',
style: { backgroundColor: '#ffebee' }
});
// Add edges
diagram.addEdge({ sourceId: startId, targetId: processId });
diagram.addEdge({ sourceId: processId, targetId: endId });
// Auto-layout
diagram.autoLayout('hierarchical');
// Generate visualizations
const svg = visualizeDiagram(diagram, 'svg');
const mermaid = visualizeDiagram(diagram, 'mermaid');
const html = visualizeDiagram(diagram, 'html', { theme: 'dark' });Helper Functions
import { FlowDiagramHelpers } from './src/index';
// Linear flow
const linearFlow = FlowDiagramHelpers.createLinearFlow([
'Start', 'Process', 'Validate', 'End'
]);
// Decision tree
const decisionTree = FlowDiagramHelpers.createDecisionTree('User Login', [
{ condition: 'Valid?', next: 'Grant Access' },
{ condition: 'Invalid?', next: 'Show Error' }
]);API Reference
Core Classes
FlowDiagram- Main class for managing nodes and edgesFlowDiagramHelpers- Utility functions for common patternsFlowDiagramVisualizer- Generate visualizations in multiple formats
Key Methods
addNode(),addEdge()- Add elements to diagramsautoLayout()- Automatic positioningvisualize()- Generate SVG, HTML, Mermaid, JSON, or text outputcreateLinearFlow(),createDecisionTree()- Helper functions
Development
npm install
npm run build
npm test
npm run demoMCP Server
The library includes an MCP server for LLM integration.
Start Server
npm run mcp:devServer runs at http://localhost:3000 with these endpoints:
GET /health- Health checkGET /mcp/tools- List available toolsPOST /mcp/tools/:toolName/execute- Execute tools
Available Tools
create_diagram,add_node,add_edge- Basic operationsvisualize_diagram- Generate visualizationscreate_linear_flow,create_decision_tree,create_process_flow- Helper functionsget_diagram_info,list_diagrams- Information queries
Cursor Integration
Add this to your Cursor MCP config:
macOS: ~/Library/Application Support/Cursor/User/globalStorage/cursor.mcp/config.json
Windows: %APPDATA%\Cursor\User\globalStorage\cursor.mcp\config.json
Linux: ~/.config/Cursor/User/globalStorage/cursor.mcp/config.json
{
"mcpServers": {
"flow-diagram": {
"type": "http",
"url": "http://localhost:3000",
"headers": {
"Content-Type": "application/json"
}
}
}
}Restart Cursor after updating the configuration.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jrmcauliffe00/flow-diagram'
If you have feedback or need assistance with the MCP directory API, please join our Discord server