rfcxml-mcp
A Model Context Protocol (MCP) server for structured understanding of RFC documents.
README
RFCXML MCP Server
A Model Context Protocol (MCP) server for structured understanding of RFC documents.
Purpose
Unlike existing text-based RFC MCP servers, this server leverages the semantic structure of RFCXML to enable:
- Normative requirements extraction (MUST/SHOULD/MAY) with structured output
- RFC dependency graph construction
- Definition scope management
- Implementation checklist generation
Architecture
┌─────────────────────────┐
│ Markdown / PDF │ Display & Sharing
├─────────────────────────┤
│ Translation │ Explanation & Verification
├─────────────────────────┤
│ RFCXML MCP │ Common Understanding for AI & Humans
├─────────────────────────┤
│ RFCXML │ Single Source of Truth
└─────────────────────────┘
Comparison with Existing MCPs
| Feature | Existing mcp-rfc | RFCXML MCP |
|---|---|---|
| RFC text retrieval | ✅ | ✅ |
| Section extraction | ✅ (text-based) | ✅ (structure-based) |
| MUST/SHOULD/MAY extraction | ❌ | ✅ |
| Condition/exception structuring | ❌ | ✅ |
| RFC dependency graph | ❌ | ✅ |
| Definition scope management | ❌ | ✅ |
| Implementation checklist | ❌ | ✅ |
Quick Start
Using with Claude Desktop / Claude Code
Add the following to your MCP configuration file:
{
"mcpServers": {
"rfcxml": {
"command": "npx",
"args": ["-y", "@shuji-bonji/rfcxml-mcp"]
}
}
}
Configuration file locations:
- Claude Desktop (macOS):
~/Library/Application Support/Claude/claude_desktop_config.json - Claude Desktop (Windows):
%APPDATA%\Claude\claude_desktop_config.json - Claude Code:
.claude/settings.jsonor useclaude settingscommand
Installation (Optional)
For global installation:
npm install -g @shuji-bonji/rfcxml-mcp
# MCP configuration
{
"mcpServers": {
"rfcxml": {
"command": "rfcxml-mcp"
}
}
}
Available Tools
Phase 1: Basic Structure
get_rfc_structure- Get section hierarchy and metadataget_requirements- Extract normative requirements (MUST/SHOULD/MAY) with structureget_definitions- Get term definitions and their scope
Phase 2: Relationships
get_rfc_dependencies- Get referenced RFCs (normative/informative)get_related_sections- Get related sections within the same RFC
Phase 3: Verification Support
validate_statement- Verify if a statement complies with RFC requirementsgenerate_checklist- Generate implementation checklist
Legacy RFC Support
RFCs published after RFC 8650 (December 2019) are available in official RFCXML v3 format. Earlier RFCs may not have XML available.
This server includes automatic fallback functionality - when XML is unavailable, it parses the text format instead.
Source Information
All responses include source information:
{
"rfc": 6455,
"sections": [...],
"_source": "text",
"_sourceNote": "⚠️ Parsed from text format. Accuracy may be lower."
}
_source |
Description |
|---|---|
xml |
Parsed from RFCXML (high accuracy) |
text |
Parsed from text (medium accuracy) |
Compatibility
| RFC | Format | Notes |
|---|---|---|
| RFC 8650+ | XML | Official RFCXML v3 support |
| Before RFC 8650 | Text | Automatic fallback |
Output Samples
get_rfc_structure - Get RFC Structure
{
"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 - Extract Normative 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 - Get RFC Dependencies
{
"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 - Generate Implementation 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)
Text Fallback Output (Legacy RFCs)
{
"metadata": {
"title": "The WebSocket Protocol",
"number": 6455
},
"sections": [
{ "number": "1", "title": "Introduction" },
{ "number": "5", "title": "Data Framing" }
],
"_source": "text",
"_sourceNote": "⚠️ Parsed from text format. Accuracy may be lower."
}
Examples
See the examples/ directory for complete checklist samples:
| RFC | Protocol | Source |
|---|---|---|
| RFC 6455 | WebSocket | Text (fallback) |
| RFC 9293 | TCP | RFCXML |
| RFC 7540 | HTTP/2 | Text (fallback) |
Example prompt for Claude:
Generate an implementation checklist for RFC 9293 (TCP).
Internal Architecture
Module Structure
src/
├── index.ts # MCP server entry point
├── config.ts # Centralized configuration
├── constants.ts # BCP 14 keyword definitions
├── services/
│ ├── rfc-fetcher.ts # RFC fetching (parallel)
│ ├── rfcxml-parser.ts # RFCXML parser
│ └── rfc-text-parser.ts # Text fallback parser
├── tools/
│ ├── definitions.ts # MCP tool definitions
│ └── handlers.ts # Tool handlers
├── types/
│ └── index.ts # Type definitions
└── utils/
├── cache.ts # LRU cache
├── fetch.ts # Parallel fetch utility
└── text.ts # Text processing utility
RFC Fetch Optimization
Sends parallel requests to multiple sources (RFC Editor, IETF Tools, Datatracker) and uses the first successful response:
┌─────────────────┐
│ fetchRFCXML() │
└────────┬────────┘
│ Parallel requests
┌────┴────┬────────────┐
▼ ▼ ▼
┌────────┐ ┌────────┐ ┌────────┐
│RFC │ │IETF │ │Data- │
│Editor │ │Tools │ │tracker │
└────┬───┘ └────┬───┘ └────┬───┘
│ │ │
└────┬─────┴──────────┘
│ Promise.any (first success)
▼
┌───────────┐
│ Successful│ → Cancel other requests via AbortController
│ Response │
└───────────┘
Cache Strategy
LRU (Least Recently Used) cache with memory limits:
| Cache | Max Entries | Content |
|---|---|---|
| XML Cache | 20 | Raw RFCXML |
| Text Cache | 20 | Raw text |
| Metadata Cache | 100 | RFC metadata |
| Parse Cache | 50 | Parsed structure |
Development
# Install dependencies
npm install
# Development mode
npm run dev
# Build
npm run build
# Test
npm test
# Lint
npm run lint
# Format
npm run format
License
MIT
Related Projects
- mjpitz/mcp-rfc - Text-based RFC MCP
- ietf-tools/RFCXML - RFCXML schema
- xml2rfc - IETF official tool
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。