diff --git a/servers/sailor/readme.md b/servers/sailor/readme.md new file mode 100644 index 000000000..0650b1618 --- /dev/null +++ b/servers/sailor/readme.md @@ -0,0 +1,130 @@ +# Sailor - Mermaid Diagram Generator + +MCP server for generating and rendering professional Mermaid diagrams from natural language descriptions. + +## Overview + +Sailor transforms how developers create technical diagrams. Instead of manually writing Mermaid syntax, simply describe what you want in plain English and get production-ready diagram code. The server also validates, renders, and optimizes existing diagrams. + +Key features: +- **Natural Language Generation**: Describe your diagram in plain text and get valid Mermaid code +- **Multi-Format Rendering**: Export to PNG, SVG, or PDF with customizable themes +- **Code Analysis**: Generate diagrams directly from source code +- **Diagram Intelligence**: Analyze, improve, and optimize existing diagrams +- **Comprehensive Support**: Flowcharts, sequence, class, state, ER, Gantt, pie charts, and mindmaps + +## Tools + +### `request_mermaid_generation` +Generate a Mermaid diagram from a natural language description. + +**Parameters:** +- `description` (string, required): Natural language description of the diagram +- `diagram_type` (string, optional): Type of diagram (flowchart, sequence, class, state, er, gantt, pie, mindmap, auto) +- `style_preferences` (object, optional): Style customization options + +### `validate_and_render_mermaid` +Validate Mermaid code and render to an image format. + +**Parameters:** +- `mermaid_code` (string, required): Mermaid diagram code +- `output_format` (string, optional): png, svg, or pdf (default: png) +- `theme` (string, optional): default, dark, forest, or neutral + +### `get_mermaid_examples` +Get example diagrams for reference and learning. + +**Parameters:** +- `diagram_type` (string, optional): Filter by diagram type +- `complexity` (string, optional): simple, medium, or complex +- `industry` (string, optional): Filter by domain/industry + +### `analyze_diagram` +Extract structure, relationships, and meaning from a diagram. + +**Parameters:** +- `mermaid_code` (string, required): Diagram code to analyze +- `analysis_depth` (string, optional): basic, detailed, or comprehensive + +### `suggest_improvements` +Get recommendations for improving diagram quality. + +**Parameters:** +- `mermaid_code` (string, required): Diagram code to analyze +- `focus_areas` (array, optional): Areas to focus on (readability, style, structure, accessibility) + +### `convert_diagram_style` +Apply a new visual style or theme to a diagram. + +**Parameters:** +- `mermaid_code` (string, required): Original diagram code +- `target_style` (string, required): Target style to apply + +### `generate_from_code` +Generate diagrams from source code analysis. + +**Parameters:** +- `source_code` (string, required): Source code to analyze +- `language` (string, optional): Programming language +- `diagram_type` (string, optional): class, sequence, or flowchart + +### `generate_from_data` +Create diagrams from structured JSON or CSV data. + +**Parameters:** +- `data` (string, required): Structured data +- `data_format` (string, optional): json or csv +- `visualization_type` (string, optional): Type of visualization + +### `modify_diagram` +Apply targeted modifications to an existing diagram. + +**Parameters:** +- `mermaid_code` (string, required): Original diagram code +- `modifications` (array, required): List of modifications + +### `merge_diagrams` +Combine two diagrams into one cohesive diagram. + +**Parameters:** +- `diagram1` (string, required): First diagram +- `diagram2` (string, required): Second diagram +- `merge_strategy` (string, optional): append, interleave, or smart + +### `extract_subgraph` +Extract a portion of a diagram as a standalone subgraph. + +**Parameters:** +- `mermaid_code` (string, required): Original diagram +- `node_ids` (array, required): Nodes to include +- `include_connected` (boolean, optional): Include connected nodes + +### `optimize_layout` +Optimize diagram layout for better readability. + +**Parameters:** +- `mermaid_code` (string, required): Diagram to optimize +- `optimization_goals` (array, optional): Goals like minimize_crossings, balance_layout, compact + +## Usage Examples + +### Generate a System Architecture Diagram +``` +Create a flowchart showing a web application architecture with a load balancer, +two web servers, a database cluster, and a cache layer +``` + +### Analyze an Existing Diagram +``` +Analyze this class diagram and suggest improvements for better readability +``` + +### Generate from Code +``` +Generate a class diagram from this Python code showing the inheritance hierarchy +``` + +## Links + +- [Source Repository](https://github.com/aj-geddes/sailor) +- [Issue Tracker](https://github.com/aj-geddes/sailor/issues) diff --git a/servers/sailor/server.yaml b/servers/sailor/server.yaml new file mode 100644 index 000000000..d3084477b --- /dev/null +++ b/servers/sailor/server.yaml @@ -0,0 +1,33 @@ +name: sailor +image: mcp/sailor +type: server + +meta: + category: developer-tools + tags: + - mermaid + - diagrams + - visualization + - flowchart + - documentation + - architecture + - rendering + +about: + title: Sailor - Mermaid Diagram Generator + description: | + MCP server for generating and rendering Mermaid diagrams. Transform natural language + descriptions into professional diagrams, validate and render Mermaid code, analyze + existing diagrams, and generate diagrams from source code or structured data. + + Key capabilities: + - Natural language to diagram conversion + - Mermaid code validation and rendering (PNG, SVG, PDF) + - Diagram analysis and improvement suggestions + - Code-to-diagram generation + - Multiple diagram types: flowcharts, sequence, class, state, ER, and more + icon: https://avatars.githubusercontent.com/u/78109011 + +source: + project: https://github.com/aj-geddes/sailor + commit: 6bf7525170ad36073c3ead1b2fe7f0216dea10f2 diff --git a/servers/sailor/tools.json b/servers/sailor/tools.json new file mode 100644 index 000000000..4f66c6f2a --- /dev/null +++ b/servers/sailor/tools.json @@ -0,0 +1,258 @@ +[ + { + "name": "request_mermaid_generation", + "description": "Generate a Mermaid diagram from a natural language description. Supports flowcharts, sequence diagrams, class diagrams, state diagrams, ER diagrams, and more.", + "inputSchema": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Natural language description of the diagram to generate" + }, + "diagram_type": { + "type": "string", + "description": "Type of diagram (flowchart, sequence, class, state, er, gantt, pie, mindmap)", + "enum": ["flowchart", "sequence", "class", "state", "er", "gantt", "pie", "mindmap", "auto"] + }, + "style_preferences": { + "type": "object", + "description": "Optional style preferences for the diagram" + } + }, + "required": ["description"] + } + }, + { + "name": "validate_and_render_mermaid", + "description": "Validate Mermaid diagram code and render it to an image format (PNG, SVG, or PDF).", + "inputSchema": { + "type": "object", + "properties": { + "mermaid_code": { + "type": "string", + "description": "Mermaid diagram code to validate and render" + }, + "output_format": { + "type": "string", + "description": "Output format for the rendered diagram", + "enum": ["png", "svg", "pdf"], + "default": "png" + }, + "theme": { + "type": "string", + "description": "Theme for the diagram", + "enum": ["default", "dark", "forest", "neutral"] + } + }, + "required": ["mermaid_code"] + } + }, + { + "name": "get_mermaid_examples", + "description": "Get example Mermaid diagrams for learning and reference. Returns examples filtered by diagram type, complexity, or industry.", + "inputSchema": { + "type": "object", + "properties": { + "diagram_type": { + "type": "string", + "description": "Filter examples by diagram type" + }, + "complexity": { + "type": "string", + "description": "Filter by complexity level", + "enum": ["simple", "medium", "complex"] + }, + "industry": { + "type": "string", + "description": "Filter by industry/domain" + } + } + } + }, + { + "name": "analyze_diagram", + "description": "Analyze a Mermaid diagram to extract structure, relationships, and semantic meaning.", + "inputSchema": { + "type": "object", + "properties": { + "mermaid_code": { + "type": "string", + "description": "Mermaid diagram code to analyze" + }, + "analysis_depth": { + "type": "string", + "description": "Depth of analysis", + "enum": ["basic", "detailed", "comprehensive"] + } + }, + "required": ["mermaid_code"] + } + }, + { + "name": "suggest_improvements", + "description": "Suggest improvements for a Mermaid diagram based on best practices, readability, and visual clarity.", + "inputSchema": { + "type": "object", + "properties": { + "mermaid_code": { + "type": "string", + "description": "Mermaid diagram code to analyze for improvements" + }, + "focus_areas": { + "type": "array", + "items": {"type": "string"}, + "description": "Areas to focus on (readability, style, structure, accessibility)" + } + }, + "required": ["mermaid_code"] + } + }, + { + "name": "convert_diagram_style", + "description": "Convert a diagram between different Mermaid styles or apply a new visual theme.", + "inputSchema": { + "type": "object", + "properties": { + "mermaid_code": { + "type": "string", + "description": "Original Mermaid diagram code" + }, + "target_style": { + "type": "string", + "description": "Target style or theme to apply" + } + }, + "required": ["mermaid_code", "target_style"] + } + }, + { + "name": "generate_from_code", + "description": "Generate Mermaid diagrams from source code analysis. Supports class diagrams, sequence diagrams, and flowcharts.", + "inputSchema": { + "type": "object", + "properties": { + "source_code": { + "type": "string", + "description": "Source code to analyze" + }, + "language": { + "type": "string", + "description": "Programming language of the source code" + }, + "diagram_type": { + "type": "string", + "description": "Type of diagram to generate", + "enum": ["class", "sequence", "flowchart"] + } + }, + "required": ["source_code"] + } + }, + { + "name": "generate_from_data", + "description": "Generate diagrams from structured data (JSON or CSV). Automatically detects patterns and creates appropriate visualizations.", + "inputSchema": { + "type": "object", + "properties": { + "data": { + "type": "string", + "description": "Structured data in JSON or CSV format" + }, + "data_format": { + "type": "string", + "description": "Format of the input data", + "enum": ["json", "csv"] + }, + "visualization_type": { + "type": "string", + "description": "Type of visualization to create" + } + }, + "required": ["data"] + } + }, + { + "name": "modify_diagram", + "description": "Apply specific modifications to an existing Mermaid diagram such as adding nodes, changing relationships, or updating labels.", + "inputSchema": { + "type": "object", + "properties": { + "mermaid_code": { + "type": "string", + "description": "Original Mermaid diagram code" + }, + "modifications": { + "type": "array", + "items": {"type": "object"}, + "description": "List of modifications to apply" + } + }, + "required": ["mermaid_code", "modifications"] + } + }, + { + "name": "merge_diagrams", + "description": "Intelligently merge two Mermaid diagrams into a single cohesive diagram.", + "inputSchema": { + "type": "object", + "properties": { + "diagram1": { + "type": "string", + "description": "First Mermaid diagram code" + }, + "diagram2": { + "type": "string", + "description": "Second Mermaid diagram code" + }, + "merge_strategy": { + "type": "string", + "description": "Strategy for merging", + "enum": ["append", "interleave", "smart"] + } + }, + "required": ["diagram1", "diagram2"] + } + }, + { + "name": "extract_subgraph", + "description": "Extract a portion of a larger diagram as a standalone subgraph.", + "inputSchema": { + "type": "object", + "properties": { + "mermaid_code": { + "type": "string", + "description": "Original Mermaid diagram code" + }, + "node_ids": { + "type": "array", + "items": {"type": "string"}, + "description": "IDs of nodes to include in the extracted subgraph" + }, + "include_connected": { + "type": "boolean", + "description": "Include directly connected nodes" + } + }, + "required": ["mermaid_code", "node_ids"] + } + }, + { + "name": "optimize_layout", + "description": "Optimize diagram layout for better readability and visual presentation.", + "inputSchema": { + "type": "object", + "properties": { + "mermaid_code": { + "type": "string", + "description": "Mermaid diagram code to optimize" + }, + "optimization_goals": { + "type": "array", + "items": {"type": "string"}, + "description": "Goals for optimization (minimize_crossings, balance_layout, compact)" + } + }, + "required": ["mermaid_code"] + } + } +]