ensmcp
ensmcp es un servidor MCP offline que pone las medidas de seguridad del ENS (Anexo II del RD 311/2022) y el cuestionario de auditoría de la CCN-STIC 808 al alcance de cualquier cliente MCP.
Explorar el Anexo II: listar categorías (
list_categories) y medidas con filtros por categoría, dimensión o nivel (list_measures), recuperar una medida por código exacto (get_measure) o buscar por texto en código, título, cuestionario y redacción del RD (search_measures).Preparar la Declaración de Aplicabilidad: valorar cada dimensión (confidencialidad, integridad, disponibilidad, autenticidad, trazabilidad) y obtener la categoría del sistema, las medidas exigibles, su nivel y sus refuerzos obligatorios o alternativos (
declaracion_aplicabilidad).Planificar la auditoría: obtener el temario real de verificación con los requisitos acumulados por tramo y el nivel de madurez mínimo exigible (
alcance_auditoria).Consultar el cuestionario CCN-STIC 808 en bruto: preguntas por medida o por tramo, marcando los requisitos esenciales (
requisitos_auditoria).Verificar el articulado del RD 311/2022: comprobaciones documentales y de gobierno como DdA firmada, categorización o INES (
requisitos_articulos).Saber qué documentación preparar: evidencias documentales que puede pedir el auditor, por medida o todas (
evidencias_auditoria).Conocer el origen y la frescura de los datos servidos, incluida la edición de la guía 808 (
snapshot_status).
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., "@ensmcp Calculate the applicability matrix for high availability and medium integrity"
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.
What it is
ensmcp is an MCP (Model Context Protocol) server that brings the security measures of ENS Navegable (Annex II of RD 311/2022) within reach of Claude Desktop, Claude Code and any other MCP client. It is an independent server and is not affiliated with, endorsed by or maintained by the CCN, CCN-CERT or CNI.
The data ships in the package as a snapshot, so the server responds instantly and works offline. The default mode is offline: it does not open Chrome or access the network. --check-updates checks the official source without replacing the snapshot and --live allows temporarily adopting the live data.
In addition to Annex II, it includes the verification questionnaire from the CCN-STIC 808 guide (edition for RD 311/2022): the audit questions per measure, the checks on the RD articles and the documentary evidence the auditor may request.
Main features
Feature | Description |
MCP server over stdio | Integrable into Claude Desktop, Claude Code and other MCP clients |
Works offline | The full corpus ships as a snapshot in the package |
Deterministic snapshot | The default mode always serves the packaged corpus |
Explicit check |
|
Applicability matrix | Calculates the regulatory basis to prepare the Applicability Statement |
CCN-STIC 808 audit | Audit syllabus, essential requirements, RD articles and documentary evidence |
Related MCP server: Portuguese Cybersecurity MCP
Available tools
Annex II query
Tool | Args | Description |
| — | The Annex II categories with their group ( |
|
| Measures filtered by category, security dimension or level. |
|
| A measure by exact code (e.g. |
|
| Text search in code, title, description and RD wording (case- and accent-insensitive). |
Applicability Statement and audit
Tool | Args | Description |
|
| The base regulatory matrix to prepare the DdA: each dimension is rated ( |
| same as the DdA | The system's audit syllabus: the applicable measures with their accumulated verification questions and the minimum maturity level required. |
|
| The raw CCN-STIC 808 questionnaire, per measure or per tier, marking the essential requirements. |
| — | The audit checks on the RD articles (formal DdA, categorization, INES...). |
|
| The documentation the auditor may request, per measure. |
Status and updates
Tool | Args | Description |
| — | Checks the official site now and updates the data if it has changed. |
| — | Origin and freshness of the data being served. |
What a measure returns
Each measure carries two texts, and both are needed: norm_text is the wording of RD 311/2022 (what the measure requires) and description is the CCN-STIC 808 questionnaire (what the auditor asks). The reinforcements come paired with the level that requires them and with their wording in the RD:
{
"code": "mp.s.4",
"title": "Protección frente a denegación de servicio",
"description": "Categoría Media 1.1 ¿Se ha planificado y dotado al sistema de capacidad suficiente ...?",
"norm_text": "Se establecerán medidas preventivas frente a ataques de denegación de servicio ...",
"category_code": "mp.s",
"dimensions": ["disponibilidad"],
"levels": ["medio", "alto"],
"reinforcements": [
{ "code": "R1", "level": "alto", "alternative": false, "text": "R1-Detección y reacción. ..." }
],
"raw_levels": { "bajo": "n.a.", "medio": "aplica", "alto": "+ R1" }
}alternative distinguishes the mandatory reinforcements (+ R1 + R2) from the alternative ones (+ [R1 or R2], where any single one suffices): confusing them changes what must be implemented.
Applicability Statement
The ENS does not apply one level to the whole system: it applies one per dimension. Each one is rated and the tool returns what that system must comply with:
{
"categoria_sistema": "alta",
"measures": [
{ "code": "op.acc.5", "title": "Mecanismo de autenticación (usuarios externos)",
"required_level": "alto",
"required_reinforcements": [
{ "code": "R2", "alternative": true, "text": "R2-..." },
{ "code": "R5", "alternative": false, "text": "R5-..." }
] }
]
}The rule comes from RD 311/2022: the system's category is the highest of the rated levels (Annex I, section 4), measures marked "Category" are required according to the system's category, those protecting dimensions according to the level of those dimensions, and an unrated dimension leaves out the measures that only protect it.
Audit scope
If the DdA answers "what do I have to implement?", alcance_auditoria answers "what is the auditor going to ask me?". For each applicable measure, it returns the verification requirements accumulated up to its enforceable level and the minimum maturity level required by the guide:
Category | Minimum maturity level |
BASIC | L2 — Reproducible, but intuitive |
MEDIUM | L3 — Defined process |
HIGH | L4 — Managed and measurable |
The nuance matters: the tiers that ENS Navegable labels "Basic / Medium / High Category" are cumulative according to CCN-STIC 808 §5 — "Basic Category" means enforceable for all categories, not only for basic systems. A medium-category system answers the basic questions and the medium ones. For a system with C=high, I=medium, D=low, A=medium, T=medium, the real syllabus is 382 questions (136 essential, whose non-compliance blocks certification), not the 73 in its tier.
requisitos_articulos and evidencias_auditoria cover the other half of the audit: the checks on the RD articles (whether the DdA exists and is signed, whether the system is formally categorized, whether it is reported to INES...) and the 365 documentary evidence items the guide proposes. This data comes from CCN-STIC 808; ENS Navegable does not publish it.
Where the data comes from
src/ensmcp/data/anexo_ii.json— the ENS Navegable corpus (measures, RD texts, questionnaire, applicability by levels), captured from the official site. Each query is an in-memory lookup.src/ensmcp/data/guia_808.json— the data extracted from the CCN-STIC 808 guide with its attribution (the guide itself is not redistributed).snapshot_statusindicates which edition it comes from.
To regenerate the snapshot:
python scripts/build_snapshot.pyThe server does not open Chrome or use the network by default. To check for changes explicitly:
ensmcp --offline
ensmcp --check-updates
ensmcp --liveIt can also be configured with ENSMCP_MODE=offline|check-updates|live.
Requirements
Python 3.12-3.14
Only to update the snapshot (refresh_live_page, the startup check, scripts/build_snapshot.py) you also need:
Google Chrome installed
A display (or
xvfbon servers without one)
Installation
To use the server from PyPI:
pip install ensmcp
ensmcp --offlineTo enable the live check:
pip install "ensmcp[live]"
ensmcp --check-updatesDevelopment
git clone https://github.com/seifreed/ensmcp.git
cd ensmcp
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r pylock.toml # versiones exactas, verificadas por hash
pip install -e . --no-deps # el propio paquete, sin re-resolver
patchright install chromiumOn a freshly installed Linux it may also be necessary:
patchright install-deps chromiumpyproject.toml is the only place where dependencies are declared; pylock.toml is an artifact generated from it (PEP 751) that pins all dependencies —runtime and development together— to exact version and hash, with markers for Windows, Linux and macOS on x64 and ARM. To update dependencies, edit the ranges in pyproject.toml and regenerate:
uv pip compile pyproject.toml --all-extras --universal --python-version 3.12 \
--format pylock.toml -o pylock.tomlQuick start
python -m ensmcpConfigure it in an MCP client (e.g. Claude Desktop / Claude Code) pointing to the virtual environment interpreter:
{
"mcpServers": {
"ensmcp": { "command": "ensmcp", "args": ["--offline"] }
}
}No further configuration is needed: queries are answered from the package snapshot.
For compliance decisions, the BOE, the Technical Security Instructions, the current official guides and the criteria of the corresponding auditing or certification entity prevail.
To inspect it manually:
npx @modelcontextprotocol/inspector venv/bin/python -m ensmcpContributing
Contributions are welcome.
Fork the repository
Create your feature branch (
git checkout -b feature/new-feature)Commit your changes (
git commit -m 'Add new feature')Push the branch (
git push origin feature/new-feature)Open a Pull Request
Make sure all quality and security gates pass without errors or warnings before submitting the PR.
Support the project
If this project is useful to you, you can support its development:
Author
Marc Rivero López | @seifreed
Repository: github.com/seifreed/ensmcp
Available Tools
19 toolsalcance_auditoriaARead-onlyIdempotent
El temario de auditoría de un sistema: qué le van a preguntar.
Mismos argumentos que declaracion_aplicabilidad — el nivel de cada
dimensión, u omitida si el sistema no la valora.
Devuelve sólo las medidas que le aplican y, por cada una, los requisitos de verificación exigibles acumulados: los de "Categoría Básica" se exigen a todas las categorías, los de "Media" a MEDIA y ALTA, y los de "Alta" sólo a ALTA (CCN-STIC 808 §5). Un sistema medio responde los de básica y los de media.
nivel_madurez_requerido es el mínimo CMM que el auditor exige a cada
medida según la categoría (CCN-STIC 808 §6), con su code y su
name: BÁSICA → L2 "Reproducible, pero intuitivo", MEDIA → L3
"Proceso definido", ALTA → L4 "Gestionado y medible". essential marca los
requisitos cuyo incumplimiento hace que la medida entera cuente como no
implantada.
Inputs: limit, cursor, compact, integridad, +8 more. Returns: object
create_ddaC
Crea y persiste una DdA completa para un sistema o subsistema.
Inputs: profile (required), record_id (required), subsystem_id. Returns: object
declaracion_aplicabilidadBRead-onlyIdempotent
Medidas y refuerzos exigibles a un sistema, para su DdA.
Cada dimensión toma "bajo", "medio" o "alto" — el nivel al que está valorada en ese sistema (Anexo I). Se acepta "basico" por compatibilidad y se omite si el sistema no la valora. Hay que valorar al menos una.
Devuelve la categoría del sistema (el mayor de esos niveles) y, por
cada medida exigible, el nivel al que se le exige y los refuerzos de
ese nivel. Un refuerzo con alternative: true es una opción entre
varias: basta implantar uno de los marcados así en ese nivel.
Inputs: limit, cursor, compact, integridad, +6 more. Returns: object
evaluate_system_profileCRead-onlyIdempotent
Evalúa un perfil completo y sus subsistemas contra el Anexo II.
Los máximos se calculan con las dimensiones del sistema, sus activos de información y sus servicios. Cada resultado conserva la justificación y el origen que llevó a ese nivel. Los subsistemas pueden heredar esos máximos o evaluarse de forma aislada.
Inputs: profile (required). Returns: object
evidencias_auditoriaARead-onlyIdempotent
Qué documentación puede pedir el auditor, por medida.
code: una medida concreta, p. ej. "org.1". Omitido, todas. Un código que no sea una medida del Anexo II es un error.
Responde a "¿qué papeles preparo?", que es el trabajo de las
semanas previas a la auditoría. Se une por measure_code con lo que
devuelven alcance_auditoria y declaracion_aplicabilidad.
Fuente: CCN-STIC 808 §6.2, no el ENS Navegable.
Inputs: code. Returns: result
explain_applicabilityCRead-onlyIdempotent
Explica por qué una medida aplica, no aplica o fue forzada por un perfil.
Inputs: code (required), profile (required), subsystem_id. Returns: object
export_ddaARead-onlyIdempotent
Exporta una DdA como JSON, CSV, Markdown, XLSX, ODS o DOCX en base64.
Inputs: record_id (required), output_format (required). Returns: object
get_ddaBRead-onlyIdempotent
Obtiene una DdA persistida con todas sus medidas y evidencias.
Inputs: record_id (required). Returns: object
get_measureCRead-onlyIdempotent
Obtiene una medida de seguridad por su código exacto, p. ej. "org.1".
Inputs: code (required). Returns: object
list_categoriesARead-onlyIdempotent
Lista todas las categorías del Anexo II (org, op.pl, mp.if, ...).
Inputs: no named parameters. Returns: result
list_data_packsBRead-onlyIdempotent
Lista los crosswalks externos, su procedencia, cobertura y vigencia.
Inputs: include_inactive. Returns: result
list_ddaBRead-onlyIdempotent
Lista las DdA persistidas y el recuento de sus estados.
Inputs: no named parameters. Returns: result
list_measuresBRead-onlyIdempotent
Lista medidas de seguridad con filtros opcionales.
category_code: código de categoría o grupo, p. ej. "mp.if" o "mp". Uno que no sea una categoría del Anexo II es un error: todas las categorías tienen medidas, así que una lista vacía sólo podía significar que el argumento no era una categoría. dimension: "confidencialidad", "integridad", "disponibilidad", "autenticidad" o "trazabilidad". level: "bajo", "medio" o "alto". Se acepta "basico" por compatibilidad.
Inputs: level, limit, cursor, compact, +3 more. Returns: result
query_crosswalkCRead-onlyIdempotent
Consulta un crosswalk por medida ENS o referencia del otro marco.
Inputs: pack_id (required), limit, cursor, ens_code, +2 more. Returns: object
requisitos_articulosARead-onlyIdempotent
Comprobaciones de auditoría sobre el articulado del RD 311/2022.
Una auditoría verifica el articulado además del Anexo II, y esta es esa mitad: las preguntas documentales y de gobierno (Declaración de Aplicabilidad firmada, categorización, INES, perfiles...) por las que suele empezar el auditor.
evidence son los documentos que la guía propone que pida.
Fuente: CCN-STIC 808 §6.1, no el ENS Navegable.
Inputs: no named parameters. Returns: result
requisitos_auditoriaARead-onlyIdempotent
Preguntas del cuestionario de auditoría (CCN-STIC 808), en bruto.
code: una medida concreta, p. ej. "org.1". Omitido, devuelve el
cuestionario entero. Un código que no sea una medida del Anexo II
es un error, no una lista vacía: hay medidas cuyo cuestionario está
legítimamente vacío en un tramo, y las dos cosas no pueden
contestarse igual.
level: "basica", "media" o "alta" — las categorías oficiales del sistema.
tools. Filtra por la sección en que la guía imprime el
requisito ("Categoría Básica", "Media" y "Alta" respectivamente),
que NO es el temario de un sistema de esa categoría: los requisitos
son acumulativos y los de "Categoría Básica" se exigen a todas.
Para el temario real de un sistema usa alcance_auditoria.
Cada elemento trae essential: si uno esencial no se cumple, el auditor
considera la medida entera como no implantada. Ojo con code dentro de
una medida — es la etiqueta que imprime el sitio y se repite (hay cinco
"1.1" distintos en op.acc.5); lo que identifica un requisito es
position.
Inputs: code, level, limit, cursor, +1 more. Returns: result
search_measuresARead-onlyIdempotent
Busca medidas por texto: código, título, cuestionario, redacción del RD.
Mira el code, el title, la description (el cuestionario de la
CCN-STIC 808), el norm_text (lo que exige el RD 311/2022) y el text
de cada refuerzo. Ignora mayúsculas y tildes.
Inputs: query (required), limit, cursor, compact, +1 more. Returns: result
snapshot_statusBRead-onlyIdempotent
Devuelve el origen y la frescura de los datos servidos.
Inputs: no named parameters. Returns: object
update_dda_measure_statusB
Actualiza estado, responsable, evidencias, excepciones y fechas de una medida.
Inputs: code (required), record_id (required), implementation_status (required), owner, +7 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 19 tools
Most tools target clearly distinct resources, and the descriptions carefully delineate siblings like declaracion_aplicabilidad (applicability/DdA), alcance_auditoria (audit syllabus), evaluate_system_profile (profile scoring), and explain_applicability (per-measure reasoning). There is still residual overlap among these four applicability/audit-oriented tools since some share identical arguments, which could invite misselection.
The English tools follow a fairly consistent verb_noun pattern (get_measure, list_measures, create_dda, update_dda_measure_status), but five tools use Spanish noun phrases (declaracion_aplicabilidad, alcance_auditoria, evidencias_auditoria, requisitos_articulos, requisitos_auditoria), breaking the pattern. The set remains readable but mixes two conventions.
At 19 tools the surface is somewhat heavy but each tool maps to a plausible ENS task (measure lookup, DdA lifecycle, audit requirements, crosswalks, data freshness). No obvious redundancy that inflates the count artificially, though a few audit/query tools sit close together.
DdA lifecycle is well covered (create, get, list, update status, export) plus measure retrieval, search, crosswalks, and multiple audit-requirement views. Minor gaps exist—no delete_dda and no measure-level editing—but agents can work around them.
Maintenance
Related MCP Connectors
Offline IBAN/BIC/EU VAT/card/ISBN/GTIN validators + live USD stablecoin peg-health verdict.
Validate IBAN, BIC, VAT, national IDs, phones, postal codes offline; 240+ identifiers.
Offline US medical code lookup and crosswalk — ICD-10-CM/PCS, HCPCS Level II, RxNorm. Keyless.
Offline, keyless lookup of the US civil aircraft registry — decode N-numbers, search records.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides structured access to the full NIST cybersecurity catalog, including SP 800/1800 publications, security controls, CSF 2.0, and the NVD database. It enables AI assistants to search and retrieve cybersecurity standards, CVEs, and compliance guidance directly from a local SQLite index.201MIT
- AlicenseAqualityFmaintenanceEnables querying Portuguese cybersecurity regulations, guidance, advisories, and frameworks from CNCS via MCP-compatible clients.6Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables local security scanning and compliance gap analysis for code and text, detecting secrets, PII, and OWASP vulnerabilities, and assessing readiness across major frameworks like NCA, ISO 27001, NIST CSF, and SOC 2.-
- AlicenseAqualityCmaintenanceEnables users to query EU Carbon Border Adjustment Mechanism data offline: whether a Combined Nomenclature code is in scope, which default emission values apply for a given country of origin, and what the code describes. Every answer cites the legally binding act, the dated data version, and flags that the data itself is not legally binding.5MIT