Skip to main content
Glama
anamtb

BOE & EUR-Lex MCP Server

by anamtb

TypeScript MCP NPM


🚨 La Crisis de Identidad (¿Por qué existe esto?)

Seamos brutalmente honestos: los LLMs son unos artistas a la hora de alucinar leyes. Se inventan artículos del Código Penal con la misma soltura con la que un político improvisa una promesa electoral. Suenan convincentes, tienen buena gramática y no existen.

El BOE & EUR-Lex MCP Server es el suero de la verdad que tu agente necesita. Conecta directamente a Gemini, Claude, Cursor y compañía con el Boletín Oficial del Estado y EUR-Lex (Unión Europea), las únicas fuentes que importan cuando la cosa se pone seria.

V1.2.0 "Bestia Legal" 🏛️�: Evolución proactiva. Incorpora Búsqueda Relajada (OR/Wildcard), Detector de Referencia Cruzadas automático y Análisis de Relaciones jurídicas. La IA ahora no solo lee, sino que investiga conexiones.


Related MCP server: eurlex-mcp-server

🎯 El Arte de la Query: Cómo preguntar para no fallar

No es solo qué buscas, sino cómo lo pides. Aquí tienes el manual de estilo para que tu IA sea un ninja legal:

1. 🏛️ Extracción Quirúrgica (Leyes y Artículos)

Para leyes consolidadas, sé específico con el número o el ID.

  • Template: "Usa el MCP para buscar la [Ley 28/2022] y dime qué dice el [Artículo 15] sobre [nómadas digitales]."

  • Análisis Avanzado: "Usa el artículo 1 de la [Ley Orgánica 1/2024] y dime si menciona algo sobre la '[normalización institucional]'."

2. 📋 El Modo Detective (Anuncios y Licitaciones)

Los anuncios suelen estar solo en PDF. Para que la IA "despierte" al servidor, dale contexto:

  • Template: "Busca el anuncio de la [AEAT] sobre [achatarramiento de barcos] que se publicó en el BOE el 19 de febrero de 2026 y léelo entero (article: 'todo')."

  • Resultado: Localiza el ID, descarga el PDF y extrae los datos (como los 654.000,00€ que encontramos en nuestras pruebas).

3. 📡 Vigilancia Diaria (Sumarios)

No le pidas "un resumen del BOE". Pídele que busque dentro del sumario:

  • Template: "Mira el sumario de hoy (boe_get_daily_summary). Busca si hay algún [nombramiento de Director General] y, si lo hay, dame su nombre."

4. 🇪🇺 Búsqueda Internacional (EUR-Lex)

[WARNING] Acceso Restringido: Actualmente el portal EUR-Lex ha incrementado su protección anti-bots (AWS WAF), lo que puede causar fallos (Status 202) en búsquedas automatizadas. Esta funcionalidad se mantiene como Experimental.

[IMPORTANT] La Regla de Oro: Cuando busques algo que no es una ley (anuncios, multas, nombramientos), añade siempre a tu instrucción: "Lee el texto íntegro usando article: 'todo'".

5. 🔬 Casos de Éxito: La Bestia en Acción

  • Caso SMI 2024: Buscamos "cuantia salario minimo profesional 2024".

    • Acción de la Bestia: El motor detectó 0 resultados exactos, activó el Relaxed Search, descompuso la frase y encontró el RD 142/2024.

    • Análisis: Automáticamente detectó que el Art. 1 mencionaba el BOE-A-2015-11430 (Estatuto Trabajadores) y ofreció el link para seguir investigando.

Este servidor no es un simple script de scraping. Es un motor de inteligencia legal con fallbacks recursivos y análisis proactivo:

  1. 🏛️ Capa Legislada (API Consolidada): El carril rápido. Buscamos en la base de datos oficial de legislación consolidada. Velocidad máxima, datos estructurados. Perfecta para leyes vigentes (Código Civil, Ley de Startups, etc.).

  2. 📋 Capa Diaria (XML Nativo): Cuando el documento es reciente o no es una ley (un anuncio de ayer, un nombramiento de esta mañana), saltamos al xml.php oficial del boletín del día. Sin intermediarios.

  3. 🦅 Capa de Rescate (Heurística de PDF): Aquí ocurre la magia real. Si el XML viene más vacío que las promesas electorales, el servidor:

    • 📐 Calcula la ruta exacta del PDF oficial usando algoritmos de fecha e ID.

    • 📥 Descarga el documento en memoria.

    • 📖 Extrae el texto bruto usando pdf-parse.

    • 🍽️ Se lo sirve a la IA en bandeja de plata.

  4. 🧠 Capa de Análisis (Novedad v1.2.0): Detecta automáticamente IDs del BOE y nombres de leyes citadas en el texto para que la IA pueda "navegar" la red legal.

  5. 🌐 Capa de Investigación Externa (Pro Plus v1.3.0): Detecta URLs externas y ofrece la herramienta boe_follow_link para que el agente pueda salir del BOE y leer pliegos, bases en webs regionales o detalles técnicos en otros portales gubernamentales.


🗺️ El Diccionario de los IDs (El mapa de la jungla)

El BOE no es un libro, es una jungla organizada en secciones. Memoriza los prefijos y nunca te perderás:

  • BOE-A-YYYY-NNNN: Leyes, Reales Decretos y Nombramientos. (Ej: BOE-A-2024-11776).

  • BOE-B-YYYY-NNNN: Anuncios, Licitaciones y Subastas. (Ej: BOE-B-2024-4144).

  • BOE-S-YYYY-NNNN: Otras Notificaciones. (Multas, citaciones, etc.).


🎯 Estrategia de Búsqueda: Radar vs. Brújula

Esta sección te puede salvar de pensar que el sistema "no funciona". La clave está en elegir la herramienta correcta:

1. 🧭 La Brújula (boe_search) — Para LEYES

Úsala cuando sabes el nombre de la norma o quieres encontrar legislación consolidada.

  • Busca la Ley de Propiedad Horizontal y dame el Artículo 9.

  • ❌ NO la uses para buscar multas individuales o anuncios del día.

2. 📡 El Radar (boe_get_daily_summary) — Para ANUNCIOS DEL DÍA

Úsala para descubrir qué se ha publicado hoy o en una fecha concreta (multas, licitaciones, nombramientos).

  • Mira el sumario del BOE del 19 de febrero y sácame los IDs de los anuncios de la AEAT.

  • Una vez tienes el ID, usa la siguiente herramienta. El Radar te descubre la presa; otra herramienta la abate.

3. 👁️ El Ojo de Sauron (boe_get_article) — Para LEER TODO

El núcleo del sistema. Una vez tienes el ID (de la Brújula, del Radar, o porque ya lo sabes), esta herramienta te devuelve el texto completo, lo que implique XML o PDF.

  • Lee el anuncio BOE-B-2024-4144 con article: "todo".


💡 Guía de Supervivencia para Queries

Para que tu IA no se pierda, ayúdala a ser un mejor abogado:

❌ Malas Queries (Así no)

  • "Busca la ley de educación." — Hay 50. Gemini se agobiará y tú también.

  • "Dime qué dice el BOE hoy." — Como pedirle el Quijote resumido en 10 segundos.

  • "Busca una multa a mi nombre." — El search no busca multas individuales, busca leyes.

✅ Buenas Queries (Nivel Senior)

  • 🏛️ Para Leyes: "Usa el MCP para buscar la Ley 28/2022 y dime qué dice el Artículo 15 sobre nómadas digitales."

  • 📋 Para Anuncios con ID: "Usa el MCP para leer el anuncio BOE-B-2024-4144 (artículo 'todo'). ¿De qué ayuntamiento es y para qué proyecto están expropiando?"

  • 📡 Para Notificaciones del Día: "Mira el sumario de hoy con boe_get_daily_summary. Busca notificaciones de juzgados y léeme el texto de la primera que encuentres."

TIP

Cuando busques anuncios, nombramientos o cualquier cosa queno sea un artículo numerado, dile siempre a la IA: article: "todo". Eso activa el modo lectura completa y el "Modo Rescate PDF" si hace falta.


🛠️ Arsenal de Herramientas (El Maletín del Abogado)

Herramienta

Misión

Parámetros clave

boe_search

🧭 Brújula. Encontrar el ID de una ley (con fallback "Relajado").

q: "Amnistía 2024"

boe_get_article

👁️ Bisturí. Extraer texto y detectar Referencias Cruzadas.

id: "BOE-A-...", article: "1"

boe_get_relationships

🔗 Linaje. Ver qué normas modifica o deroga esta ley.

id: "BOE-A-..."

boe_search_recent_summaries

📡 Radar. Escanear sumarios de los últimos N días.

keyword: "Oposiciones", days: 7

boe_get_daily_summary

Sumario. Ver todo lo publicado en una fecha concreta.

date: "20260219"

eurlex_search

🇪🇺 Pasaporte. Normativas de la Unión Europea.

q: "RGPD"


🚀 Instalación e Integración

1. Instalación Global (Una vez y para siempre)

npm install -g boe-eurlex-mcp

O usa npx directamente en los comandos de configuración de abajo. No instala nada y siempre trae la última versión.


💎 Gemini CLI (Antigravity)

Dale superpoderes legales a tu terminal con un solo comando:

gemini mcp add boe_eurlex npx -y boe-eurlex-mcp --scope user

🤖 Claude Desktop

Abre tu archivo de configuración (%APPDATA%\Claude\claude_desktop_config.json en Windows, ~/Library/Application Support/Claude/claude_desktop_config.json en Mac) y añade:

{
  "mcpServers": {
    "boe_eurlex": {
      "command": "npx",
      "args": ["-y", "boe-eurlex-mcp"]
    }
  }
}

🌌 Antigravity / Cursor / Cline / IDEs con soporte MCP

Configura un nuevo servidor MCP en tu IDE con:

  • Comando: npx

  • Argumentos: -y, boe-eurlex-mcp

IMPORTANT

Reglas de Oro para Agentes (Antigravity/Cursor/Cline):

  1. Para anuncios (BOE-B) o nombramientos (BOE-A), usa SIEMPRE article: "todo".

  2. Si un documento no está en XML, el servidor activará el "Modo Rescate PDF" automáticamente. No interrumpas el proceso.

  3. Usa boe_search para leyes consolidadas y boe_get_daily_summary para encontrar anuncios del día.


🔐 Garantía de Verdad (SHA-256 Anti-Alucinaciones)

Cada respuesta del servidor incluye una huella digital criptográfica SHA-256 del texto. Si alguien modifica el contenido aunque sea una coma, el hash cambia. Porque en la ley, una coma puede mandarte a prisión... o sacarte de ella.

{
  "source": "BOE",
  "id": "BOE-A-2024-11776",
  "sha256": "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e",
  "nota": "Si el hash no coincide con el BOE oficial, alguien ha tocado el texto. (Spoiler: no hemos sido nosotros)."
}

📜 Licencia

MIT. Úsalo, cámbialo, ámalo. (Pero no nos demandes si Gemini te dice que puedes aparcar en doble fila, ¡comprueba siempre la fuente oficial!).

Available Tools

4 tools
boe_get_articleB

Obtiene el texto íntegro y detecta referencias cruzadas a otros documentos del BOE.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesIdentificador (ej. BOE-A-1996-8930)
articleYesNúmero de artículo o 'todo'/'preambulo'.

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description bears full burden. It mentions getting full text and detecting cross-references but omits details on read-only nature, authentication, or response format.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence that efficiently conveys the main action and additional detection feature. No fluff, but could be slightly more structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Lacks output schema and annotations. Does not explain the cross-reference detection output or provide sufficient context for an AI agent to understand the response format, making it incomplete for a specialized tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already describes both parameters. The description adds no parameter-specific meaning beyond what is in the schema, meeting baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves the full text of a BOE article and detects cross-references, distinguishing it from siblings like boe_search (search) and boe_get_relationships (relationships).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives. The description implies usage for retrieving article text but does not specify scenarios or when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

boe_get_relationshipsA

Analiza un documento para extraer sus relaciones jurídicas (qué leyes modifica, deroga o cuáles le afectan). Esencial para análisis profundo.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesIdentificador del documento (ej. BOE-A-2024-11776)

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It describes the output (extracting relationships) but does not disclose any behavioral traits such as read-only nature, required permissions, or limitations. The tool's mutability is not addressed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that succinctly states the tool's purpose and importance. Every word adds value, with no wasted space or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity (1 parameter, no output schema) and no annotations, the description is adequate but lacks detail on the format of returned relationships and differentiation from sibling tools. It leaves some context gaps for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% for the single parameter 'id', and the schema already provides description and example. The tool description adds no extra parameter-specific information, so it meets the baseline of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool analyzes a document to extract legal relationships, specifying which laws it modifies, repeals, or affects. This verb+resource combination is specific and distinguishes it from sibling tools like boe_search or boe_get_article.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for in-depth analysis with 'Esencial para análisis profundo', but does not explicitly state when to use vs. alternatives like boe_search or boe_get_article. No exclusions or alternative guidance is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

boe_search_recent_summariesA

Escanea exhaustivamente los sumarios de los últimos N días buscando palabras clave. Útil para encontrar anuncios ocultos.

ParametersJSON Schema
NameRequiredDescriptionDefault
daysNoNúmero de días atrás a escanear
keywordYesPalabra clave a buscar en los títulos

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description mentions 'exhaustively' but provides no details on return format, pagination, rate limits, or side effects. Since annotations are absent, more behavioral context would be beneficial.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise—only two sentences—with the main action in the first sentence and additional context in the second, containing no superfluous information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with two parameters and no output schema, the description covers the core purpose and scope adequately, though it omits details on result format or limitations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema coverage, the description adds no extra meaning to the parameters; the schema already documents 'days' and 'keyword' adequately, so a baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly specifies the action (thoroughly scans), resource (summaries of the last N days), and scope (searching for keywords), distinguishing it from siblings like 'boe_search' which likely searches all documents.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It indicates usefulness for finding hidden announcements ('Útil para encontrar anuncios ocultos') but does not explicitly state when to use this tool versus alternatives like 'boe_search' or when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.7/5.0
Disambiguation5/5

Each tool targets a distinct operation: general search, article retrieval, relationship analysis, and recent summary scanning. No functional overlap.

Naming Consistency5/5

All tools follow a consistent 'boe_' prefix with a verb_noun pattern (e.g., boe_search, boe_get_article). No naming conflicts or style mixing.

Tool Count5/5

4 tools is well-scoped for a legislative document server, covering core research needs without bloat or deficiency.

Completeness4/5

Covers searching, detailed retrieval, relationship extraction, and recent alerts. Missing EUR-Lex coverage despite server name, but for BOE alone it is reasonably complete.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    Enables searching and retrieving EU legal documents (regulations, directives, court decisions) via the EUR-Lex Cellar API, supporting full-text search, metadata, citations, and consolidated versions without requiring an API key.
    11
    59
    6
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables querying EU legal documents, case law, and citation graphs through natural language using the LexAPI.
    10
    86
    3
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/anamtb/boe-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server