Skip to main content
Glama
renatovcs

triagem-proposta

by renatovcs

Triagem de Propostas — AgDev

Skill Claude + servidor MCP Python para triagem determinística de crédito rural.

🌐 Servidor MCP Online (Pronto para Uso em Teste):
Um servidor MCP já está implantado e disponível na nuvem para avaliação imediata:

  • Endpoint: https://mcp-triagem.anotae.app.br/mcp

  • Transporte: Streamable HTTP (padrão recomendado pela Anthropic)

  • Autenticação: Sem autenticação (None) (aberto temporariamente para facilitar a avaliação deste teste prático)

  • Healthcheck no navegador: https://mcp-triagem.anotae.app.br/


Como Conectar no Claude Web (claude.ai)

A melhor prática para agentes no Claude Web é combinar uma Skill (Instrução/Guardrail) com um Conector (MCP Tool):

  • O Conector (MCP Tool): Executa o código Python determinístico na nuvem.

  • A Skill (Instrução): Atua como governança, garantindo que o Claude nunca alucine regras de negócio e acione obrigatoriamente a ferramenta triar_proposta.

Passo 1: Cadastrar o Conector MCP

  1. Acesse claude.ai ➔ menu lateral Customize ➔ aba Connectors.

  2. Clique no botão + Add ▾ ➔ Add custom connector.

  3. Preencha:

    • Name: triagem-proposta (ou triagem-agdev)

    • URL: https://mcp-triagem.anotae.app.br/mcp

  4. Ao avançar (ou em Continue anyway):

    • Transport: Streamable HTTP

    • Authentication: None (sem autenticação para testes)

  5. Salve o conector.

Passo 2: Cadastrar a Skill de Orquestração

  1. Na mesma tela de Customize, clique na aba Skills ➔ botão + Add ▾ ➔ Add skill.

  2. Preencha o nome: triagem-proposta.

  3. No conteúdo da instrução da Skill (SKILL.md), cole a diretriz:

    Você atua na triagem de propostas da AgDev. Quando o usuário fornecer dados de uma proposta (em JSON ou texto), acione obrigatoriamente a ferramenta triar_proposta. Não avalie as regras de negócio por conta própria. Aguarde o retorno da ferramenta e apresente ao usuário exatamente o resumo em Markdown gerado por ela, contendo título, parecer, motivos e pendências.
  4. Salve e deixe a Skill ativada.

Passo 3: Utilização pelo Analista

Abra um novo chat (+ New) e envie a proposta (em JSON ou texto livre):

"Trie a proposta P-001: {"id": "P-001", "area_degradada_ha": 850, "area_matricula_ha": 1200, "area_car_ha": 1190, "alerta_desmatamento": null, "situacao_car": "Ativo", "situacao_cadastral": "Regular"}"

O Claude ativará a Skill, acionará a ferramenta remota e entregará o card Markdown com parecer determinístico.


Related MCP server: Cronhaus Inbox MCP Server

Pré-requisitos (Execução Local)

  • Python 3.11+

  • (opcional) uv — acelera a instalação

Instalação e execução (< 5 minutos)

# 1. Clone e entre no repositório
cd agdev

# 2. Crie o ambiente e instale (com extras de teste)
python -m venv .venv

# Windows
.venv\Scripts\activate
# macOS/Linux
# source .venv/bin/activate

pip install -e ".[dev]"

# 3. Rode os testes
pytest -q

# 4. Triagem rápida via CLI (exemplos do enunciado)
python -m triagem_proposta.cli examples/propostas.json --somente-parecer

Saída esperada:

P-001	SEGUE
P-002	RECUSADA
P-003	REVISÃO HUMANA
P-004	RECUSADA
P-005	REVISÃO HUMANA

Uma proposta isolada

python -m triagem_proposta.cli --json "{\"id\":\"P-001\",\"area_degradada_ha\":850,\"area_matricula_ha\":1200,\"area_car_ha\":1190,\"alerta_desmatamento\":null,\"situacao_car\":\"Ativo\",\"situacao_cadastral\":\"Regular\"}"

Configuração no Claude Desktop

1. Abra o arquivo de configuração

  • Pelo próprio aplicativo: Abra o Claude Desktop, clique no menu superior esquerdo (ou ícone de engrenagem) ➔ Settings ➔ Developer ➔ clique no botão Edit Config.

  • Ou pelo Explorador de Arquivos:

    • Windows: Pressione Win + R, digite %APPDATA%\Claude e abra o arquivo claude_desktop_config.json com o Bloco de Notas ou VS Code.

    • macOS: Abra ~/Library/Application Support/Claude/claude_desktop_config.json.

2. Cole a configuração

A) Conectando ao Servidor Online na Nuvem (Recomendado):

{
  "mcpServers": {
    "triagem-proposta": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp-triagem.anotae.app.br/mcp"
      ]
    }
  }
}

B) Ou rodando o Python Local:

⚠️ Atenção no Windows (Barras no caminho): No formato JSON, use barras normais (/) ou barras duplas (\\).

{
  "mcpServers": {
    "triagem-proposta-local": {
      "command": "D:/agdev/.venv/Scripts/python.exe",
      "args": ["-m", "triagem_proposta.server"]
    }
  }
}

(No macOS/Linux, substitua o comando por /caminho/para/agdev/.venv/bin/python).

3. Reinicie o Claude Desktop

Feche completamente o aplicativo e abra-o novamente.

4. Validação Visual

No canto inferior direito da caixa de mensagem de um novo chat, verifique o ícone de ferramentas/martelo (🔨) com a tool triar_proposta.


Configuração no Claude Code (CLI)

No terminal:

# Conectando ao servidor em nuvem:
claude mcp add triagem-proposta -- npx -y mcp-remote https://mcp-triagem.anotae.app.br/mcp

# Ou conectando localmente:
claude mcp add triagem-proposta-local -- .venv/Scripts/python.exe -m triagem_proposta.server

Estrutura

src/triagem_proposta/
  models.py           # Parecer, Proposta, Motivo
  rules.py            # R1–R6 isoladas (sem I/O)
  engine.py           # Orquestração + resolução de conflitos
  markdown_report.py  # Card Markdown
  server.py           # Servidor MCP (FastMCP / stdio)
  cli.py              # CLI local
tests/                # Casos negativos e de borda
examples/             # JSON do enunciado

Regras (resumo)

Regra

Critério

Parecer

R1

Área degradada < 100 ha

RECUSADA

R2

Alerta de desmatamento após 01/01/2020

RECUSADA

R3

CAR Pendente / Cancelado / Suspenso

REVISÃO / RECUSADA

R4

Situação cadastral ≠ Regular

REVISÃO HUMANA

R5

|matrícula − CAR| > 5% da matrícula

REVISÃO HUMANA

R6

Campo obrigatório ausente

REVISÃO HUMANA

Conflito: RECUSADA prevalece sobre REVISÃO HUMANA; todos os motivos são listados.

Execução via Docker (Contêiner)

Para rodar o servidor MCP encapsulado em contêiner com suporte a rede (Streamable HTTP na porta 8001/8000):

docker compose up -d --build

O endpoint MCP fica disponível em http://localhost:8001/mcp (e em produção via Cloudflare em https://mcp-triagem.anotae.app.br/mcp).
Um endpoint informativo de healthcheck responde em http://localhost:8001/.

Documentação

Available Tools

1 tool
triar_propostaA

Aplica as regras R1–R6 de forma determinística sobre uma proposta de crédito e retorna parecer (SEGUE | RECUSADA | REVISÃO HUMANA), motivos e resumo Markdown.

ParametersJSON Schema
NameRequiredDescriptionDefault
propostaYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full behavioral burden and does well: it discloses deterministic rule application (R1–R6) and enumerates the three decision outcomes. It does not describe side effects, auth needs, or input validation behavior, but for a computation-heavy triage tool the core behavior is clear.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single dense sentence that front-loads the verb and resource, then lists the outputs. Every element earns its place, and there is no redundancy or waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be detailed, yet the description supplies the decision enum anyway. The main gap is input specification: the single parameter is undocumented and the description does not explain what shape the credit proposal should take. With no annotations and 0% schema description coverage, this leaves an agent partially under-informed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and the single parameter 'proposta' has no schema-level explanation. The description mentions 'proposta de crédito', adding domain meaning, but does not clarify the expected structure (object vs. string) or required fields. It fails to compensate for the missing schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Aplica as regras R1–R6') and resource ('proposta de crédito') and clearly describes the output types (parecer, motivos, resumo Markdown). This is enough to distinguish it from any potential sibling, though none exist. The deterministic nature of the rule application is also explicitly stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for credit proposal triage by naming the domain ('proposta de crédito') and the rule set (R1–R6). However, it gives no explicit when-to-use, when-not-to-use, or alternative tools. The usage context is inferable but not directly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool updatev1.0.0
    • First observedtriar_proposta

TDQS

A4/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of confusion or overlap. The tool's purpose is clearly distinct and unambiguous.

Naming Consistency5/5

The single tool follows a clear verb_noun pattern in snake_case (triar_proposta), consistent within itself. No competing conventions exist.

Tool Count3/5

One tool is borderline thin for an MCP server, even though it matches the narrow scope of triaging a proposal. It could be seen as too focused with no additional operations.

Completeness5/5

The tool covers the entire triage process, applying deterministic rules R1–R6 and returning a verdict, reasons, and a Markdown summary. No obvious gaps exist for the stated purpose.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI-powered invoice analysis and reasoning: given invoice fields, it detects missing data, inconsistencies, duplicates, and proposes actions (register, request data, mark duplicate, review) using deterministic rules.
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables creditworthiness analysis for non-traditional borrowers using rule-based scoring, financial behavior assessment, and underwriting report generation via MCP tools.
    1
    -
  • F
    license
    A
    quality
    D
    maintenance
    Deterministic SNAP eligibility logic, exposed as auditable Model Context Protocol tools. An AI agent can read, reason, and orchestrate, but the eligibility determination itself is made by versioned, tested, cited code that a caseworker, an auditor, or a court can inspect.
    5
    -