S1000D BREX (S1000D Stack)

io.github.shuji-bonji由 GitHub 账号 shuji-bonji 发布v0.6.0更新于 Nov 7, 2026

Read S1000D BREX business rules and check data modules against them, layer by layer.

已验证STDIO仅桌面文件与存储开发者工具

概览

AI 生成的概览

读取 S1000D BREX 业务规则数据模块,并逐层检查数据模块是否符合这些规则,报告每处违规。

可以做什么
  • 列出并筛选 BREX 中的规则:目标、允许/必需/禁止状态、允许值、严重级别及适用 schema
  • 查询 SNS 编码或元素、属性值在项目中的含义与允许取值
  • 列出可用的插图和多媒体 notation,含按 schema 的限制
  • 检查数据模块、出版模块或注释是否符合 BREX,返回每处违规的 XPath、行号、规则 ID 和严重级别
  • 沿 brexDmRef 链逐层检查,并标出无法解析的层
适用场景
适合在编写或审阅 S1000D 技术文档时使用,让助手解释项目的 BREX 规则,或指出数据模块在何处违反规则,而无需手工阅读 XML。
运行要求
通过 npx 在本地运行(需要 Node.js)。需要自行从 s1000d.org 获取的 S1000D 发行包,并用 S1000D_SPEC_DIR 指向其解压目录;项目数据模块通过 S1000D_CSDB_DIR 或 csdbDirs 参数指定。无法传环境变量时,可在 ~/.config/s1000d-stack/config.json 配置目录。无需认证。
安装前请注意
它不做 XML schema 校验,schema 错误可能掩盖或造成 BREX 违规误报;passed 仅表示在能解析的各层中没有违反可机器检查的规则,只有 unresolvedBrex 为空时结果才完整。散文式规则以人工检查项返回,严重级别代码不作解释。以 HTTP 方式绑定非回环地址时不校验 Host 和 Origin,且没有认证,应置于反向代理之后。

安装

在 SourceWeft 中

  1. 打开 控制台中的 S1000D BREX (S1000D Stack),将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@shuji-bonji/s1000d-brex-mcp

English | 日本語

An MCP server that lets an LLM read S1000D® BREX (Business Rules Exchange) data modules and check data modules against a BREX. It returns, in a form people can read, what a project or organisation has written in its BREX: which elements and attributes may be used, which values are allowed and what they mean, what the standard numbering system (SNS) codes mean, and which illustration formats may be used. It also reports whether a data module follows those rules, with the location of each violation.

[!IMPORTANT] This is a personal project and is not affiliated with ASD (Aerospace, Security and Defence Industries Association of Europe). S1000D® is a registered trademark of ASD. The S1000D specification, XML schemas, default BREX and official samples are not included in any package or repository, because their terms of use do not grant redistribution. Obtain them from s1000d.org and point the S1000D_SPEC_DIR environment variable at the extracted folder.

What it does

ToolDescription
explain_brexLists the rules of a BREX. Returns the target (XPath), whether it may be used (forbidden, required or optional), the allowed values and their meaning, the severity level and the schemas the rule applies to. Narrow the list with kind, context and search, and read it in parts with offset and limit
lookup_snsReturns what a standard numbering system (SNS) code refers to, from a DMC or a code
lookup_valueReturns what an element or attribute value means in the project, and which values are allowed
list_notationsReturns the illustration and multimedia formats that may be used, split into the base set (baseSet), exclusions from the base set (baseExcluded) and the per-schema redefinitions and exclusions (perContext). With context, it returns how that schema is restricted in effectiveFor.mode (closed = only allowed may be used, open = only excluded are forbidden, unrestricted = this BREX does not restrict notations). A BREX with exclusions only is open
check_against_brexChecks a data module against a BREX and returns each violation with its location (XPath and line number), actual value, rule ID, description and severity level. By default it follows the brexDmRef chain (project BREX → … → default BREX) and checks each layer separately. A publication module (PM) or a comment can also be checked; its brexDmRef in pmStatus / commentStatus is followed

What it does not do

[!WARNING]

  • It does not validate against the XML schema (XSD). Schema errors can hide BREX violations or create false ones. Run schema validation with validate_schema / verify_data_module in s1000d-verify-mcp.
  • It does not judge conformance to S1000D. passed: true from check_against_brex means only that no machine-checkable BREX rule was violated in every layer that could be resolved. nonContextRules (rules written as prose) are returned as manualChecks, and a person makes the judgement.
  • It does not interpret the meaning of severity level codes (brsl01 to brsl99). The project defines them, so they are returned as they are.

[!NOTE] The absence of a rule in one BREX does not mean the absence of a restriction. A higher BREX (followed through brexDmRef, ending at the S1000D default BREX) or a business rules document written for people may restrict it. check_against_brex reports the layers it could not find in unresolvedBrex. Treat a result in which this field is not empty as incomplete.

Configuration

Environment variableDescription
S1000D_SPEC_DIRThe folder where the S1000D distribution you obtained is extracted. The default BREX (DMC-S1000D-*-04-10-0301-00A-022A-D_*.XML) is searched for under it. Extract the inner zip files as well
S1000D_CSDB_DIRThe folder that holds the project's data modules. Several folders can be given, separated by : (; on Windows). A BREX given by DMC, and the layers of the chain, are searched for here

Folders can also be given with the tool argument csdbDirs. When the argument is given, only those folders are used; S1000D_CSDB_DIR and csdbDirs in the config file are not used (they are not added together). The default BREX is still looked up under S1000D_SPEC_DIR. Folders that do not exist are skipped and listed in _notes of the response. A BREX can be given as a file path, as a DMC (the DMC- prefix is optional), or omitted (the default BREX).

A mistake that the caller can fix by changing an argument is returned not as a tool failure (isError) but as error: { code, path, detail }, the same shape as the other S1000D Stack servers. code is one of file-not-found (no such file), not-found (the BREX given by DMC, or the default BREX, was not found) and input-error (an argument is malformed or missing), and path names the argument to fix (/brex, /path and so on).

Config file (when environment variables are not passed, as with plugins in Claude Desktop)

If S1000D_SPEC_DIR / S1000D_CSDB_DIR are not set, the server reads the config file ~/.config/s1000d-stack/config.json (under XDG_CONFIG_HOME if it is set; S1000D_CONFIG changes the location). Claude Desktop does not pass environment variables to servers installed as plugins, and does not substitute ${VAR} written in the plugin's env. When you install the server as a plugin, write the folders here.

json
{  "specDir": "/path/to/s1000d/issue-7",  "csdbDirs": ["/path/to/your/csdb"]}

Environment variables take precedence when they are set. Paths that start with ~/ are accepted. The config file is read again on every call, so the server does not need to be restarted after you edit it.

Example configuration for Claude Desktop / Claude Code

json
{  "mcpServers": {    "s1000d-brex": {      "command": "npx",      "args": ["-y", "@shuji-bonji/s1000d-brex-mcp"],      "env": {        "S1000D_SPEC_DIR": "/path/to/s1000d/issue-7",        "S1000D_CSDB_DIR": "/path/to/project/csdb"      }    }  }}

Running over HTTP (embedding in a product)

The default is stdio. With --http the server starts over Streamable HTTP, so a CSDB product's server or a web application can call it over HTTP (the embedding foundation of stage 2.5).

sh
npx -y @shuji-bonji/s1000d-brex-mcp --http                      # http://127.0.0.1:3000/mcpnpx -y @shuji-bonji/s1000d-brex-mcp --http --port 3100 --path /brex
ArgumentDefaultMeaning
--host127.0.0.1Address to bind to
--port3000Port; 0 picks a free port
--path/mcpPath of the MCP endpoint. GET /healthz returns the name and version
--allowed-host(see below)Host names allowed in the Host header; comma-separated or repeated
--allowed-origin(see below)Host names allowed in the Origin header

When --host is a loopback address (127.0.0.1 / ::1 / localhost), Host and Origin are limited to localhost names (DNS rebinding protection). When bound to any other address they are not checked, so put the server behind the product's reverse proxy or authentication. Authentication, authorization and multi-tenancy are not part of this server. Environment variables and the config file work the same as with stdio.

Check rules

The check follows Chap 4.10.2 (BREX data module) and Chap 7.9 (Business rules processing) of S1000D Issue 7. See the README of @shuji-bonji/s1000d-core for details.

ItemHandling
allowedObjectFlag0 = a violation if the target is present, 1 = a violation if it is absent, 2 = if present, the value is checked against objectValue (single / range / pattern)
rulesContextThe blocks whose schema matches the target data module, and the common blocks, are applied
notationRuleListA violation if a NOTATION declared in the DOCTYPE is not in the allowed set
LayersEach layer is checked separately; the layers are not merged. passed only when no layer has a violation and no reference is unresolved

Development

sh
npm installnpm run buildnpm test            # runs on self-made test data onlynpm run test:spec   # uses the S1000D distribution (set its location with S1000D_SPEC_DIR)

License

MIT

来源:README.md,提交 c0c68e4

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

3
  1. v0.6.0最新Nov 7, 2026
  2. v0.5.0Oct 29, 2026
  3. v0.1.1Oct 26, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分