mcpField
L
Legalis Ia

Legalis Ia

Local
github.com/edsonsousaLegal & Government1Updated 29w ago

About Legalis Ia

Legalis Ia is an MCP server for Brazilian attorneys to manage cases and legal documents through natural-language clients. It also supports section-by-section AI drafting, guided intake, legislation search, and usage checks.

Key features

  1. 01Create, search, update, and manage cases
  2. 02Generate and edit document sections
  3. 03Export legal documents as DOCX
  4. 04Manage case tasks and events
  5. 05Search Brazilian legislation
  6. 06Run guided intake and check AI usage

Use cases

  1. 01Organize cases and track related tasks
  2. 02Draft a legal filing section by section
  3. 03Find legislation relevant to a case
  4. 04Conduct case intake and check remaining quota

MCP support

The server exposes Legalis case, document, task, event, template, legislation, and usage operations as MCP tools. It can connect to Claude or other MCP-compatible clients.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

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

Cases
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
delete_caseDelete a case permanently
Legal documents
ToolDescription
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…)
update_section_textManually edit a document section
get_case_contextGet case context (facts, parties, evidence)
update_case_contextUpdate case context
delete_legal_documentDelete a legal document
export_legal_document_docxExport a document as DOCX
Events & Tasks
ToolDescription
create_case_eventCreate an event on a case (internal or client-visible)
list_case_eventsList events for a case
delete_case_eventDelete a case event
create_case_taskCreate a task with due date and priority
list_case_tasksList tasks for a case
update_case_taskUpdate a task's fields
complete_case_taskMark a task as complete
delete_case_taskDelete a task
list_upcoming_tasksList upcoming tasks across all cases
list_overdue_tasksList all overdue tasks
Other
ToolDescription
run_interviewAI-guided case intake interview
list_templatesList available document templates
get_templateGet template details and sections
search_legislationSearch Brazilian legislation (LexML)
get_my_usageCheck AI quota and billing period usage

API coverage

The table below maps every Legalis backend endpoint to its MCP tool (when available).

Cases
EndpointMethodMCP Tool
/api/casesGETlist_cases ✅
/api/casesPOSTcreate_case ✅
/api/cases/{id}GETget_case ✅
/api/cases/{id}PUTupdate_case ✅
/api/cases/{id}DELETEdelete_case ✅
/api/cases/searchGETsearch_cases ✅
/api/cases/{id}/overviewGET—
/api/cases/{id}/portal-tokenPOST / DELETE—
Legal documents
EndpointMethodMCP Tool
/api/cases/{id}/legal-documentsGETlist_legal_documents ✅
/api/cases/{id}/legal-documentsPOSTcreate_legal_document ✅
/api/cases/{id}/legal-documents/{doc}GETget_legal_document ✅
/api/cases/{id}/legal-documents/{doc}DELETEdelete_legal_document ✅
/api/cases/{id}/legal-documents/{doc}/sections/{key}/generatePOSTgenerate_section ✅
/api/cases/{id}/legal-documents/{doc}/sections/{key}/textPUTupdate_section_text ✅
/api/cases/{id}/legal-documents/{doc}/export/docxGETexport_legal_document_docx ✅
Case context
EndpointMethodMCP Tool
/api/cases/{id}/contextGETget_case_context ✅
/api/cases/{id}/contextPUTupdate_case_context ✅
/api/cases/{id}/context/historyGET—
Tasks
EndpointMethodMCP Tool
/api/cases/{id}/tasksGETlist_case_tasks ✅
/api/cases/{id}/tasksPOSTcreate_case_task ✅
/api/cases/{id}/tasks/{task}PUTupdate_case_task ✅
/api/cases/{id}/tasks/{task}DELETEdelete_case_task ✅
/api/cases/{id}/tasks/{task}/completePOSTcomplete_case_task ✅
/api/tasks/upcomingGETlist_upcoming_tasks ✅
/api/tasks/overdueGETlist_overdue_tasks ✅
Events
EndpointMethodMCP Tool
/api/cases/{id}/eventsGETlist_case_events ✅
/api/cases/{id}/eventsPOSTcreate_case_event ✅
/api/cases/{id}/events/{event}DELETEdelete_case_event ✅
Templates & Legislation
EndpointMethodMCP Tool
/api/templatesGETlist_templates ✅
/api/templates/{id}GETget_template ✅
/api/legislacaoGETsearch_legislation ✅
Usage
EndpointMethodMCP Tool
/api/plans/my-usageGETget_my_usage ✅
Not yet covered
EndpointNotes
/api/cases/{id}/overviewBFF endpoint — case + tasks + events in one call
/api/cases/{id}/portal-tokenShare case status with clients via public link
/api/cases/{id}/context/historyContext version history
/api/users/meUser profile read/update
/api/users/settingsNotification and UI preferences
/api/users/documentsUploaded documents (non-generated)
/api/voice-agent/*Voice assistant (plan-gated feature)
/api/corporates/{id}/usersTeam member management
/api/subordinates/inviteInvite 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 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_TOKEN—Pre-issued token (CI/test only)
LEGALIS_REFRESH_TOKEN—Refresh 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)

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.