Skip to main content
Glama

Spain Legal Research MCP Server (es-legal-mcp)

Español | English Documentation


Servidor MCP de Legislación y Jurisprudencia (es-legal-mcp) — Español

Acerca de este repositorio

Este repositorio proporciona un servidor Model Context Protocol (MCP) que conecta su asistente de IA (Claude Desktop, Cursor, Windsurf, VS Code / Copilot, Cline, Continue.dev o Antigravity) directamente con los portales legislativos oficiales y las bases de datos judiciales para Spain (primera instancia, tribunales superiores / apelación y tribunales supremos o constitucionales).

Instalación rápida (Selección de aplicación de IA)

  1. Descarga: Haga clic en <> Code -> Download ZIP y descomprima la carpeta en su equipo.

  2. Ejecución: Haga doble clic en Click_Here_To_Install_Windows.bat (Windows) o Click_Here_To_Install_Mac.command (macOS).

  3. Selección de cliente IA: Marque las aplicaciones de IA que utilice (Claude, Cursor, Windsurf, VS Code, Antigravity), pulse instalar y reinicie su aplicación de IA.

Nota de seguridad: El instalador opera en modo de solo lectura y no accede ni modifica sus archivos personales.

Jerarquía judicial y fuentes oficiales

Instancia judicial

Órganos jurisdiccionales cubiertos

Primera instancia

Juzgados de Primera Instancia e Instrucción, Juzgados de lo Mercantil, de lo Penal, de lo Social & de lo Contencioso-Administrativo

Segunda instancia (Apelación y Tribunales Superiores)

50 Audiencias Provinciales, 17 Tribunales Superiores de Justicia (TSJ of Autonomous Communities) & Audiencia Nacional (AN)

Tribunales Supremos y Constitucionales

Tribunal Supremo (TS) & Tribunal Constitucional de España (TC)


Related MCP server: Consulta Boletines Oficiales - Legislación consolidada

English Documentation

Model Context Protocol (MCP) server providing live, read-only access to Spain (ES) legislation, official gazettes, multi-tier judicial decisions (First Instance, Regional/Cantonal/Appellate, and Supreme/Constitutional courts, including HTML and PDF full-text extraction), and statutory citation verification across all major AI clients (ChatGPT Desktop, OpenAI Codex CLI, Claude Desktop, Claude Code CLI, Cursor, Windsurf, VS Code / GitHub Copilot / Cline / Roo Code, Google Antigravity / Gemini CLI, Perplexity, and Continue.dev).


Interactive Desktop Setup (Select Your AI Assistant)

This package includes a graphical installer for legal practitioners and non-technical users that lets you select which AI application(s) you use:

  1. Download: Click <> Code at the top right of this repository, select Download ZIP, and extract the folder to your computer.

  2. Run the Setup Utility:

    • Windows: Double-click Click_Here_To_Install_Windows.bat

    • macOS: Double-click Click_Here_To_Install_Mac.command

  3. Select Your AI Client(s) & Connect: Check the box(es) for the AI assistant(s) installed on your computer (ChatGPT Desktop & OpenAI Codex CLI, Claude Desktop & Claude Code CLI, Cursor, Windsurf, VS Code / GitHub Copilot / Cline / Roo Code, Google Antigravity / Gemini CLI, or Perplexity / Continue.dev), click Install to Selected AI Clients, and restart your selected AI application.

System Integrity Note: The setup utility operates strictly in read-only mode with respect to your personal files and documents. It installs an isolated Python runtime inside the extracted folder and registers the server entry only in the AI client configuration files you select.


Multi-Tier Judicial Hierarchy & Live Indexed National Archives

This server performs live queries across the full judicial hierarchy and official legal archives of Spain, extracting full text from both HTML pages and official court/gazette PDF judgments:

Judicial Tier

Covered Courts & Tribunals

Tier 1 — First Instance

Juzgados de Primera Instancia e Instrucción, Juzgados de lo Mercantil, de lo Penal, de lo Social & de lo Contencioso-Administrativo

Tier 2 — Regional / Cantonal / Appellate

50 Audiencias Provinciales, 17 Tribunales Superiores de Justicia (TSJ of Autonomous Communities) & Audiencia Nacional (AN)

Tier 3 — Supreme & Constitutional

Tribunal Supremo (TS) & Tribunal Constitucional de España (TC)

Official Portals & Live Indexed Domains

  • National Legislation & Official Gazette: BOE Datos Abiertos REST API (boe.es/datosabiertos) — https://www.boe.es

    • Indexed Legislation Domains: boe.es, congreso.es

  • Court Decisions & Jurisprudence Archives: CENDOJ (Centro de Documentación Judicial — TS, AN, 17 TSJ, 50 Audiencias Provinciales & Juzgados) — https://www.poderjudicial.es/search/indexAN.jsp

    • Indexed Judicial & Open Case Law Domains: poderjudicial.es, tribunalconstitucional.es, boe.es


Available MCP Tools

Tool

Description

search_legislation

Searches enacted statutes, codes, decrees, and official gazette publications in Spain.

search_case_law

Searches national jurisprudence and open judicial archives for Spain.

search_tiered_court_decisions

Filters case law specifically by judicial instance (first_instance, appellate_regional, supreme_constitutional) or specific regional/cantonal/district court.

list_court_hierarchy

Returns the complete 3-tier court structure and supported regional court filters for Spain.

get_legal_document_markdown

Retrieves full statutory or judicial texts (both HTML and official .pdf court judgments) and converts them into clean Markdown.

verify_citation

Validates statutory and case law citations against official registries.


{
  "mcpServers": {
    "es-legal-mcp": {
      "command": "uvx",
      "args": [
        "--from",
        "https://github.com/jurisatlas/es-legal-mcp/archive/refs/heads/main.zip",
        "es-legal-mcp"
      ]
    }
  }
}

Available Tools

6 tools
list_court_hierarchyList Court HierarchyA

Return the complete step-by-step multi-tier judicial hierarchy for Spain (ES): Tier 1 (First Instance / Trial / Municipal / District Courts), Tier 2 (Regional / Cantonal / County / Appellate Courts), Tier 3 (Supreme / Cassation / Constitutional Courts), and all official court sub-portals.

Inputs: no named parameters. Returns: object

search_case_lawSearch Case LawA

Search Spain (ES) court decisions and binding precedents via CENDOJ (Poder Judicial) & Tribunal Constitucional / ECLI Spain and open national judicial archives (Supported courts: Tribunal Supremo, Tribunal Constitucional, Audiencia Nacional, TSJ).

Inputs: query (required), court, limit. Returns: object

search_legislationSearch LegislationA

Search Spain (ES) national legislation (statutes, acts, codes, regulations, official gazette) via BOE Datos Abiertos REST API (boe.es/datosabiertos) and live national legal archives.

Inputs: query (required), year, limit. Returns: object

search_tiered_court_decisionsSearch Tiered Court DecisionsA

Search court decisions in Spain (ES) filtered by specific judicial tier or regional/cantonal/appellate court. Supports Tier 1 (first_instance), Tier 2 (appellate_regional — including Cantonal/Regional/County/Circuit courts), and Tier 3 (supreme_constitutional), or a specific sub-portal key from list_court_hierarchy.

Inputs: query (required), tier, limit, sub_court. Returns: object

verify_citationVerify CitationA

No-Hallucination Citation Verifier for Spain (ES). Validates format and live existence of legal citations (e.g., 'ECLI:ES:TS:2024:150 or BOE-A-2024-1234') against official Spain and ECLI/ELI registries to prevent AI-hallucinated citations.

Inputs: citation (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 6 tools

    Disambiguation4/5

    Each tool targets a distinct action+resource: verify a citation, search legislation, search case law, retrieve full text, list the hierarchy, and search by judicial tier. The main risk is overlap between search_case_law and search_tiered_court_decisions, but the tier-filter distinction in the descriptions makes the boundary workable.

    Naming Consistency5/5

    All six tools use a consistent snake_case verb_noun pattern (verify_citation, search_legislation, search_case_law, get_legal_document_markdown, list_court_hierarchy, search_tiered_court_decisions). No mixed conventions or camelCase deviations.

    Tool Count5/5

    Six tools is well within the ideal 3-15 range for a legal research server. Each tool covers a distinct capability (verify, search, retrieve, navigate hierarchy) with no filler.

    Completeness4/5

    The surface covers citation verification, legislation search, case law search, full-text retrieval, and court hierarchy navigation, forming a coherent research lifecycle. Minor gaps exist—no reverse citation graph or citator to see what cites a given document—but the core workflows are achievable.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      F
      maintenance
      Enables querying Spanish legislation (BOE) and EU law integration through MCP, providing full-text search, citation validation, and cross-referencing capabilities.
      56 npm
      2
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables read-only search and retrieval of Belgian legislation and multi-tier court decisions, filtering case law by judicial instance, converting legal texts to Markdown, and verifying statutory and case-law citations against official registries.
      6
      MIT