Skip to main content
Glama

BOE-MCP. MCP Integration with the BOE API

es en

DESCRIPTION

BOE is the Official State Gazette of Spain.

Boe-mcp enables querying consolidated legislation, BOE/BORME summaries, and legal reference data directly through Claude AI and other MCP-compatible clients using the Model Context Protocol (MCP).

Boe-mcp is an MCP server that exposes tools for LLMs to access:

  • Consolidated legislation of the Spanish legal system

  • Daily BOE and BORME summaries

  • Auxiliary tables for legal domains, jurisdictions, and government departments

Related MCP server: CENDOJ MCP Server

KEY FEATURES

  • Advanced search of consolidated legislation with date, jurisdiction, and validity filters

  • Full legal text retrieval in XML/JSON formats

  • Historical BOE and BORME summary queries

  • Access to legal reference tables (domains, departments, legal relationships)

  • Block-level navigation of legal texts

  • Automatic consolidation status validation

INSTALLATION

Install with uv

Prerequisites

  • Python 3.10 or higher.

  • uv package manager.

Installing uv

The first step is to install uv, a package manager for Python.
It can be installed from the command line.

On macOS and Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

On Windows:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

You can also install it with pip:

pip install uv

For more information about installing uv, visit the uv documentation.

INTEGRATION WITH CLIENTS LIKE CLAUDE FOR DESKTOP

  1. Go to Claude > Settings > Developer > Edit Config > claude_desktop_config.json.

  2. Add this configuration block under "mcpServers":

"boe_mcp": {
    "command": "uvx",
    "args": [
        "boe_mcp"
    ]
}
  1. If you have other MCP servers configured, separate them with commas ,.

USAGE EXAMPLES

Once configured, you can make queries like:

  • "List current state laws on data protection"

  • "Show the BOE summary for June 14, 2024"

  • "Display the BOE legal domains table"

Available Tools

5 tools
get_auxiliary_tableA

Consultar tablas auxiliares disponibles en la API del BOE. Dichas tabls incluyem los códigos de materias, ámbitos, estados de consolidación, departamentos, rangos y relaciones. Estos códigos se pueden usar para usar en las queries de la función search_consolidated_laws_list

Args: table_name: Una de las siguientes: 'materias', 'ambitos', 'estados-consolidacion', 'departamentos', 'rangos', 'relaciones-anteriores', 'relaciones-posteriores'

ParametersJSON Schema
NameRequiredDescriptionDefault
table_nameYes

TDQS

A4.1/5.0
Behavior3/5

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

The description implies a read-only operation ('Consultar') and lists valid table names, but it does not disclose return format, pagination, or other behavioral traits beyond what the name suggests. Since no annotations are provided, the description carries the full burden, leaving some gaps.

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 compact, front-loaded with the purpose, and the Args list is concise and directly useful. Minor typos do not affect structure or readability.

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 lookup tool, the description covers the purpose, the relevant table names, and how the resulting codes are used. It lacks details on the response schema, but given the tool's simplicity, this is acceptable. The reference to a tool not among siblings may cause slight confusion.

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

Parameters5/5

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

The description adds all valid values for `table_name` in the Args section, which the schema does not provide. This fully compensates for the 0% schema description coverage, making parameter semantics clear and actionable.

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

Purpose4/5

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

The description clearly states the tool consults auxiliary tables available in the BOE API and enumerates the specific categories of codes (subjects, scopes, consolidation states, etc.). This makes the function distinct from its siblings, which deal with law lists, sections, and summaries, though it does not explicitly differentiate.

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

Usage Guidelines4/5

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

The description explicitly says the codes can be used in searches via `search_consolidated_laws_list`, giving a clear use case. However, it does not mention alternative tools or exclusions, so it stops at clear context without explicit when-not.

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

get_boe_summaryA

Obtener sumario del BOE para una fecha (AAAAMMDD).

Args: fecha: Fecha del BOE (ej: 20240501)

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

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 must carry the full burden of disclosure. It merely states the action and date format without describing what the summary contains, potential error cases, or any side effects. A read-only tool should still indicate return structure or limitations.

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 extremely concise, using a single clear sentence and an Args list. It is front-loaded with the core purpose and immediately gives the parameter detail.

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?

For a one-parameter, no-output-schema tool, the description is minimally viable but lacks detail about what the summary includes or how to interpret the response. It also doesn't address ambiguity with the similar sibling 'get_borme_summary'.

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

Parameters4/5

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

The description adds significant meaning to the single parameter 'fecha' by specifying the expected format (AAAAMMDD) and providing an example (20240501). This compensates for the low schema description coverage (0%).

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 states a clear verb ('Obtener' = get) and resource ('sumario del BOE') with a specific date parameter. It distinguishes from the sibling 'get_borme_summary' by clearly targeting BOE rather than BORME.

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, nor any exclusions or prerequisites. The usage context is only implied by the tool name and the single date parameter, not explained.

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

get_borme_summaryA

Obtener sumario del BORME para una fecha (AAAAMMDD).

Args: fecha: Fecha del BORME (ej: 20240501)

ParametersJSON Schema
NameRequiredDescriptionDefault
fechaYes

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 must disclose behavioral traits. It only mentions the date format and does not describe the response structure, error behavior, or any side effects. For a read-only getter, this is somewhat implicit, but the description lacks explicit disclosure.

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 extremely concise, starting with the primary purpose, and the Args section is useful because it provides the format example not found in the schema. Every piece of information earns its place.

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 tool's simplicity (one param, no output schema), the description is adequate for invocation but lacks details about the returned summary structure and usage context relative to sibling tools. It fulfills basic needs but has clear gaps.

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

Parameters4/5

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

The schema provides only the parameter name and type with no description. The tool description compensates by specifying the format (AAAAMMDD) and giving an example (20240501), which adds critical semantic meaning for correct invocation.

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 uses the specific verb 'Obtener' with the resource 'sumario del BORME' and a date parameter, clearly distinguishing it from sibling tools like get_boe_summary. It states exactly what the tool returns and for which input.

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?

The description provides no guidance on when to use this tool versus alternatives such as get_boe_summary. It only states the function and input format, leaving the agent without context for tool selection.

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

get_law_sectionA

Recupera una parte específica de una norma consolidada del BOE.

Args: identifier: ID de la norma (ej. "BOE-A-2023-893"). section: Parte de la norma a obtener: - "completa": Toda la norma - "metadatos": Solo metadatos - "analisis": Datos analíticos (materias, referencias) - "metadata-eli": Metadatos ELI - "texto": Texto completo consolidado - "indice": Índice de bloques - "bloque": Un bloque específico (requiere block_id) block_id: Solo requerido si section="bloque" format: Formato de respuesta (xml o json, si disponible)

Returns: Contenido de la norma o parte solicitada (como string XML o JSON).

ParametersJSON Schema
NameRequiredDescriptionDefault
formatNoxml
sectionYes
block_idYes
identifierYes

TDQS

A4.1/5.0
Behavior3/5

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

No annotations are provided, so the description must carry the full burden. It discloses the conditional nature of block_id (only required for 'bloque'), the format options with 'si disponible' indicating possible unavailability, and the return type as string XML or JSON. However, it does not mention error scenarios, authentication, rate limits, or other side effects.

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 and well-structured. It leads with a one-sentence purpose, then uses a clear Args list with parameter explanations. No redundant text or filler.

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?

The description covers all parameters and the return value, which is sufficient for a retrieval tool of moderate complexity. However, it does not address usage guidelines or error handling, which would make it fully complete. Given that the output schema is absent, the description adequately explains what the tool returns.

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

Parameters5/5

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

The description thoroughly explains each parameter: identifier with an example, section with an exhaustive list of accepted values, block_id with a conditional requirement, and format with possible values. This compensates for the 0% schema description coverage and adds meaning beyond the raw schema. It also clarifies that block_id is not always required despite the schema marking it as required.

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 starts with a clear statement: 'Recupera una parte específica de una norma consolidada del BOE.' This specifies the verb (recupera) and the resource (part of a consolidated BOE law). It also lists the distinct section types, which differentiates it from sibling tools like search_laws_list and get_boe_summary.

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 usage is implied: you use this tool when you need a specific part of a law identified by an identifier. However, it does not explicitly mention when to use this tool versus alternatives, nor does it describe when not to use it. There is no exclusions or reference to sibling tools.

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

search_laws_listA

Búsqueda avanzada de normas del BOE.

Args: -from_date: Fecha mínima (AAAAMMDD). -to_date: Fecha máxima (AAAAMMDD). -offset: Índice inicial. Es obligatorio incluírlo en la llamada a la función. -limit: Máximo de resultados (-1 para todos).

-query_value: Texto libre. Usar preferentemente palabras, no frases.

-search_in_title_only: True para buscar solo en el título (True por defecto).
-solo_vigente: True para buscar solamente normas vigentes (True por defecto).
-solo_consolidada: true para buscar solamente normas consolidadas (False por defecto).

-ambito: Filtra por ámbito ('Estatal', 'Autonómico', 'Europeo').
-must: Condiciones que deben cumplirse (and).
-should: Condiciones opcionales (or).
-must_not: Condiciones excluidas (not).
-range_filters: Filtros por fechas.
-sort_by: Ordenamiento personalizado.
ParametersJSON Schema
NameRequiredDescriptionDefault
mustNo
limitNo
ambitoNo
offsetNo
shouldNo
sort_byNo
to_dateNo
must_notNo
from_dateNo
query_valueNo
solo_vigenteNo
range_filtersNo
solo_consolidadaNo
search_in_title_onlyNo

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description is the sole carrier of behavioral information. It does disclose parameter-specific behaviors (offset mandatory, limit -1 semantics, default filter values), but it does not mention return format, read-only nature, error handling, or rate limits. The claim that offset is obligatory conflicts with the schema's default value, though this is not an annotation contradiction.

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?

The description is a well-organized bullet list, front-loaded with a purpose sentence. It is necessarily long due to 14 parameters, but each line is functional. Minor redundancy exists in repeating defaults, but no filler.

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 tool with 14 parameters and no output schema, the description covers all parameter semantics comprehensively. However, it lacks explicit return-value expectations and does not situate the tool relative to siblings, which would make it fully self-contained.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate. It fully documents all 14 parameters, including types, defaults, allowed enum values, and usage tips. This adds substantial meaning beyond the bare property names in the schema.

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 opens with 'Búsqueda avanzada de normas del BOE' — a specific verb ('search') and resource ('BOE norms'). This clearly distinguishes it from sibling tools like get_law_section (retrieval) and get_boe_summary (summarization).

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 gives detailed parameter-level guidance (e.g., prefer words over phrases, -1 for all results) but does not explicitly state when to use this tool versus alternatives. There is no scenario-based guidance or exclusionary language referencing sibling tools.

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

Tool Schema Changelog

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

  1. 5 tool updatesv0.1.0
    • First observedget_auxiliary_table
    • First observedget_boe_summary
    • First observedget_borme_summary
    • First observedget_law_section
    • First observedsearch_laws_list

TDQS

A4/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: searching norms, retrieving norm sections, getting daily summaries for BOE and BORME, and accessing auxiliary tables. No two tools overlap in functionality, and the summary tools are differentiated by the source bulletin.

Naming Consistency4/5

Four tools follow a consistent 'get_' prefix pattern (get_law_section, get_boe_summary, get_borme_summary, get_auxiliary_table), while search_laws_list deviates with 'search_'. Names are otherwise readable and predictable, but the single deviation and a cross-reference typo ('search_consolidated_laws_list' vs 'search_laws_list') prevent a perfect score.

Tool Count5/5

With 5 tools, the server is well-scoped for its purpose of accessing BOE legal data. Each tool covers a distinct aspect (search, retrieval, summaries, auxiliary tables) without redundancy or excessive granularity.

Completeness5/5

The tool surface covers the core workflow for legal research: searching norms, retrieving full texts or specific sections, browsing daily summaries, and using controlled vocabularies for precise queries. There are no obvious dead ends or missing operations for typical use cases.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Related MCP Connectors

Related MCP Servers