BlackTDN :: 🚀 MCP Server (MATA410PLAYMCPSERVER) no forno! 💬💡

_Créditos da imagem: BlackTDN

🚀 MCP Server (MATA410PLAYMCPSERVER) no forno! Um ciclo em desenvolvimento de inicialização e comunicação via protocolo JSON-RPC com sucesso 💬💡

📂 Diretórios monitorados:

Stop file ➜ c:\tmp\tmcpserver\mcp_io\uf_mata410playmcpserver\uf.mata410.play.mcp.server.stop

Input ➜ hb.totvs.mcp.msg.json

Output ➜ totvs.hb.mcp.msg.json

🌀 Main loop iniciado... aguardando mensagens.

📨 Mensagens recebidas e processadas: 

✅ initialize
✅ notifications/initialized
✅ ping → Resposta? "status": "pong" 😄
✅ tools/list → Entrega completa do schema da sales_order_insert com validação JSON via schema draft-07.

🧠 Capabilities negociadas:

prompts.listChanged
resources.subscribe
tools.listChanged

🧰 Ferramenta registrada: sales_order_insert → Criar e inserir pedidos de venda com validação robusta.

💡 Trabalhar com protocolos estruturados como o JSON-RPC dentro do ecossistema TOTVS abre espaço para integrações inteligentes, testes automatizados e mais controle sobre o fluxo de dados e comandos.

```bash
MCP Server(MATA410PLAYMCPSERVER) : Received message: {"jsonrpc":"2.0","id":"init-1","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"roots":{"listChanged":true},"sampling":{},"experimental":{}},"clientInfo":{"name":"MCP-CLI","version":"0.2"}}}
MCP Server(MATA410PLAYMCPSERVER) : Sending response: {"header":[{"Content-Length":"263"}],"response":{"jsonrpc":"2.0","id":"init-1","result":{"protocolVersion":"2024-11-05","capabilities":{"prompts":{"listChanged":true},"resources":{"subscribe":true,"listChanged":true},"tools":{"listChanged":true}},"serverInfo":{"name":"MATA410PLAYMCPSERVER","version":"1.0.0"}}}}
MCP Server(MATA410PLAYMCPSERVER): Received message: {
    "jsonrpc": "2.0",
    "method": "notifications/initialized",
    "params": {}
}
MCP Server(MATA410PLAYMCPSERVER): Sending response: {
    "header": [{
            "Content-Length": "263"
        }
    ],
    "response": {
        "jsonrpc": "2.0",
        "id": "init-1",
        "result": {
            "protocolVersion": "2024-11-05",
            "capabilities": {
                "prompts": {
                    "listChanged": true
                },
                "resources": {
                    "subscribe": true,
                    "listChanged": true
                },
                "tools": {
                    "listChanged": true
                }
            },
            "serverInfo": {
                "name": "MATA410PLAYMCPSERVER",
                "version": "1.0.0"
            }
        }
    }
}
MCP Server(MATA410PLAYMCPSERVER): Received message: {
    "jsonrpc": "2.0",
    "id": "0b29e8fc-be78-46a3-ba5d-dfb0f1efe2fe",
    "method": "ping"
}
MCP Server(MATA410PLAYMCPSERVER): Sending response: {
    "header": [{
            "Content-Length": "77"
        }
    ],
    "response": {
        "jsonrpc": "2.0",
        "id": "0b29e8fc-be78-46a3-ba5d-dfb0f1efe2fe",
        "result": "pong"
    }
}
MCP Server(MATA410PLAYMCPSERVER): Received message: {
    "jsonrpc": "2.0",
    "id": "bbad0d20-3f7a-4a12-8170-94c94acd7406",
    "method": "tools/list",
    "params": {}
}
MCP Server(MATA410PLAYMCPSERVER): Sending response: {
    "header": [{
            "Content-Length": "1848"
        }
    ],
    "response": {
        "jsonrpc": "2.0",
        "id": "bbad0d20-3f7a-4a12-8170-94c94acd7406",
        "result": {
            "tools": [{
                    "id": "C76BAAAA833DF011BD29C88A9A3BC27E",
                    "name": "sales_order_insert",
                    "description": "Tool for creating and inserting new sales orders into the system.",
                    "inputSchema": {
                        "$schema": "http://json-schema.org/draft-07/schema#",
                        "title": "Generated schema for Root",
                        "type": "object",
                        "properties": {
                            "C5_TIPO": {
                                "type": "string",
                                "title": "Tipo Pedido",
                                "description": "Tipo de Pedido"
                            },
                            "C5_CLIENTE": {
                                "type": "string",
                                "title": "Cliente",
                                "description": "Codigo do Cliente"
                            },
                            "C5_LOJACLI": {
                                "type": "string",
                                "title": "Loja",
                                "description": "Loja do Cliente"
                            },
                            "C5_TIPOCLI": {
                                "type": "string",
                                "title": "Tipo Cliente",
                                "description": "Tipo do Cliente"
                            },
                            "C5_CONDPAG": {
                                "type": "string",
                                "title": "Cond. Pagto",
                                "description": "Condicao de Pagamento"
                            },
                            "C5_NATUREZ": {
                                "type": "string",
                                "title": "Natureza",
                                "description": "Natureza"
                            },
                            "SC6": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "C6_ITEM": {
                                            "type": "string",
                                            "title": "Item",
                                            "description": "Numero do Item no Pedido"
                                        },
                                        "C6_PRODUTO": {
                                            "type": "string",
                                            "title": "Produto",
                                            "description": "Codigo do Produto"
                                        },
                                        "C6_UM": {
                                            "type": "string",
                                            "title": "Unidade",
                                            "description": "Unidade de Medida Primar."
                                        },
                                        "C6_QTDVEN": {
                                            "type": "number",
                                            "title": "Quantidade",
                                            "description": "Quantidade Vendida"
                                        },
                                        "C6_VALOR": {
                                            "type": "number",
                                            "title": "Vlr.Total",
                                            "description": "Valor Total do Item"
                                        },
                                        "C6_TES": {
                                            "type": "string",
                                            "title": "Tipo Saida",
                                            "description": "Tipo de Saida do Item"
                                        },
                                        "C6_LOCAL": {
                                            "type": "string",
                                            "title": "Armazem",
                                            "description": "Armazem"
                                        },
                                        "C6_PRUNIT": {
                                            "type": "number",
                                            "title": "Prc Lista",
                                            "description": "Preco Unitario de Tabela"
                                        }
                                    }
                                },
                                "required": ["C6_ITEM", "C6_PRODUTO", "C6_UM", "C6_QTDVEN", "C6_VALOR", "C6_TES", "C6_LOCAL", "C6_PRUNIT"]
                            }
                        },
                        "C5_COMENT": {
                            "type": "string",
                            "title": "Comentario",
                            "description": "Comentario do pedido"
                        }
                    },
                    "$schema": "http://json-schema.org/draft-07/schema#",
                    "args": []
                }
            ]
        }
    }
}

```

#TOTVS #MCP #JSONRPC #DEVlife #ERP #integração #automação #harbour #TLPP #ADVPL

Comentários

Postagens mais visitadas