mcp rfc编辑器
mcp名称:io.github.daedalus/mcp-rfc-editor
MCP(模型上下文协议)服务器,用于使用 rfc-editor Python库。
安装
pip install mcp-rfc-editor用法
命令行界面
python -m mcp_rfc_editor程序化
from mcp_rfc_editor import main
main()MCP工具
服务器公开了以下工具:
load_rfc-加载并解析RFC TXT文件(创建会话)download_rfc-按ID从RFC编辑器下载RFC(创建会话)create_rfc-创建一个新的空RFC文档(创建会话)get_document-从会话上下文中获取当前文档save_rfc-将RFC文档保存为TXT格式set_title-设置文档标题set_abstract-设置文档摘要add_section-添加新章节update_section-更新现有部分delete_section-删除一个部分list_sections-列出文档中的所有部分set_copyright-设置版权声明set_authors-设置文档作者to_dict-将文档转换为词典
基于会话的工作流
服务器维护会话上下文,因此您不需要在每次调用时传递完整的文档对象:
# 1. Download an RFC - returns Session ID
result = download_rfc(rfc_id="791")
# Returns: {document..., "Session ID": "abc-123"}
# 2. Use session ID to get title (no document needed)
get_title(session_id="abc-123")
# 3. Modify and changes are persisted
set_title(session_id="abc-123", title="New Title")或者,您始终可以传递完整的 document 直接对象(传统模式)。
发展
需求
- Python 3.11+
- 主控程序
- rfc编辑器
设置
pip install -e ".[dev]"测试
pytest tests/掉毛
black src/ tests/
ruff check src/ tests/