Skip to main content
Glama

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

--check-updates detects changes without replacing the served data

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

list_categories

—

The Annex II categories with their group (org, op, mp).

list_measures

category_code?, dimension?, level?

Measures filtered by category, security dimension or level.

get_measure

code

A measure by exact code (e.g. "org.1"), with its RD text, reinforcements and levels.

search_measures

query

Text search in code, title, description and RD wording (case- and accent-insensitive).

Applicability Statement and audit

Tool

Args

Description

declaracion_aplicabilidad

confidencialidad?, integridad?, disponibilidad?, autenticidad?, trazabilidad?

The base regulatory matrix to prepare the DdA: each dimension is rated (bajo/medio/alto, or omitted) and it returns the enforceable measures with their reinforcements.

alcance_auditoria

same as the DdA

The system's audit syllabus: the applicable measures with their accumulated verification questions and the minimum maturity level required.

requisitos_auditoria

code?, level?

The raw CCN-STIC 808 questionnaire, per measure or per tier, marking the essential requirements.

requisitos_articulos

—

The audit checks on the RD articles (formal DdA, categorization, INES...).

evidencias_auditoria

code?

The documentation the auditor may request, per measure.

Status and updates

Tool

Args

Description

refresh_live_page

—

Checks the official site now and updates the data if it has changed.

snapshot_status

—

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_status indicates which edition it comes from.

To regenerate the snapshot:

python scripts/build_snapshot.py

The server does not open Chrome or use the network by default. To check for changes explicitly:

ensmcp --offline
ensmcp --check-updates
ensmcp --live

It 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 xvfb on servers without one)

Installation

To use the server from PyPI:

pip install ensmcp
ensmcp --offline

To enable the live check:

pip install "ensmcp[live]"
ensmcp --check-updates

Development

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 chromium

On a freshly installed Linux it may also be necessary:

patchright install-deps chromium

pyproject.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.toml

Quick start

python -m ensmcp

Configure 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 ensmcp

Contributing

Contributions are welcome.

  1. Fork the repository

  2. Create your feature branch (git checkout -b feature/new-feature)

  3. Commit your changes (git commit -m 'Add new feature')

  4. Push the branch (git push origin feature/new-feature)

  5. 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


Available Tools

19 tools
alcance_auditoriaA
Read-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_aplicabilidadB
Read-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_profileC
Read-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_auditoriaA
Read-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_applicabilityC
Read-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_ddaA
Read-onlyIdempotent

Exporta una DdA como JSON, CSV, Markdown, XLSX, ODS o DOCX en base64.

Inputs: record_id (required), output_format (required). Returns: object

get_ddaB
Read-onlyIdempotent

Obtiene una DdA persistida con todas sus medidas y evidencias.

Inputs: record_id (required). Returns: object

get_measureC
Read-onlyIdempotent

Obtiene una medida de seguridad por su código exacto, p. ej. "org.1".

Inputs: code (required). Returns: object

list_categoriesA
Read-onlyIdempotent

Lista todas las categorías del Anexo II (org, op.pl, mp.if, ...).

Inputs: no named parameters. Returns: result

list_data_packsB
Read-onlyIdempotent

Lista los crosswalks externos, su procedencia, cobertura y vigencia.

Inputs: include_inactive. Returns: result

list_ddaB
Read-onlyIdempotent

Lista las DdA persistidas y el recuento de sus estados.

Inputs: no named parameters. Returns: result

list_measuresB
Read-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_crosswalkC
Read-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_articulosA
Read-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_auditoriaA
Read-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_measuresA
Read-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_statusB
Read-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

    B3.2/5.0

    Scored across 19 tools

    Disambiguation4/5

    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.

    Naming Consistency3/5

    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.

    Tool Count4/5

    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.

    Completeness4/5

    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

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Provides 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.
      20
      1
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables 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.
      -
    • A
      license
      A
      quality
      C
      maintenance
      Enables 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.
      5
      MIT