loading…
Search for a command to run...
loading…
MCP server for orchestrating the consignado loan journey via WhatsApp agent, centralizing flow rules, identity resolution, and journey consistency.
MCP server for orchestrating the consignado loan journey via WhatsApp agent, centralizing flow rules, identity resolution, and journey consistency.
Segue o README.md pronto, organizado para repositório corporativo.
Servidor MCP (Model Context Protocol – HTTP Dispatcher) para orquestração da jornada de empréstimo consignado via agente (ex: WhatsApp).
Este serviço:
correlationIdAmbiente atual: DEV (in-memory). Produção requer persistência, autenticação forte e proteção de PII.
WhatsApp Agent
↓
POST /call
↓
MCP Server
↓
Mock Core APIs
O agente nunca chama core direto. Toda regra de negócio e validação de sequência passa pelo MCP.
Identifica uma jornada. Tudo que acontece fica vinculado a ele.
Regras:
channel não pode mudar no meio da jornada (409).customerRef não pode trocar depois de resolvido (409).Fluxo obrigatório no canal whatsapp:
Se tentar pular etapa → 403.
cpfToken.get_loan_offers exige esse token.DEV usa SHA256 simples. Produção deve usar HMAC com secret + TTL.
Lista tools disponíveis.
{
"tools": [
"lookup_customer_by_phone",
"resolve_identity_by_cpf",
"get_identity_context",
"check_eligibility",
"get_loan_offers",
"create_contract",
"get_formalization_link"
]
}
Dispatcher principal.
{
"tool": "string",
"input": {},
"context": {
"correlationId": "string",
"channel": "app|web|whatsapp|agencia",
"subject": "opcional"
}
}
{
"output": {}
}
Retorna estado interno da sessão.
⚠ Remover ou proteger fortemente em produção.
Resolve cliente por telefone.
{ "phone": "+5511999999999" }
{ "found": false, "reasonCode": "INVALID_PHONE" }
{ "found": true, "needsCpf": false }
{ "found": true, "needsCpf": true }
Nunca retorna lista de clientes.
Valida CPF quando há duplicidade.
{ "cpf": "11122233344" }
{ "resolved": true }
{ "resolved": false, "reasonCode": "CPF_MISMATCH" }
Retorna identidade resolvida.
{ "hasIdentity": false }
{
"hasIdentity": true,
"customerRef": "cust_tok_302556",
"cpfToken": "sha256..."
}
{
"customerRef": "cust_tok_302556",
"channel": "whatsapp"
}
{
"eligible": true,
"eligibilityId": "uuid",
"reasonCode": null
}
Valida:
Recebe cpfToken + valor solicitado.
{
"customerRef": "cust_tok_302556",
"eligibilityId": "uuid",
"cpfToken": "sha256...",
"requestedAmount": 5000
}
{
"offers": [
{
"offerId": "offer-1",
"requestedAmount": 5000,
"approvedAmount": 5000,
"installments": 24
},
{
"offerId": "offer-2",
"requestedAmount": 5000,
"approvedAmount": 4500,
"installments": 36
}
]
}
Valida:
Possui idempotência.
{
"customerRef": "cust_tok_302556",
"offerId": "offer-1",
"idempotencyKey": "uuid",
"acceptance": { "channel": "whatsapp" }
}
{
"contractId": "uuid",
"status": "PENDING_VIDEO"
}
Se repetir idempotencyKey → retorna mesma resposta.
{
"customerRef": "cust_tok_302556",
"contractId": "uuid"
}
{
"formalizationUrl": "https://video.plataforma.local/<contractId>",
"expiresAt": "2026-12-31T23:59:59Z"
}
| Código | Motivo |
|---|---|
| 400 | Input inválido ou campo obrigatório ausente |
| 403 | Fluxo inválido / identidade não resolvida / token incorreto |
| 409 | Conflito de jornada (channel, customerRef, eligibilityId, contractId) |
| Estado | Significado |
|---|---|
| NOT_FOUND | Telefone não encontrado |
| PENDING_CPF | Duplicidade, aguardando CPF |
| READY | Identidade resolvida |
uvicorn server:app --port 8001 --reload
Este MCP centraliza:
Ele não é apenas mock de API. É camada de governança de fluxo.
Выполни в терминале:
claude mcp add consignado-mcp-local -- npx Web content fetching and conversion for efficient LLM usage.
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolProvides auto-configuration for setting up an MCP server in Spring Boot applications.
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzНе уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai