Legalis Ia

Created By
edsonsousa2 months ago
O Legalis MCP traz todo o fluxo de trabalho jurídico da sua area de trabalho. Advogados podem criar e gerenciar casos, gerar peças processuais profissionais seção por seção com IA, conduzir entrevistas guiadas de intake processual e monitorar o uso de cota — sem sair da conversa. Desenvolvido para o direito brasileiro. Funciona com Claude Desktop, Claude Code e qualquer cliente compatível com MCP. Autenticação via OAuth no browser — nenhuma senha armazenada em arquivos de configuração ---------- English Version ----------------- Legalis MCP brings your entire legal workflow into Claude. Attorneys can create and manage cases, generate professional legal documents (peças processuais) section by section using AI, run guided case intake interviews, and monitor AI quota usage — without ever leaving the conversation. Built for Brazilian law. Works with Claude Desktop, Claude Code, and any MCP-compatible client. Authentication via secure browser OAuth flow — no passwords stored in config files.
Overview

Legalis MCP Server

Assistente jurídico com IA para advogados brasileiros

Leia em Português

MCP (Model Context Protocol) server for Legalis — Brazilian legal document AI for attorneys.

Connect Claude (or any MCP-compatible client) to your Legalis account and interact with cases, generate legal documents, search legislation, and more using natural language.


Quick start

1. Install

pip install legalis-mcp
# or with uv:
uv tool install legalis-mcp

2. Authenticate

legalis-mcp auth

This opens your browser. Log in to Legalis normally — tokens are saved to ~/.legalis/credentials.json (owner-readable only).

3. Configure Claude

Add to your Claude configuration (~/.claude/claude_desktop_config.json for Claude Desktop, or claude_code_config.json for Claude Code):

{
  "mcpServers": {
    "legalis": {
      "command": "legalis-mcp",
      "args": ["serve"]
    }
  }
}

4. Use

In Claude, try:

  • "Liste meus casos no Legalis"
  • "Crie um caso de rescisão indireta para João Silva"
  • "Gere a seção de fundamentos jurídicos da peça X do caso Y"
  • "Pesquise legislação trabalhista sobre justa causa"
  • "Quantas gerações ainda tenho disponíveis este mês?"

Available tools

ToolDescription
list_casesList cases (paginated, filterable by status)
get_caseGet case details by ID
create_caseCreate a new case
update_caseUpdate case fields
search_casesFull-text search across cases
list_legal_documentsList peças processuais for a case
get_legal_documentGet a document with all sections
create_legal_documentCreate a new legal document
generate_sectionAI-generate a document section (fatos, fundamentos, pedidos…)
get_case_contextGet case context (facts, parties, evidence)
run_interviewAI-guided case intake interview
search_legislationSearch Brazilian legislation (LexML)
get_my_usageCheck AI quota and billing period usage

CLI commands

legalis-mcp auth      # Authenticate via browser
legalis-mcp serve     # Start MCP server (stdio)
legalis-mcp status    # Verify authentication
legalis-mcp logout    # Remove stored credentials

Development

git clone <repo>
cd mcp
pip install -e ".[test]"

# Run unit tests (no external services needed)
pytest tests/unit/ -v

# Run integration tests (requires Docker)
cd ../integration && docker-compose up -d
cd ../mcp
LEGALIS_API_URL=http://localhost:8000 \
LEGALIS_ACCESS_TOKEN=<token> \
LEGALIS_REFRESH_TOKEN=<refresh> \
pytest tests/integration/ -v

Environment variables

VariableDefaultDescription
LEGALIS_API_URLhttps://hai-production-612f.up.railway.appBackend URL
LEGALIS_ACCESS_TOKENPre-issued token (CI/test only)
LEGALIS_REFRESH_TOKENRefresh token (CI/test only)
LEGALIS_CREDENTIALS_FILE~/.legalis/credentials.jsonCredentials file path
LEGALIS_OAUTH_PORT3742Local OAuth callback port

Security

  • Credentials are stored in ~/.legalis/credentials.json with 600 permissions (owner read/write only).
  • The OAuth redirect is restricted to http://localhost — open-redirect attacks are blocked at the backend.
  • Tokens are never stored in the MCP configuration file.
  • All API calls go through the existing Legalis backend — RBAC, rate limiting, and quotas apply normally.

Publishing

# PyPI
pip install build twine
python -m build
twine upload dist/*

# Then register at:
# - smithery.ai (MCP marketplace)
# - mcp.so (community directory)
# - github.com/modelcontextprotocol/servers (official list)
Project Info
Created At
2 months ago
Updated At
2 months ago
Author Name
edsonsousa
Star
-
Language
-
License
-
Category

Recommend Servers

View All
Agentdevx Gateway

17 minutes ago
Tavily Mcp
@tavily-ai

JavaScript
a year ago
Gelbooru

15 hours ago