Skip to main content
Glama

RFCXML MCP 服务器

npm version CI License: MIT Node.js Claude Code

日本語版 README

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

目的

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

  • 规范性要求提取 (MUST/SHOULD/MAY) 并提供结构化输出

  • RFC 依赖关系图 构建

  • 定义范围管理

  • 实现检查清单生成

Related MCP server: Unstructured Document Processor MCP

架构

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

与现有 MCP 的比较

功能

现有的 mcp-rfc

RFCXML MCP

RFC 文本检索

✅

✅

章节提取

✅ (基于文本)

✅ (基于结构)

MUST/SHOULD/MAY 提取

❌

✅

条件/异常结构化

❌

✅

RFC 依赖关系图

❌

✅

定义范围管理

❌

✅

实现检查清单

❌

✅

快速入门

在 Claude Desktop / Claude Code 中使用

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

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

配置文件位置:

  • Claude Desktop (macOS): ~/Library/Application Support/Claude/claude_desktop_config.json

  • Claude Desktop (Windows): %APPDATA%\Claude\claude_desktop_config.json

  • Claude Code (项目范围): 项目根目录下的 .mcp.json

  • Claude Code (用户范围): ~/.claude.json

  • Claude Code (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 - 提取具有结构的规范性要求 (MUST/SHOULD/MAY)

  • get_definitions - 获取术语定义及其范围

第二阶段:关系

  • get_rfc_dependencies - 获取引用的 RFC (规范性/参考性)

  • get_related_sections - 获取同一 RFC 内的相关章节

第三阶段:验证支持

  • 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."
}

示例

查看 examples/ 目录以获取完整的检查清单示例:

RFC

协议

源

RFC 6455

WebSocket

文本 (回退)

RFC 9293

TCP

RFCXML

RFC 7540

HTTP/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 Editor, IETF Tools, Datatracker)发送并行请求,并使用第一个成功的响应:

┌─────────────────┐
│  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

原始文本

元数据缓存

100

RFC 元数据

解析缓存

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

许可证

MIT

相关项目

Available Tools

7 tools
generate_checklistB

Generate RFC implementation checklist in Markdown format.

Inputs: rfc (required), role, sections, includeSubsections.

get_definitionsC

Get term definitions from RFC.

Inputs: rfc (required), term.

get_requirementsA

Extract normative requirements (MUST/SHOULD/MAY) from RFC in structured format.

Inputs: rfc (required), section, level.

get_rfc_dependenciesB

Get RFC reference relationships (normative/informative).

Inputs: rfc (required), includeReferencedBy.

get_rfc_structureC

Get RFC section hierarchy and metadata.

Inputs: rfc (required), includeContent.

validate_statementC

Validate if a statement complies with RFC requirements.

Inputs: rfc (required), statement (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose targeting specific aspects of RFC analysis, with no overlap in functionality. For example, get_definitions extracts terms, get_requirements extracts normative language, and get_rfc_structure provides metadata, making misselection unlikely.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case, such as get_definitions, validate_statement, and generate_checklist. This predictability enhances readability and usability for agents.

    Tool Count5/5

    With 7 tools, the server is well-scoped for RFC analysis, covering key operations like extraction, validation, and dependency mapping. Each tool earns its place without feeling excessive or insufficient for the domain.

    Completeness4/5

    The toolset provides comprehensive coverage for analyzing RFCs, including structure, definitions, requirements, and dependencies, with minor gaps such as lacking tools for editing or updating RFC content, but core workflows are well-supported.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that enables Large Language Models to search and access IETF RFC documents with pagination support.
      3
      13
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that enables programmatic access to IETF RFC documents, allowing users to fetch, search, and extract specific sections from RFCs.
      3
      20
      Apache 2.0
    • A
      license
      B
      quality
      D
      maintenance
      An MCP server for obtaining, parsing and reading RFC documents from the ietf.org website, providing programmatic interactive tools.
      3
      2
      Apache 2.0