批量文件重命名MCP服务器 - 功能强大、安全可靠的文件重命名工具
Wellknown found it in public sources; nobody has proven control of it yet. Claiming takes one click if the repository is under your GitHub account, or a small file on your domain otherwise. Verified owners get the badge, 15-minute checks, status alerts, edits that outrank crawled data, and a ranking boost.
Agents can do it too: POST https://wellknown.network/api/v1/claims with {"agent":"batch-rename-mcp","method":"well_known_file"} — machine-readable steps at claim.json, guide at /docs/claim.
Everything here was measured by our prober or read from a registry. Nothing is self-reported.
Attributed to the source that supplied each field. Treated as claims, not facts.
# 批量文件重命名 MCP 服务器 [](https://python.org) [](LICENSE) [](https://github.com/anthropics/model-context-protocol) 功能强大、安全可靠的文件批量重命名工具,基于 MCP (Model Context Protocol) 构建,支持多种重命名模式和安全预览。 ## ✨ 核心特性 ### 🎯 多样化重命名模式 - **模板变量**: 使用 `{name}`, `{counter}`, `{date}`, `{time}` 等变量 - **正则表达式**: 支持复杂的模式匹配和替换,包括捕获组 - **大小写转换**: `upper:`, `lower:`, `title:` 转换文件名大小写 - **序号格式化**: 支持零填充格式如 `{counter:03d}` ### 🛡️ 安全性保障 - **预览模式**: 执行前预览所有更改,避免意外操作 - **路径安全验证**: 防止路径遍历攻击和非法文件名 - **原子性操作**: 操作失败时自动回滚,保证文件系统一致性 - **冲突解决**: 智能处理文件名冲突,支持跳过、覆盖、自动编号 ### 📋 操作日志管理 - **完整日志记录**: 记录每次重命名操作的详细信息 - **一键撤销**: 支持撤销最近的重命名操作 - **历史查询**: 查看操作历史和统计信息 ### 🔍 文件扫描功能 - **智能扫描**: 支持递归扫描和文件类型过滤 - **详细信息**: 显示文件大小、修改时间、权限等信息 - **性能优化**: 支持最大文件数限制,避免内存溢出 ## 🚀 快速开始 ### 安装要求 - Python 3.10 或更高版本 - MCP 1.0.0 或更高版本 ### 安装方式 ```bash # 使用 pip 安装 pip install batch-rename-mcp # 或者从源码安装 git clone https://github.com/fengjinchao/batch-rename-mcp.git cd batch-rename-mcp pip install -e . ``` ### 基本使用 ```bash # 启动 MCP 服务器 batch-rename-mcp # 或者使用 Python 模块方式 python -m src.server ``` ## 📖 使用指南 ### 1. 批量重命名工具 (batch_rename) #### 基本语法 ```json { "target": "/path/to/files", "pattern": "重命名模式", "options": { "dry_run": true, "recursive": false, "file_filter": "*.jpg", "conflict_resolution": "auto_number" } } ``` #### 重命名模式详解 ##### 模板变量模式 ```bash # 添加序号 "photo_{counter:03d}" # photo_001.jpg, photo_002.jpg # 使用原文件名 "backup_{name}" # backup_image.jpg # 添加日期时间 "IMG_{date}_{counter}" # IMG_20240919_1.jpg # 组合使用 "{date}_{name}_{counter:02d}" # 20240919_photo_01.jpg ``` ##### 正则表达式模式 ```bash # 基本替换 "regex:^test:fjc1" # test_file.jpg -> fjc1_file.jpg # 忽略大小写 "regex:IMG:PHOTO:i" # IMG_123.jpg -> PHOTO_123.jpg # 使用捕获组 "regex:IMG…
Mapped onto the structured taxonomy from declared text and observed tool names. Confidence shown for derived entries.
Every source is kept verbatim. Field changes are logged as events.