About Boe Legislacion
Boe Legislacion is an MCP server for legal researchers and others working with Spanish law, providing consolidated legislation and daily gazette contents from the BOE. It supports law searches, article retrieval with historical versions, and gazette browsing by date.
Key features
- 01Search consolidated legislation
- 02Retrieve laws by BOE ID
- 03View historical article versions
- 04Look up daily gazette contents
- 05Browse article indexes and metadata
Use cases
- 01Find Spanish laws on a specific topic
- 02Compare historical versions of an article
- 03Review gazette publications for a date
MCP support
It exposes Spanish legislation search, law article retrieval, and daily gazette contents tools to MCP clients. It can connect through Pipeworx's remote service or run locally as a stdio MCP server.
Configuration
Remote servers need no local install. Pick your client, then copy the config or install in one click.
https://gateway.pipeworx.io/boe-legislacion/mcpclaude mcp add --transport http pipeworx-io-boe-legislacion https://gateway.pipeworx.io/boe-legislacion/mcp{"mcpServers":{"pipeworx-io-boe-legislacion":{"type":"http","url":"https://gateway.pipeworx.io/boe-legislacion/mcp"}}}Open in Cursor{"servers":{"pipeworx-io-boe-legislacion":{"type":"http","url":"https://gateway.pipeworx.io/boe-legislacion/mcp"}}}Open in VS Code{"mcpServers":{"pipeworx-io-boe-legislacion":{"type":"http","url":"https://gateway.pipeworx.io/boe-legislacion/mcp"}}}{"mcpServers":{"pipeworx-io-boe-legislacion":{"serverUrl":"https://gateway.pipeworx.io/boe-legislacion/mcp"}}}Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.
Tools
44| Parameter | Type | Required | Description |
|---|---|---|---|
| q | string | No | Alias for question. |
| ask | string | No | Alias for question. |
| text | string | No | Alias for question. |
| input | string | No | Alias for question. |
| packs | array | No | OPTIONAL. Restrict routing to these pack slugs (e.g. ["sec-form-d","sec-13f"]) — the router then picks only from tools in those packs. Omit for the default full-catalog routing. Slugs come from list_packs / search_packs / https://pipeworx.io/directory; unlisted or unknown slugs are ignored and named in _meta.pack_scope.ignored, and if none of them resolves the question is routed across the whole catalog with _meta.pack_scope.full_catalog:true (never an empty answer). |
| query | string | No | Alias for question. |
| prompt | string | No | Alias for question. |
| message | string | No | Alias for question. |
| question | string | Yes | Your question or request in natural language. Accepts query, q, prompt, text, input, ask, message as aliases. |
Details
From the project README@pipeworx/boe-legislacion
Spain's consolidated legislation — every Spanish statute and royal decree kept up to date with every amendment folded in, plus the daily table of contents of the state gazette, from the Agencia Estatal Boletín Oficial del Estado (BOE).
Part of Pipeworx — an MCP gateway connecting AI agents to 1875+ live data sources. This is an independent, unofficial integration — not affiliated with, endorsed by, or published by the upstream provider.
Tools
boe_search_law(query, ambito?, limit?, offset?)— search consolidated legislation by words in the title (e.g. "Código Civil", "ley de propiedad horizontal"). Returns matching laws with their BOE id, legal rank, issuing department, scope (national/regional), key dates, and the official BOE page URL for each. Pass the returned id toboe_law.boe_law(id, article?)— one consolidated law by its BOE id. Withoutarticle: metadata (rank, department, consolidation status, dates), subject tags, notes, and a table of contents of its articles/sections ("bloques") — capped at 200 entries and markedtruncatedfor large codes. Witharticle(a block id from that table of contents, e.g."a1"for Artículo 1): the actual text of that one article across every historical version it has had, each dated, with the current one flagged.boe_daily_summary(date)— table of contents of one day's BOE issue: every disposition and announcement published that day, grouped by section and issuing department, with each item's BOE id and title. BOE does not publish every day (no Sunday issue, some holidays); those dates come backfound: false, never an empty list.
Auth
Keyless. The upstream open-data API requires no registration, key, or
click-through terms — it is served to anyone with Accept: application/json.
Data sources
- Agencia Estatal Boletín Oficial del Estado (BOE), Legislación Consolidada — the consolidated-text database of Spanish state and regional legislation, kept current with every amendment.
- Agencia Estatal Boletín Oficial del Estado (BOE), Sumario — the daily table of contents of the state gazette.
Notes
- The Accept header is honoured on 200 only. On any error (400/404/500)
the upstream ignores
Accept: application/jsonentirely and always answers a fixed small XML envelope (status code + text, empty data) regardless of what was requested. Every call here reads the body as text first and only parses it as JSON when it looks like JSON, so an error message is never lost to a failedres.json(). - The empty-result shape is not uniform. A zero-match search answers 200
with
"data": ""— an empty string, not[]or{}— while a populated list and a single-record lookup are both array-wrapped ("data": [...], even for exactly one record).boe_search_lawandboe_lawnormalise this and reportfound: falsewith plain wording on a genuine miss, never an empty array dressed as success. - Article/section text has no JSON form at all. Only the table of
contents (
texto/indice) is available as JSON; the actual block text is XML-only. There is no XML parser in the Workers runtime, soboe_lawwitharticleextracts paragraphs with targeted regex over BOE's fixed one-block, one-or-more-versions, paragraph-per-version XML shape — reliable for real statute text, not a general-purpose XML parser. - Large codes are enormous. The Código Civil's table of contents alone is
2,444 blocks.
boe_lawwithoutarticlecaps what it inlines and reportsarticles.total/articles.truncatedrather than ever returning the whole thing — usearticleto read one block at a time. - The upstream does not report a total match count for search —
limit/offsetpaginate, andshowntells you how many came back this call.
Quick Start
Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
{
"mcpServers": {
"boe-legislacion": {
"url": "https://gateway.pipeworx.io/boe-legislacion/mcp"
}
}
}
What this endpoint actually serves
tools/list at https://gateway.pipeworx.io/boe-legislacion/mcp returns the tools in the table
above plus the shared Pipeworx meta-tools — ask_pipeworx,
discover_tools, search_within, remember/recall and the rest of the
gateway-wide set. So the tool count you see is larger than this table: a
single-pack endpoint currently lists roughly 30 shared tools alongside the
pack's own. The connection's initialize response states its exact scope, and
is the authoritative answer for a given day.
This is deliberate, not multiplexing by accident. The meta-tools are what let a
scoped connection answer a question this pack does not cover — via
ask_pipeworx, which routes across the whole catalog — without you adding a
second MCP server. There is currently no way to mount a pack endpoint without
them; if the extra schemas cost you more context than the routing is worth,
connect to the full gateway once rather than to several pack endpoints.
Or connect to the full Pipeworx gateway to get every pack's tools listed directly, instead of just this one's:
{
"mcpServers": {
"pipeworx": {
"url": "https://gateway.pipeworx.io/mcp"
}
}
}
Both URLs reach the same gateway and the same 1875+ data sources. The
only difference is which pack's tools are listed directly; ask_pipeworx
reaches all of them from either one.
No MCP client? Call it over HTTP
curl -X POST https://gateway.pipeworx.io/v1/tools/boe_search_law \
-H 'Content-Type: application/json' \
-d '{"query":"Código Civil","limit":5}'
No account needed for the first calls. Inspect any tool: GET https://gateway.pipeworx.io/v1/tools/boe_search_law. Find one: POST https://gateway.pipeworx.io/v1/tools/search_packs with {"query":"..."}.
Standalone (no gateway account)
This package also runs as a local stdio MCP server — no Pipeworx account, no gateway round-trip:
{
"mcpServers": {
"boe-legislacion": {
"command": "npx",
"args": ["-y", "@pipeworx/mcp-boe-legislacion"]
}
}
}
Or run it directly to confirm it starts:
npx -y @pipeworx/mcp-boe-legislacion
It speaks MCP over stdin/stdout and answers initialize/tools/list/tools/call
for only this pack's tools — none of the shared meta-tools the gateway
connection above adds. Same source, same tools, no ask_pipeworx routing.
Using with ask_pipeworx
Instead of calling tools directly, you can ask questions in plain English — this works on the pack endpoint above as well as on the full gateway:
ask_pipeworx({ question: "your question about Boe Legislacion data" })
The gateway picks the right tool and fills the arguments automatically.
More
License
MIT
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.