Skip to main content

MCP server — programmatic access to the Mozambican law library (Mozaia)

Project description

mozaia-laws-mcp

MCP server for the Mozambican law library — give any AI agent real-time access to Mozambican legislation: current text, historical versions, validity status, and citation resolution.

Built on the Mozaia legal intelligence platform. Covers 42 legal domains, 225+ instruments from the Boletim da República, with authoritative citators and temporal versioning.


Quick start

# Install
pip install mozaia-laws-mcp

# Or run without installing (requires uvx)
uvx mozaia-laws-mcp

Get an API key at mozaia.mz/developers (free tier available).


Installation

pip / uv

pip install mozaia-laws-mcp
uv add mozaia-laws-mcp

Claude Desktop

Add to claude_desktop_config.json (~/Library/Application Support/Claude/ on macOS, %APPDATA%\Claude\ on Windows):

{
  "mcpServers": {
    "mozaia-laws": {
      "command": "mozaia-laws-mcp",
      "env": {
        "MOZAIA_API_KEY": "sk-mozaia-your-key-here",
        "MOZAIA_BASE_URL": "https://api.mozaia.mz"
      }
    }
  }
}

Cursor / VS Code (Copilot)

{
  "mcp": {
    "servers": {
      "mozaia-laws": {
        "command": "mozaia-laws-mcp",
        "env": {
          "MOZAIA_API_KEY": "sk-mozaia-your-key-here"
        }
      }
    }
  }
}

uvx (no install)

{
  "mcpServers": {
    "mozaia-laws": {
      "command": "uvx",
      "args": ["mozaia-laws-mcp"],
      "env": {
        "MOZAIA_API_KEY": "sk-mozaia-your-key-here"
      }
    }
  }
}

Configuration

Variable Required Default Description
MOZAIA_API_KEY Yes API key (sk-mozaia-<hex>). Get one at mozaia.mz/developers
MOZAIA_BASE_URL No https://api.mozaia.mz Override for on-premise or staging
MOZAIA_TIMEOUT No 30 HTTP timeout in seconds

Tools

search_laws — find a diploma by name or topic

Use this first when you know a law by name or subject but not its law_id.

Inputs:

Field Type Required Description
q string No Free text: title, number (3/2022), or partial law_id
domain string No Canonical legal domain, e.g. labour_law, tax_law, family_law
instrument_type string No lei, decreto, codigo, regulamento
year integer No Publication year, e.g. 2022
page integer No Page number (default: 1)
page_size integer No Results per page, max 50 (default: 20)

Example:

search_laws(q="trabalho", domain="labour_law", year=2023)

Returns: paginated list with law_id, title, type, status, legal domain, and quota balance.


get_law_status — check if a diploma is in force

Inputs:

Field Type Required Description
law_id string Yes Canonical identifier, e.g. lei_trabalho_2023, constituicao_2004

Example:

get_law_status(law_id="lei_trabalho_2023")

Returns: validity status (active / revoked / superseded), revoked_by_law_id when applicable, full citator badge, and publication metadata.


get_article — current text of an article

Inputs:

Field Type Required Description
law_id string Yes Diploma identifier
article_number string Yes Article number, e.g. "15", "70", "102"

Example:

get_article(law_id="lei_trabalho_2023", article_number="70")

Returns: full article text, amendment/revocation status, and citator with Boletim da República reference.


get_article_at_date — historical version of an article

Retrieves the exact text that was in force on a given past date. Essential for retroactivity analysis, past-fact disputes, and temporal conflicts between norms.

Inputs:

Field Type Required Description
law_id string Yes Diploma identifier
article_number string Yes Article number
as_of string Yes ISO 8601 date, e.g. "2021-03-15"

Example:

get_article_at_date(law_id="codigo_civil_1966", article_number="217", as_of="2019-06-01")

Returns: article text at the requested date, version number, validity range, is_current flag, and temporal_alert if the norm changed shortly before or after.


cite — resolve a Portuguese legal citation

Parses a free-text Portuguese citation and resolves it to a structured law_id + article record.

Inputs:

Field Type Required Description
citation string Yes Citation string in Portuguese

Accepted formats:

  • "Lei n.º 3/2022, artigo 15.º"
  • "Decreto-Lei n.º 1/2020"
  • "Constituição da República, artigo 70.º"
  • "art. 102 do Código Civil"

Example:

cite(citation="Lei n.º 3/2022, artigo 15.º")

Returns: parsed_law_number, parsed_article_number, resolved_law, resolved_article, confidence score (0–1), and unresolved_reason when the diploma is not in the database.


Typical agent workflow

1. cite("Lei n.º 23/2007, artigo 128.º")
   → law_id: "lei_trabalho_2007", article: "128", confidence: 0.97

2. get_law_status(law_id="lei_trabalho_2007")
   → status: "revoked", revoked_by: "lei_trabalho_2023"

3. get_article(law_id="lei_trabalho_2023", article_number="128")
   → current text + citator

4. (if analysing a past case)
   get_article_at_date(law_id="lei_trabalho_2007", article_number="128", as_of="2018-01-01")
   → text that was in force in 2018

Error handling

HTTP MCP response
401 "Erro: API key inválida ou expirada."
402 "Erro: Quota mensal esgotada. Contactar suporte."
404 {"error": "not_found", "detail": "..."}
422 {"error": "invalid_input", "detail": "..."}
timeout "Timeout ao contactar a API Mozaia. Tente novamente."

Pricing

Tier Credits/month Price Best for
Community 1 000 Free Evaluation, personal projects
Institutional 10 000 Legal firms, NGOs, universities
Commercial 50 000 SaaS products, fintechs
Strategic 500 000 Platforms, enterprise integrations

1 credit = 1 API call. Credits reset on the 1st of each month. Get a key and upgrade at mozaia.mz/developers.


Legal domains supported

labour_law · tax_law · family_law · commercial_law · criminal_law · civil_law · administrative_law · constitutional_law · environmental_law · land_law · mining_law · consumer_law · and 30 more.

Full list: search_laws(domain=<domain>) returns an empty list with a 422 if the domain is invalid.


Requirements

  • Python 3.11+
  • Network access to api.mozaia.mz (or your configured MOZAIA_BASE_URL)
  • A valid MOZAIA_API_KEY

License

MIT — see LICENSE.

Data provided through this MCP server is subject to the Mozaia Terms of Service.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mozaia_laws_mcp-0.1.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mozaia_laws_mcp-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file mozaia_laws_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: mozaia_laws_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.14.5 Windows/11

File hashes

Hashes for mozaia_laws_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 25f0267d3c91ac69705ee7fb950e3de0f05597d13e25dd112a5af04271eddc79
MD5 8584b43e1eb8f1b8b7df5245f11fb3e9
BLAKE2b-256 97a2a4b9f9cb33b953d63ed2160a6d693353a6340763b4a26591134f408db11e

See more details on using hashes here.

File details

Details for the file mozaia_laws_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mozaia_laws_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.14.5 Windows/11

File hashes

Hashes for mozaia_laws_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc8ed8c7dd924bbbe3d9514c05a1c64baffa5d85cbbef1c639a2036d578ac67c
MD5 4697cd88fe67c82037b40ad0781dad66
BLAKE2b-256 7b67133c3e633ff185edcfc49049957d5566e8941f1d310bb9aa4419b355e3cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page