mcp_boe
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp_boe Busca en el sumario del BOE normas que mencionen 'digital' en los últimos 5 días."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-servers-demo
Servidor MCP (Model Context Protocol) de demostración que permite a un asistente de IA consultar y buscar en el sumario diario del BOE usando su API de datos abiertos. Proyecto personal de portfolio; no está conectado a ningún sistema de ninguna administración.
Problema
Los LLM citan normas de memoria y se equivocan. MCP permite darles herramientas verificables. Este repo muestra cómo diseñar un servidor MCP pequeño, seguro y probado, en local (stdio) y en la nube (AWS Lambda).
Related MCP server: mcp-legislation-uk
Herramientas expuestas
Tool | Entrada | Salida |
|
| disposiciones del día: id, título, sección, departamento, epígrafe, URL del PDF y del HTML |
|
| disposiciones cuyo título contiene todas las palabras (sin distinguir acentos ni mayúsculas) en los últimos |
Arquitectura
flowchart LR
C[Cliente MCP<br/>Claude Desktop / script] -- stdio --> S[mcp_boe.server<br/>2 tools]
S --> B[mcp_boe.boe_client<br/>allow-list, timeout, tamaño máx.]
B --> API[(API datos abiertos BOE)]
L[aws/mcp_lambda.py<br/>MCP HTTP sin estado] -- JSON-RPC --> APIEjecutar
git clone https://github.com/davidsilvente-dev/mcp-servers-demo && cd mcp-servers-demo
pip install -e ".[dev]"
python -m mcp_boe.server # transporte stdio
mcp dev src/mcp_boe/server.py # inspector de MCP
python examples/cliente_stdio.py # cliente de prueba (usa la API real)
ruff check . && pytest # lint y 19 pruebas sin red (respuesta grabada en tests/fixtures)Configuración para Claude Desktop en examples/claude_desktop_config.json.
Requiere mcp 1.x (mcp<2): la versión 2 renombró FastMCP a MCPServer; la migración está en la lista de pendientes.
Despliegue en AWS (Lambda)
La carpeta aws/ contiene el mismo servidor como MCP HTTP sin estado en AWS Lambda, desplegado con CloudFormation:
aws/mcp_lambda.py: código legible (JSON-RPC:initialize,ping,tools/list,tools/call; sin dependencias).aws/boe-mcp.yaml: plantilla (Lambda de 128 MB, logs a 7 días, URL de función con autenticación IAM; no es pública).
aws cloudformation deploy --template-file aws/boe-mcp.yaml --stack-name boe-mcp --capabilities CAPABILITY_IAM
aws cloudformation delete-stack --stack-name boe-mcp # retirar todoProbado el 01/11/2026 en una cuenta de pruebas (eu-west-1) con peticiones firmadas con SigV4: tools/list y tools/call devolvieron el sumario del 30/10 (74 disposiciones); sin firma, la URL responde 403. La versión Lambda expone solo sumario_boe.
Resultados (medidos el 01/11/2026)
Sumario del 30/10/2026: 74 disposiciones por stdio y por Lambda.
buscar_boe("real decreto", dias=5): 5 resultados de dos sumarios (31/10 y 30/10) con la API real.pytest: 19 pruebas sin red en 0,7 s (cliente, parseo, filtro y servidor MCP en memoria).
Seguridad
Solo lectura; solo https://www.boe.es/; timeout de 10 s; respuesta máxima de 5 MB; sin secretos en el repo. Ver SECURITY.md.
Limitaciones
Depende de la disponibilidad y el formato de la API del BOE (puede cambiar).
buscar_boesolo busca en los títulos del sumario, no en el texto de las normas; hace una petición por día.La versión Lambda no está probada con un cliente MCP completo (haría falta un proxy que firme con SigV4).
No es un servidor de producción: sin caché, sin limitación por usuario.
Pendiente
Migrar a MCP v2 (
MCPServer).Herramienta
obtener_norma(texto consolidado por identificador ELI) y resourceboe://norma/{id}.Caché de sumarios y bench de latencia.
Licencia
MIT. Los textos del BOE están sujetos a su aviso legal.
Available Tools
2 toolsbuscar_boeA
Busca disposiciones del BOE cuyo título contenga todas las palabras de texto
en los sumarios de los últimos dias días (máx. 14) contados desde desde (AAAAMMDD; hoy por defecto).
Devuelve como mucho limite resultados (máx. 50). Los días sin BOE (domingos, festivos) se omiten.
Inputs: texto (required), dias, desde, limite. Returns: result
sumario_boeB
Devuelve las disposiciones del sumario del BOE de una fecha (AAAAMMDD; hoy por defecto).
Inputs: fecha. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
sumario_boe retrieves the daily gazette summary by date, while buscar_boe performs keyword search across titles over a date window. The input shapes (date vs. text+dias+limite) and outputs make the boundary between browsing and searching unambiguous.
Both names use snake_case with a shared `_boe` domain suffix, giving a predictable pattern. The prefixes mix a noun (sumario) with a verb (buscar), a minor deviation but still readable and conventional for Spanish.
Only two tools, which is thin even for a narrowly scoped gazette server. They do cover the two core access modes (browse by date, search by keyword), but the surface feels minimal and leaves little room for refinement.
There is no way to fetch the full text or metadata of a specific disposition, nor to filter by BOE section/department, so agents can find titles but cannot read the underlying documents. The 14-day search window and 50-result cap further limit coverage, making the surface notably incomplete for a BOE domain.
Related MCP Connectors
Official EUR-Lex, UK, US, and gazette search, metadata fetch, and change-only watches.
Search UK Acts, Statutory Instruments, and legislation with full text retrieval
Search Spain's BOE/BORME gazettes, open EU funding calls and EU TED tenders. Keyless sources.
UK legislation full text, MPs, petitions, GOV.UK search, food alerts, police neighbourhoods
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables LLMs like Claude to query the official Spanish BOE API for consolidated legislation, daily summaries, and auxiliary government tables.3162MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server for accessing the UK's official legislation database (legislation.gov.uk), enabling natural language queries via Pipeworx's AI gateway.64 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants and agents to search a legal document collection via hybrid BM25+dense retrieval, read articles with context, and generate full or short citations. It also exposes whole acts as Markdown resources, provides a citation-answering prompt, and supports stdio and streamable HTTP transports.MIT
- AlicenseNot gradedqualityBmaintenanceA free, local MCP server that lets an AI assistant consult and search the Italian Gazzetta Ufficiale without codes or dates, retrieving recent publications, issue tables of contents, act texts, public competition notices and Normattiva links. It runs on-demand with a local SQLite cache and rate-limited requests, and always cites the official source link while noting that results may be partial.MIT