Token导航 LogoToken导航TokenDH.com
Rfcxml MCP logo
文档知识未说明官方级别未说明来源级核验

Rfcxml MCP

MCP Server

一个用于结构化理解RFC文档的模型上下文协议(MCP)服务器,支持规范要求提取、RFC依赖图构建和实现清单生成。

工具数

8

提示词数

0

GitHub Stars

2

资源数

0
TypeScriptClaude文档处理Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

shuji-bonji

提供方

shuji-bonji

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

RFCXML MCP服务器

](https://www.npmjs.com/package/@shuji-bonji/rfcxml-mcp) ![CI](https://github.com/shuji-bonji/rfcxml-mcp/actions/workflows/ci.yml) ![License: MIT](https://opensource.org/licenses/MIT) ](https://nodejs.org/) ![Claude Code](https://claude.ai/code)

日本语版README

一种模型上下文协议(MCP)服务器 结构化理解 RFC文档。

目的

与现有的基于文本的RFC MCP服务器不同,该服务器利用RFCXML的语义结构来实现:

  • 规范性要求提取 (必须/应该/可能)具有结构化输出
  • RFC依赖关系图 建设
  • 定义范围管理
  • 实施检查表生成

建筑

┌─────────────────────────┐
│  Markdown / PDF         │  Display & Sharing
├─────────────────────────┤
│  Translation            │  Explanation & Verification
├─────────────────────────┤
│  RFCXML MCP             │  Common Understanding for AI & Humans
├─────────────────────────┤
│  RFCXML                 │  Single Source of Truth
└─────────────────────────┘

与现有MCP的比较

功能现有mcp-rfcRFCXML mcp
RFC文本检索
章节提取✅ (基于文本)✅ (基于结构)
必须/应该/可以提取
条件/例外结构
RFC依赖关系图
定义范围管理
实施检查表

快速开始

使用克劳德桌面/Claude代码

将以下内容添加到MCP配置文件中:

{
  "mcpServers": {
    "rfcxml": {
      "command": "npx",
      "args": ["-y", "@shuji-bonji/rfcxml-mcp"]
    }
  }
}

配置文件位置:

  • 克劳德桌面(macOS): ~/Library/Application Support/Claude/claude_desktop_config.json
  • 克劳德桌面(Windows): %APPDATA%\Claude\claude_desktop_config.json
  • 克劳德代码(项目范围): .mcp.json 从项目根源
  • 克劳德代码(用户范围): ~/.claude.json
  • 克劳德代码(CLI): claude mcp add rfcxml -- npx -y @shuji-bonji/rfcxml-mcp

安装(可选)

对于全局安装:

npm install -g @shuji-bonji/rfcxml-mcp

然后配置MCP:

{
  "mcpServers": {
    "rfcxml": {
      "command": "rfcxml-mcp"
    }
  }
}

可用工具

第一阶段:基本结构

  • get_rfc_structure -获取节层次结构和元数据
  • get_requirements -用结构提取规范性要求(必须/应该/可能)
  • get_definitions -获取术语定义及其范围

第二阶段:关系

  • get_rfc_dependencies -获取引用的RFC(规范性/信息性)
  • get_related_sections -获取同一RFC中的相关部分

第3阶段:验证支持

  • validate_statement -验证语句是否符合RFC要求
  • generate_checklist -生成实施检查表

传统RFC支持

在RFC 8650(2019年12月)之后发布的RFC以官方RFCXML v3格式提供。早期的RFC可能没有XML可用。

此服务器包括 自动回退 功能-当XML不可用时,它会解析文本格式。

源信息

所有回复均包含源信息:

{
  "rfc": 6455,
  "sections": [...],
  "_source": "text",
  "_sourceNote": "Warning: Parsed from text format. Accuracy may be limited."
}
_source说明
xml从RFCXML解析(高精度)
text从文本解析(中等精度)

兼容性

RFC格式注释
RFC 8650+XML官方支持RFCXML v3
RFC 8650之前文本自动回退

输出样本

get_rfc_structure -获取RFC结构

{
  "metadata": {
    "title": "Transmission Control Protocol (TCP)",
    "docName": "draft-ietf-tcpm-rfc793bis-28",
    "number": 9293
  },
  "sections": [
    {
      "number": "section-1",
      "title": "Purpose and Scope"
    },
    {
      "number": "section-3",
      "title": "Functional Specification",
      "subsections": [
        { "number": "section-3.1", "title": "Header Format" },
        {
          "number": "section-3.5",
          "title": "Establishing a Connection",
          "subsections": [
            { "number": "section-3.5.1", "title": "Half-Open Connections and Other Anomalies" },
            { "number": "section-3.5.2", "title": "Reset Generation" }
          ]
        }
      ]
    }
  ],
  "referenceCount": { "normative": 15, "informative": 85 },
  "_source": "xml"
}

get_requirements -提取规范性要求

{
  "rfc": 9293,
  "filter": { "level": "MUST" },
  "stats": { "total": 53, "byLevel": { "MUST": 53 } },
  "requirements": [
    {
      "id": "R-section-3.5-5",
      "level": "MUST",
      "text": "A TCP implementation support simultaneous open attempts (MUST-10).",
      "section": "section-3.5",
      "sectionTitle": "Establishing a Connection"
    },
    {
      "id": "R-section-3.7.1-9",
      "level": "MUST",
      "text": "TCP endpoints implement both sending and receiving the MSS Option (MUST-14).",
      "section": "section-3.7.1",
      "sectionTitle": "Maximum Segment Size Option"
    }
  ],
  "_source": "xml"
}

get_rfc_dependencies -获取RFC依赖关系

{
  "rfc": 9293,
  "normative": [
    { "rfcNumber": 791, "title": "Internet Protocol", "anchor": "RFC0791" },
    { "rfcNumber": 2119, "title": "Key words for use in RFCs to Indicate Requirement Levels" },
    { "rfcNumber": 5681, "title": "TCP Congestion Control" }
  ],
  "informative": [
    { "rfcNumber": 793, "title": "Transmission Control Protocol" },
    { "rfcNumber": 1122, "title": "Requirements for Internet Hosts - Communication Layers" }
  ],
  "_source": "xml"
}

generate_checklist -生成实施检查表

# RFC 9293 Implementation Checklist

**Transmission Control Protocol (TCP)**

Role: Client

## Required (MUST / REQUIRED / SHALL)

- [ ] A TCP implementation support simultaneous open attempts (MUST-10). (section-3.5)
- [ ] TCP endpoints implement both sending and receiving the MSS Option (MUST-14). (section-3.7.1)
- [ ] The RTO be computed according to the algorithm in, including Karn's algorithm (MUST-18). (section-3.8.1)

## Optional (MAY / OPTIONAL)

- [ ] Implementers include "keep-alives" in their TCP implementations (MAY-5). (section-3.8.4)

文本回退输出(传统RFC)

{
  "metadata": {
    "title": "The WebSocket Protocol",
    "number": 6455
  },
  "sections": [
    { "number": "1", "title": "Introduction" },
    { "number": "5", "title": "Data Framing" }
  ],
  "_source": "text",
  "_sourceNote": "Warning: Parsed from text format. Accuracy may be limited."
}

示例

请参阅 示例/ 完整检查表样本目录:

RFC协议来源
RFC 6455WebSocket文本(回退)
RFC 9293TCPRFCXML
RFC 7540HTTP/2文本(回退)

Claude的示例提示:

Generate an implementation checklist for RFC 9293 (TCP).

内部架构

模块结构

src/
├── index.ts                    # MCP server entry point
├── config.ts                   # Centralized configuration
├── constants.ts                # BCP 14 keyword definitions + RFC number limits
├── services/
│   ├── rfc-fetcher.ts          # RFC fetching (parallel)
│   ├── rfc-service.ts          # RFC parse & cache management
│   ├── rfcxml-parser.ts        # RFCXML parser
│   ├── rfc-text-parser.ts      # Text fallback parser
│   └── checklist-generator.ts  # Checklist generation service
├── tools/
│   ├── definitions.ts          # MCP tool definitions
│   └── handlers.ts             # Tool handlers (toolHandlers map)
├── types/
│   └── index.ts                # Type definitions
└── utils/
    ├── cache.ts                # LRU cache
    ├── fetch.ts                # Parallel fetch utility
    ├── logger.ts               # Logger abstraction
    ├── requirement-extractor.ts # Shared requirement extraction
    ├── section.ts              # Section search utilities
    ├── statement-matcher.ts    # Weighted statement matching
    ├── text.ts                 # Text processing utility
    └── validation.ts           # Input validation

RFC获取优化

向多个源(RFC编辑器、IETF工具、数据跟踪器)发送并行请求,并使用第一个成功的响应:

┌─────────────────┐
│  fetchRFCXML()  │
└────────┬────────┘
         │ Parallel requests
    ┌────┴────┬────────────┐
    ▼         ▼            ▼
┌────────┐ ┌────────┐ ┌────────┐
│RFC     │ │IETF    │ │Data-   │
│Editor  │ │Tools   │ │tracker │
└────┬───┘ └────┬───┘ └────┬───┘
     │          │          │
     └────┬─────┴──────────┘
          │ Promise.any (first success)
          ▼
    ┌───────────┐
    │ Successful│ → Cancel other requests via AbortController
    │ Response  │
    └───────────┘

缓存策略

具有内存限制的LRU(最近最少使用)缓存:

缓存最大条目数内容
XML缓存20原始RFCXML
文本缓存20原始文本
元数据缓存100RFC元数据
解析缓存50解析结构

发展

# Install dependencies
npm install

# Development mode
npm run dev

# Build
npm run build

# Test (watch mode)
npm test

# Test (single run — for CI etc.)
npm test -- --run

# E2E test (MCP client integration)
npm run test:e2e

# Lint
npm run lint

# Format
npm run format

许可证

麻省理工学院

相关项目

目录标签

目录标签

TypeScriptClaude文档处理RFC解析本地部署协议分析技术文档处理规范要求提取RFC依赖管理

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

部署方式(deploymentType,部署类型)

remote-capable

工具数量(toolCount,工具数)

8

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明noneremote-capable

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP