### Install dependencies Source: https://github.com/pdmtt/brlaw_mcp_server/blob/main/README.md Install project dependencies using uv. Ensure uv is installed or use Python's pip. ```bash uv run patchright install ``` -------------------------------- ### Install Dependencies with Patchright Source: https://context7.com/pdmtt/brlaw_mcp_server/llms.txt Clone the repository and install project dependencies, including browser automation tools, using the 'uv' package manager. ```bash git clone https://github.com/pdmtt/brlaw_mcp_server.git uv run patchright install ``` -------------------------------- ### Search STF Legal Precedents with Wildcard Source: https://context7.com/pdmtt/brlaw_mcp_server/llms.txt Example of searching for constitutional privacy rights using the StfLegalPrecedentsRequest tool. Supports wildcard characters in search queries. ```json { "name": "StfLegalPrecedentsRequest", "arguments": { "summary": "\"princípio da presunção de inocência\"", "page": 1 } } ``` -------------------------------- ### Search STF Legal Precedents with Fuzzy Match Source: https://context7.com/pdmtt/brlaw_mcp_server/llms.txt Example of fuzzy searching for case number variations using the StfLegalPrecedentsRequest tool. Supports single character wildcards. ```json { "name": "StfLegalPrecedentsRequest", "arguments": { "summary": "RE 56394?", "page": 1 } } ``` -------------------------------- ### Initialize MCP Client and List Tools Source: https://context7.com/pdmtt/brlaw_mcp_server/llms.txt Initializes the MCP client and lists available tools. Requires the 'mcp' library and asyncio. ```python import asyncio from pathlib import Path from mcp import ClientSession, StdioServerParameters from mcp.client.stdio import stdio_client async def search_brazilian_law(): server_params = StdioServerParameters( command="uv", args=[ "--directory", "/path/to/brlaw_mcp_server", "run", "serve", ], ) async with ( stdio_client(server_params) as (read, write), ClientSession(read_stream=read, write_stream=write) as client, ): await client.initialize() # List available tools tools = await client.list_tools() print(f"Available tools: {[t.name for t in tools.tools]}") # Search STJ for fraud execution precedents results = await client.call_tool( "StjLegalPrecedentsRequest", {"summary": "fraude execução", "page": 1} ) if not results.isError: for content in results.content: print(content.text) asyncio.run(search_brazilian_law()) ``` -------------------------------- ### Clone the repository Source: https://github.com/pdmtt/brlaw_mcp_server/blob/main/README.md Use this command to clone the project repository. ```bash git clone https://github.com/pdmtt/brlaw_mcp_server.git ``` -------------------------------- ### Configure MCP client Source: https://github.com/pdmtt/brlaw_mcp_server/blob/main/README.md Configure your MCP client, such as Claude Desktop, to connect to the brlaw_mcp_server. Specify the command and arguments to run the server. ```json { "mcpServers": { "brlaw_mcp_server": { "command": "uv", "args": [ "--directory", "//brlaw_mcp_server", "run", "serve" ] } } } ``` -------------------------------- ### Direct Domain Model Usage for Precedent Research Source: https://context7.com/pdmtt/brlaw_mcp_server/llms.txt Demonstrates direct usage of domain models for researching precedents across different Brazilian courts (STJ, TST, STF). Requires browser automation utilities. ```python import asyncio from brlaw_mcp_server.domain.stj import StjLegalPrecedent from brlaw_mcp_server.domain.tst import TstLegalPrecedent from brlaw_mcp_server.domain.stf import StfLegalPrecedent from brlaw_mcp_server.utils import browser_factory async def research_precedents(): async with browser_factory(headless=True) as browser: page = await browser.new_page() # Search STJ precedents stj_results = await StjLegalPrecedent.research( page, summary_search_prompt="fraude execução", desired_page=1 ) for precedent in stj_results: print(f"STJ: {precedent.summary[:200]}...") # Search TST labor precedents tst_results = await TstLegalPrecedent.research( page, summary_search_prompt="adicional de periculosidade", desired_page=1 ) # Search STF constitutional precedents stf_results = await StfLegalPrecedent.research( page, summary_search_prompt="direito privacidade", desired_page=1 ) asyncio.run(research_precedents()) ``` -------------------------------- ### Configure MCP Server in Client Application Source: https://context7.com/pdmtt/brlaw_mcp_server/llms.txt Configure the MCP server in your client application by specifying the server command and its directory path. ```json { "mcpServers": { "brlaw_mcp_server": { "command": "uv", "args": [ "--directory", "/path/to/brlaw_mcp_server", "run", "serve" ] } } } ``` -------------------------------- ### STF Legal Precedents Search Parameters Source: https://context7.com/pdmtt/brlaw_mcp_server/llms.txt Employ the StfLegalPrecedentsRequest tool to query the Supremo Tribunal Federal (STF) database. Supports Boolean operators, exact phrase matching, proximity, and fuzzy matching. ```python # MCP tool call parameters for STF search { "name": "StfLegalPrecedentsRequest", "arguments": { "summary": "direito E (privacidade OU intimidade)", "page": 1 } } ``` -------------------------------- ### TST Legal Precedents Search Parameters Source: https://context7.com/pdmtt/brlaw_mcp_server/llms.txt Utilize the TstLegalPrecedentsRequest tool for searching the Tribunal Superior do Trabalho (TST) database. Supports exact phrase matching using quotes. ```python # MCP tool call parameters for TST search { "name": "TstLegalPrecedentsRequest", "arguments": { "summary": "trabalho temporário jornada \"adicional de periculosidade\"", "page": 1 } } ``` ```python # Example: Search for labor law precedents about temporary work and hazard pay { "name": "TstLegalPrecedentsRequest", "arguments": { "summary": "\"vínculo empregatício\" terceirização", "page": 2 } } ``` ```python # Response format (JSON array of precedents): [ { "summary": "AGRAVO. RECURSO DE REVISTA. TRABALHO TEMPORÁRIO..." } ] ``` -------------------------------- ### STJ Legal Precedents Search Parameters Source: https://context7.com/pdmtt/brlaw_mcp_server/llms.txt Use the StjLegalPrecedentsRequest tool to search the Superior Tribunal de Justiça (STJ) database. Supports basic and complex search queries with Boolean, proximity, and wildcard operators. ```python # MCP tool call parameters for STJ search { "name": "StjLegalPrecedentsRequest", "arguments": { "summary": "supermercado e furto e veículo", "page": 1 } } ``` ```python # Example: Complex search with multiple operators { "name": "StjLegalPrecedentsRequest", "arguments": { "summary": "((menor ou criança) e infrator) com pena", "page": 1 } } ``` ```python # Response format (JSON array of precedents): [ { "summary": "TRIBUTÁRIO E PROCESSUAL CIVIL. RECURSO ESPECIAL..." } ] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.