The MCP-GLSP server implements the Model Context Protocol (MCP) over HTTP with JSON-RPC 2.0, providing AI agents with powerful diagram creation and manipulation capabilities.
Base URL: http://127.0.0.1:3000
Currently no authentication required for local development.
GET /healthResponse:
{
"status": "healthy",
"service": "MCP-GLSP Server",
"version": "0.1.0"
}POST /mcp/rpc
Content-Type: application/jsonAll MCP communication happens through this single endpoint using JSON-RPC 2.0 protocol.
Establishes connection with the MCP server.
Request:
{
"jsonrpc": "2.0",
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {
"experimental": {},
"sampling": {}
},
"clientInfo": {
"name": "Your Client Name",
"version": "1.0.0"
}
},
"id": 1
}Response:
{
"jsonrpc": "2.0",
"result": {
"protocolVersion": "2024-11-05",
"capabilities": {
"tools": {"listChanged": true},
"resources": {"listChanged": true, "subscribe": false},
"prompts": {"listChanged": true}
},
"serverInfo": {
"name": "MCP-GLSP Server",
"version": "0.1.0"
}
},
"id": 1
}{
"jsonrpc": "2.0",
"method": "tools/list",
"id": 2
}{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "create_diagram",
"arguments": {
"diagramType": "workflow",
"name": "My Process"
}
},
"id": 3
}{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "create_node",
"arguments": {
"diagramId": "diagram-uuid",
"nodeType": "task",
"position": {"x": 100, "y": 200},
"label": "Process Order"
}
},
"id": 4
}{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "create_edge",
"arguments": {
"diagramId": "diagram-uuid",
"edgeType": "sequence-flow",
"sourceId": "node-1-uuid",
"targetId": "node-2-uuid"
}
},
"id": 5
}{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "apply_layout",
"arguments": {
"diagramId": "diagram-uuid",
"algorithm": "hierarchical",
"direction": "left-right"
}
},
"id": 6
}{
"jsonrpc": "2.0",
"method": "resources/list",
"id": 7
}{
"jsonrpc": "2.0",
"method": "resources/read",
"params": {
"uri": "diagram://model/{diagram-id}"
},
"id": 8
}{
"jsonrpc": "2.0",
"method": "resources/read",
"params": {
"uri": "diagram://validation/{diagram-id}"
},
"id": 9
}{
"jsonrpc": "2.0",
"method": "prompts/list",
"id": 10
}{
"jsonrpc": "2.0",
"method": "prompts/get",
"params": {
"name": "generate_workflow",
"arguments": {
"description": "Create an order fulfillment process",
"style": "bpmn"
}
},
"id": 11
}| Tool Name | Description | Key Parameters |
|---|---|---|
create_diagram |
Create new diagram | diagramType, name |
create_node |
Add node to diagram | diagramId, nodeType, position, label |
create_edge |
Connect two nodes | diagramId, sourceId, targetId, edgeType |
delete_element |
Remove element | diagramId, elementId |
update_element |
Modify element properties | diagramId, elementId, properties |
apply_layout |
Auto-arrange elements | diagramId, algorithm |
export_diagram |
Export in various formats | diagramId, format |
| Resource URI Pattern | Description |
|---|---|
diagram://list |
List all diagrams |
diagram://model/{id} |
Complete diagram model |
diagram://elements/{id} |
All elements in diagram |
diagram://metadata/{id} |
Diagram statistics |
diagram://validation/{id} |
Validation results |
diagram://schemas/model |
Diagram model JSON schema |
| Prompt Name | Description | Parameters |
|---|---|---|
generate_workflow |
Create workflow from description | description, style |
optimize_layout |
Improve diagram layout | diagram_id, criteria |
add_error_handling |
Add error handling patterns | diagram_id, error_types |
analyze_diagram |
Analyze for improvements | diagram_id, focus |
create_subprocess |
Break down complex task | task_description, detail_level |
convert_diagram |
Convert between formats | diagram_id, target_type |
start-event- Process start pointend-event- Process completiontask- Work activityuser-task- Manual user activityservice-task- Automated system activitygateway- Decision point or parallel splitintermediate-event- Milestone or wait point
sequence-flow- Normal process flowconditional-flow- Decision branchmessage-flow- Communication between processesassociation- Non-flow relationship
All responses follow JSON-RPC 2.0 error format:
{
"jsonrpc": "2.0",
"error": {
"code": -32603,
"message": "Internal error",
"data": "Additional error details"
},
"id": null
}- Initialize: Connect to MCP server
- Create Diagram: Use
create_diagramtool - Add Elements: Use
create_nodeandcreate_edgetools - Apply Layout: Use
apply_layouttool for organization - Validate: Read
diagram://validation/{id}resource - Export: Use
export_diagramtool
This API is designed for AI agents. Use the prompts to get detailed instructions for complex operations, then execute the recommended tool sequences to accomplish sophisticated modeling tasks.