Colregs Mcp

io.github.mark-brannan由 GitHub 账号 mark-brannan 发布v0.0.7更新于 Nov 5, 2026

Not for navigation. Pre-release preview: COLREGS Part C night lights, international text only.

已验证STDIO仅桌面位置与生活知识与记忆

概览

AI 生成的概览

本地 MCP 服务器,依据 COLREGS(C 部分号灯)回答问题,并附条文引用与原文,供助手评估船舶号灯与相遇局面。

可以做什么
  • 评估船舶所处情形(自身事实、他船、环境条件),返回信号、评估、他船可能身份与合规判定
  • 查询 COLREGS 某段、整条规则或段落范围的原文
  • 获取某盏灯的规则 21 定义:颜色、灯质、水平光弧与安装位置
  • 每个回答都附带条文引用及所引条文的逐字原文
适用场景
适合让助手依据国际避碰规则分析号灯显示或相遇中的让路关系,并要求精确条文引用而非改写。它是预发布预览版,宜作为学习与起草辅助,而非实际操作用途。
运行要求
以本地 stdio 进程运行,通常通过 npx 启动 colregs-mcp 包(需 Node.js),也可从克隆仓库构建后运行。无需环境变量、请求头、账号或 API 密钥。运行时不联网,仅安装过程使用网络。
安装前请注意
明确不可用于航行:它是基于预发布规则数据的 0.0.x 预览版,其输出不得用于决定水上行动。工具接口可能随时变更。仅覆盖国际文本,且仅限 C 部分号灯。它不收集数据,自身也不发起网络请求。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

colregs-mcp

[!WARNING] Not for navigation. This is a preview (0.0.x) built on pre-release rule data. Do not use its output to decide what to do on the water. The tool surface will change without notice.

An MCP server that answers questions under the COLREGS. Every answer carries its paragraph cites and the verbatim rule text those cites resolve to, so a language model cannot quietly simplify it. The rules are evaluated by colregs-engine; this package only decides how the answer is written down.

Try it

Claude Code:

bash
claude mcp add colregs -- npx -y colregs-mcp

Claude connector directory: in Claude, open Settings → Connectors, search for COLREGS and click Connect. No configuration is needed.

Any other MCP client: command npx, arguments -y colregs-mcp, no environment.

From a clone:

bash
git clone https://github.com/mark-brannan/colregs-mcp && cd colregs-mcp && npm install && npm run build

then command node, argument /absolute/path/to/colregs-mcp/dist/cli.js.

Tools

toolinputreturns
evaluatecircumstancesone evaluation: appraisal, signals, indicated, compliance
rule_textcitethe verbatim text of a COLREGS paragraph
lightidone light's definition: colour, character, arc, placement

evaluate

circumstances is the whole picture one vessel is in: self (her own facts), others (each other vessel, with what is known or observed of her) and conditions (visibility, environment). One call evaluates the picture; the response carries four readings of it.

  • signals: every complete, lawful set of lights self may show. Each light carries its modality (shall, may, shall-if-practicable) and the paragraph that prescribes it.
  • appraisal: what the Rules require of self on her own, and then against each other vessel: the kind of encounter, whether risk of collision is asserted, and each vessel's role (stand-on, give-way, shall-not-impede).
  • indicated: for each other vessel, what her observed lights, shapes and sounds indicate she could be.
  • compliance: over a track of circumstances sampled through time, one verdict per vessel per obligation that attached: kept, breached or pending.

Every id travels with its paragraph cite, and cited_paragraphs holds the verbatim text of every paragraph the response cites. The input vocabulary is generated from the colregs data package at startup. A key or value outside it is an error, never an empty answer.

rule_text

Takes a paragraph path such as 25(b) or 26(c)(i), a bare rule number such as 25 for every paragraph of that rule, or a range such as 24(a)(ii)-(iv). Returns the International text as transcribed from the USCG amalgamated Navigation Rules, with its source and retrieval date.

light

Takes a light id as it appears in a response, such as light:sidelights or light:all_round. Returns the Rule 21 definition: colour, character, arc in degrees and placement.

Example

A 12 m sloop under way, alone.

json
{  "circumstances": {    "self": {      "fact:propulsion": "propulsion:sail",      "fact:activity": "activity:none",      "fact:position": "position:underway",      "fact:length_m": 11.6    }  }}

Trimmed response:

json
{  "colregs": { "version": "0.3.4" },  "signals": {    "applied": [      { "id": "rule:25a", "cite": "25(a)", "modality": "modality:shall" },      { "id": "rule:25b", "cite": "25(b)", "modality": "modality:may" },      { "id": "rule:25c", "cite": "25(c)", "modality": "modality:may" }    ],    "lawful_displays": {      "count": 3,      "relation": "any_one_of",      "options": [        {          "option": 1,          "of": 3,          "lights": [            {              "light": "light:sidelights",              "modality": "modality:shall",              "prescribed_by": { "id": "rule:25a", "cite": "25(a)" }            },            {              "light": "light:sternlight",              "modality": "modality:shall",              "prescribed_by": { "id": "rule:25a", "cite": "25(a)" }            }          ]        },        { "option": 2, "of": 3, "...": "..." },        { "option": 3, "of": 3, "...": "..." }      ]    },    "modality_key": { "modality:shall": "mandatory", "modality:may": "permitted alternative" },    "cited_paragraphs": {      "25(a)": "A sailing vessel underway shall exhibit: (i) sidelights; (ii) a sternlight.",      "25(b)": "…",      "25(c)": "…"    }  },  "appraisal": { "self": { "...": "..." }, "others": [] },  "indicated": []}

The sloop has three lawful displays, because the Rules give her the choice and nothing in the input settles it.

docs/demo.md puts the same question to the same model with and without this server and shows both answers as captured.

Response shape

Three properties hold for every response:

  1. Cited, verbatim. Every entry id travels with its paragraph cite, and cited_paragraphs holds the text of every paragraph cited. The only sentences in a response are the Rules' own.
  2. Modality per light. shall, may and shall-if-practicable are kept on each light, not summarised per display. modality_key is a one-line glossary of the modalities the response uses.
  3. Plural by construction. lawful_displays opens with count and relation before any lights appear, and each option numbers itself n of count. There is no top-level lights field to mistake for the answer.

A vessel that lawfully shows nothing gets one empty display, not an error. An error is reserved for input outside the vocabulary.

Every response carries colregs.version. The server refuses to start if its own copy of colregs and the engine's are different releases.

Dependencies

colregs-engine and colregs are installed from GitHub main, not from npm releases; the lockfile pins the commit. Both must resolve the same release.

Privacy Policy

The server collects nothing. It runs as a local stdio process, answers from the colregs data package installed beside it, and makes no network request of its own. There is no telemetry, no logging of what it is asked, and no account. The only network transaction is the install itself, which is npm's.

Releasing

Automatic from the release tag: npm and the MCP registry. The by-hand steps (Smithery, the Claude directory plugin bundle) are in docs/releasing.md.

Licence

AGPL-3.0-only. The fitness-for-navigation disclaimer in colregs carries over.

来源:README.md,提交 49fcf48

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:服务器未能启动。

版本历史

4
  1. v0.0.7最新Nov 5, 2026
  2. v0.0.6Oct 31, 2026
  3. v0.0.5Oct 21, 2026
  4. v0.0.4Oct 20, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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