protheus-mcp-server (piloto)
Provides read-only access to TOTVS Protheus ERP system, enabling queries for customer credit limits, payment conditions, products, stock balances, warehouses, purchase orders, and more via OAuth2 authenticated API endpoints.
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., "@protheus-mcp-server (piloto)Show me the credit limit for customer 123456"
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.
protheus-mcp-server (piloto)
Conector MCP somente-leitura para consulta ao Protheus (TOTVS) da DFL. Expõe 10 endpoints GET como tools MCP, com autenticação OAuth2 (password grant + refresh automático) e tratamento amigável de respostas vazias/erros.
Este conector apenas consulta (GET). Não altera nada no Protheus. Os fontes
.prwsão usados só como referência de contrato — nunca são modificados.
Configuração
Copie .env.example para .env e preencha:
PROTHEUS_BASE_URL— base REST (inclui/rest/03).PROTHEUS_USER/PROTHEUS_PASSWORD— credenciais OAuth2. Use um usuário de serviço só-leitura.PROTHEUS_TENANT_ID—empresa,filial(ex.:03,01). Deixe vazio para não enviar o header.PROTHEUS_DFL_TOKEN— token dos WS customizados (só se a MVDFL_TOKENestiver ligada).
Related MCP server: appd-mcp
Build e execução
npm install
npm run build
node dist/index.js # inicia o servidor MCP via stdioAs variáveis de ambiente precisam estar carregadas (via .env do seu runner, Docker, ou export).
Tools (10 endpoints do piloto)
Tool | Endpoint | Observação |
|
| ✅ com dados |
|
| ✅ com dados |
|
| base pode estar vazia |
|
| base pode estar vazia |
|
| base pode estar vazia |
|
| = Solicitações (ambiente DFL) |
|
| = Pedidos (ambiente DFL) |
|
| RH — dado sensível (LGPD) |
|
| e-mail do VENDEDOR |
|
| saldo em aberto (SE1) |
Tratamento amigável de respostas
Regra geral aplicada a toda tool (protheusClient.normalize):
Lista vazia (
items: []), 404 "Nenhum registro foi encontrado" → mensagem "Nenhum registro encontrado para os filtros informados." (não é erro).500 (inclui o comportamento conhecido de alguns WS customizados quando não há registro ou falta parâmetro) → mensagem explicativa pedindo revisão dos parâmetros.
401 → renova o token uma vez e repete; persistindo, retorna erro de autorização.
Formatos: envelope padrão
{hasNext, items}e o formato custom dosWSR*são ambos aceitos.
Regra de autenticação (token/refresh)
O endpoint OAuth2 do Protheus é sensível à codificação dos parâmetros: se username/password/
refresh_token forem 100% percent-encoded (ex.: @ → %40), a autenticação falha. Por isso o
cliente monta as URLs de token e refresh com os parâmetros direto na URL, escapando apenas
o que quebraria a própria URL (#, &, +, espaço e %) e preservando @, !, etc.
Ver ProtheusClient.encTokenParam. Não trocar por URLSearchParams — ele reescapa o @ e
volta a dar erro de autenticação.
Contratos
Os contratos completos (rotas, parâmetros, campos de retorno, bugs conhecidos) estão em
../protheus-piloto-contratos.json e ../Protheus_Piloto_Spec_10_Endpoints.md.
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
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/Endrews-DFL/mcp-protheus-tdn'
If you have feedback or need assistance with the MCP directory API, please join our Discord server