home / mcp / portuguese law mcp server

Portuguese Law MCP Server

Provides access to core Portuguese legislation and EU cross-references with query, search, and validation capabilities.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ansvar-systems-portuguese-law-mcp": {
      "command": "portuguese-law-mcp",
      "args": []
    }
  }
}

You can access and query Portuguese legislation through a dedicated MCP server that consolidates core statutes, regulatory acts, and EU cross-references. It provides convenient retrieval of articles, full-text searches, cross-references, and currency checks, all sourced from official Diário da República Eletrónico and related regulatory authorities. This MCP server is designed for researchers, lawyers, and developers who need reliable, up-to-date legal data and tools for cross-referencing and citation validation.

How to use

Connect to the MCP server using a local stdio-based client or integration that supports the MCP protocol. You can run the server directly on your machine or integrate it into your development environment to perform common legal queries and checks.

Typical workflows include retrieving a specific article, performing a full-text search across the legislation, cross-referencing EU directives, validating citations against Diário da Republica references, and confirming whether a law or provision is the current consolidated version.

Two recommended startup options are provided below. Use the one that best fits your environment. If you are using the bundled free deployment, the server can be started directly with the single command shown in the first example.

portuguese-law-mcp

How to install

Prerequisites: ensure you have Node.js and npm installed on your system. These tools are required to install and run the MCP server.

Install the MCP server globally using npm.

npm install -g @ansvar/portuguese-law-mcp

Additional content and notes

The MCP server includes a dual deployment strategy where the free bundled database covers core legislation and can run on a variety of platforms. For extended coverage, including CNPD deliberations and historical versions, you can deploy locally with Docker or on Azure Container Apps.

To run the server locally after installation, execute the command shown here.

portuguese-law-mcp

Configuration and usage notes

The MCP server exposes a set of practical tools to interact with the legal data. You can retrieve articles, search legislation, cross-reference EU directives, validate citations, verify currency of statutes, and list all laws with metadata. The server uses authoritative data sources and provides access to the Diário da Republica references.

Tools you can use with the MCP server

- get_provision: Retrieve a specific article from Portuguese law.

Available tools and commands from the source

- get_provision: Retrieve a specific article (Artigo) from a Portuguese law.

Advanced configuration for client integration

If you are configuring a client such as Claude Desktop or another MCP client, you can also run the server via a local npx invocation as shown below.

Notes on security and data provenance

Data comes from official sources like the Diário da Republica Eletrónico (dre.pt) and CNPD for data protection related content. The geopolitical and regulatory data is maintained to support accurate, up-to-date legal workflows.

Development and testing

If you are contributing or validating the MCP server, you can run unit and contract tests, build the database from sources, and start the server to verify end-to-end behavior.

Available tools

get_provision

Retrieve a specific article from a Portuguese law using its article number and law reference.

search_legislation

Perform a full-text search across all Portuguese legislation to find relevant provisions.

get_provision_eu_basis

Cross-reference lookup for EU directive and regulation relationships (GDPR, NIS, eCommerce, EECC).

validate_citation

Validate a legal citation against the Diário da Republica database to ensure accuracy.

check_statute_currency

Check whether a law or provision is the current consolidated version.

list_laws

List all laws in the database with metadata for quick reference.