Legalis MCP Server
Click on "Deploy 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., "@Legalis MCP ServerCrie um caso de rescisão indireta para João Silva"
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.
Legalis MCP Server
Assistente jurídico com IA para advogados brasileiros
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-mcp2. Authenticate
legalis-mcp authThis 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?"
Related MCP server: Argentina Legal Law MCP Server
Available tools
Cases
Tool | Description |
| List cases (paginated, filterable by status) |
| Get case details by ID |
| Create a new case |
| Update case fields |
| Full-text search across cases |
| Delete a case permanently |
Legal documents
Tool | Description |
| List peças processuais for a case |
| Get a document with all sections |
| Create a new legal document |
| AI-generate a document section (fatos, fundamentos, pedidos…) |
| Manually edit a document section |
| Get case context (facts, parties, evidence) |
| Update case context |
| Delete a legal document |
| Export a document as DOCX |
Events & Tasks
Tool | Description |
| Create an event on a case (internal or client-visible) |
| List events for a case |
| Delete a case event |
| Create a task with due date and priority |
| List tasks for a case |
| Update a task's fields |
| Mark a task as complete |
| Delete a task |
| List upcoming tasks across all cases |
| List all overdue tasks |
Other
Tool | Description |
| AI-guided case intake interview |
| List available document templates |
| Get template details and sections |
| Search Brazilian legislation (LexML) |
| Check AI quota and billing period usage |
API coverage
The table below maps every Legalis backend endpoint to its MCP tool (when available).
Cases
Endpoint | Method | MCP Tool |
| GET |
|
| POST |
|
| GET |
|
| PUT |
|
| DELETE |
|
| GET |
|
| GET | — |
| POST / DELETE | — |
Legal documents
Endpoint | Method | MCP Tool |
| GET |
|
| POST |
|
| GET |
|
| DELETE |
|
| POST |
|
| PUT |
|
| GET |
|
Case context
Endpoint | Method | MCP Tool |
| GET |
|
| PUT |
|
| GET | — |
Tasks
Endpoint | Method | MCP Tool |
| GET |
|
| POST |
|
| PUT |
|
| DELETE |
|
| POST |
|
| GET |
|
| GET |
|
Events
Endpoint | Method | MCP Tool |
| GET |
|
| POST |
|
| DELETE |
|
Templates & Legislation
Endpoint | Method | MCP Tool |
| GET |
|
| GET |
|
| GET |
|
Usage
Endpoint | Method | MCP Tool |
| GET |
|
Not yet covered
Endpoint | Notes |
| BFF endpoint — case + tasks + events in one call |
| Share case status with clients via public link |
| Context version history |
| User profile read/update |
| Notification and UI preferences |
| Uploaded documents (non-generated) |
| Voice assistant (plan-gated feature) |
| Team member management |
| Invite team members |
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 credentialsDevelopment
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/ -vEnvironment variables
Variable | Default | Description |
|
| Backend URL |
| — | Pre-issued token (CI/test only) |
| — | Refresh token (CI/test only) |
|
| Credentials file path |
|
| Local OAuth callback port |
Security
Credentials are stored in
~/.legalis/credentials.jsonwith600permissions (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)This server cannot be deployed
Maintenance
Related MCP Connectors
Brazilian legal stack in one MCP: lawsuits, court publications, case law, tenders, certificates.
Connect AI to millions of laws and court cases with the Lawstronaut MCP.
Law firm management MCP: manage cases, clients, tasks, calendar and documents via Claude AI.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceLegal Document AI - MCP server providing AI-powered tools and automation by MEOK AI Labs7 npm43 PyPIMIT
- AlicenseNot gradedqualityDmaintenanceA specialized MCP server for Argentine legal professionals, enabling legal research, document processing, case analysis, and practice management through integration with official Argentine legal databases.8MIT
- FlicenseNot gradedqualityDmaintenanceMCP server for integrating with the Brazilian PJE judicial system via MNI and BNP, enabling consultation of legal processes, communications, and precedents.-
- AlicenseAqualityCmaintenanceLegalMCP is a comprehensive US legal MCP server that enables AI assistants to search over 4 million US court opinions, manage Clio practice data, and access PACER federal filings through natural language.1867MIT