home / mcp / pje mcp server

PJE MCP Server

Provides integration with the PJE system, supports A1/A3 certificates, and enables process management and advanced searches.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "chapirousia-pje-mcp-server": {
      "command": "node",
      "args": [
        "C:\\caminho\\para\\pje-mcp-server\\build\\index.js"
      ],
      "env": {
        "PJE_APP_NAME": "pje-tjce-1g",
        "PJE_BASE_URL": "https://pje.tjce.jus.br",
        "PJE_CERTIFICATE_PFX_PATH": "C:\\certificado.pfx",
        "PJE_CERTIFICATE_PFX_PASSWORD": "senha123"
      }
    }
  }
}

You run a dedicated MCP (Model Context Protocol) server to connect the PJE system with full support for digital certificates, process management, and judicial data. This server enables you to access the PJE API, manage certificates, filter and search processes, and integrate with Claude Desktop for AI-driven interactions.

How to use

After you configure the MCP server, start it and use your MCP client to perform common actions. You can configure the connection to your tribunal, supply your digital certificate, and then perform tasks such as listing processes, searching by process number, listing judicial bodies, classes, and subjects. You can also ask Claude Desktop to run natural language queries like listing your processes, searching a specific process, or showing scheduled hearings.

How to install

Prerequisites: you need Node.js installed on your system. It is recommended to use a recent LTS version of Node.js. You also need a shell or terminal to run commands.

# Clone the MCP server repository
git clone https://github.com/seu-usuario/pje-mcp-server.git

# Move into the project directory
cd pje-mcp-server

# Install dependencies
npm install

# Create a local environment configuration
cp .env.example .env

# Edit the .env file to match your tribunal and certificate setup
# For example:
# PJE_BASE_URL=https://pje.tjce.jus.br
# PJE_APP_NAME=pje-tjce-1g

# Build the TypeScript project
npm run build

# Start the MCP server
npm run start

Configuration and usage notes

Basic configuration options are provided via a local environment file and are essential for connecting to your tribunal and handling certificates. The following variables are supported in the basic setup: PJE_BASE_URL, PJE_APP_NAME, and certificate-related settings.

# URL of your tribunal
PJE_BASE_URL=https://pje.tjce.jus.br
PJE_APP_NAME=pje-tjce-1g

# Certificate options (choose one)
# Option 1: PFX file
PJE_CERTIFICATE_PFX_PATH=C:\certificado.pfx
PJE_CERTIFICATE_PFX_PASSWORD=senha123

# Option 2: Windows Store (thumbprint)
PJE_CERTIFICATE_THUMBPRINT=abc123...

Security and certificates

The server supports both A1 (file-based) and A3 (token/smartcard) digital certificates. Use the PFX path and password for A1, or the certificate thumbprint for A3. Ensure your certificate issuer is one of the recognized providers and that the certificate is valid for your tribunal access.

Troubleshooting tips

If you encounter certificate not found errors, list available certificates on your system and copy the correct thumbprint to your .env file. If commands are not recognized, restart Claude Desktop and verify the MCP command configuration in Claude. For authentication failures, verify certificate validity and tribunal URL, and try with an alternative certificate if possible.

Additional commands and capabilities

You can configure the MCP connection, certificate, and status through the provided command set. Use the following commands to manage settings and perform queries.

MCP server configuration (example)

{
  "mcpServers": {
    "pje": {
      "type": "stdio",
      "command": "npm",
      "args": ["run", "start"]
    }
  },
  "envVars": [
    {"name": "PJE_BASE_URL", "description": "URL of your tribunal", "example": "https://pje.tjce.jus.br"},
    {"name": "PJE_APP_NAME", "description": "Application name for the tribunal integration", "example": "pje-tjce-1g"}
  ]
}

Notes on installation flow

The final start command is the runtime command you will use to run the MCP server locally. In this setup, you start the server with npm run start, which launches the compiled server from the build output.

Available tools

pje_configurar

Configures the connection to the PJE tribunal

pje_configurar_certificado

Configures the digital certificate used for authentication

pje_listar_processos

Lists processes with optional filters

pje_buscar_processo

Searches for a process by its number

pje_listar_orgaos_julgadores

Lists judging bodies

pje_listar_classes

Lists process classes

pje_listar_assuntos

Lists available subjects