
RenPy MCP 服务器 — 7 个工具,CJK 字体自动配置,570 行纯 Python。为 RenPy 视觉小说开发提供 AI 原生桥接。
概览
联络网址、communication website:https://space.bilibili.com/341162425?spm_id_from=333.788.0.0 email:[email protected] 一个MCP(模型上下文协议)服务器,允许AI代理与任'Py视觉小说项目交互——读取脚本、注入代码并自动验证一切。 任'Py 没有内置编辑器。开发者手动编写 .rpy 文本文件,然后点击“启动项目”进行测试。该 MCP 将任何 AI 代理(Claude、OpenCode、OpenClaw 等)都变成原生的 任'Py 开发助手——你用自然语言描述你想要的内容,AI 会写出有效的 任'Py 脚本,插入到正确位置,并自动编译验证。 - Python 3.12+ - 任'Py SDK 8.0+(compile_project和lint_project)- MCP Python SDK 一个 MCP(模型上下文协议)服务器,让 AI Agent 能够操作 任'Py 视觉小说项目——读取脚本、注入代码、自动编译验证。 任'Py 没有内置编辑器,开发者需要手动编写 .rpy 文本文件,然后点「启动项目」测试。这个 MCP 让任何 AI Agent 都可以成为 任'Py 的原生开发助手——你用自然语言描述需求,AI 生成正确的 任'Py 脚本、插入到正确位置、自动编译验证。 1. 用 list_labels 查看项目结构 2.用 read_script 阅读现有脚本 3.
概述(AI 翻译)
英文 |中文
联络网址、communication website:https://space.bilibili.com/341162425?spm_id_from=333.788.0.0 email:[email protected]
英语
一个MCP(模型上下文协议)服务器,允许AI代理与任’Py视觉小说项目交互——读取脚本、注入代码并自动验证一切。
用FastMCP构建的。
为什么?
任’Py 没有内置编辑器。开发者手动编写 .rpy 文本文件,然后点击“启动项目”进行测试。该 MCP 将任何 AI 代理(Claude、OpenCode、OpenClaw 等)变成原生的 任’Py 开发助手——你用自然语言描述你想要的内容,AI 会写出有效的 任’Py 脚本,插入到正确位置,并自动编译验证。
工具
| 工具 | 描述 |
|---|---|
list_labels |
扫描项目并列出所有标签 |
read_script |
阅读特定标签的完整剧本内容 |
exec_rpy |
注入/替换任’Py代码(7种定位模式,自动创建文件,CJK字体自动设置) |
compile_project |
编译.rpy文件并可选强制缓存清除 |
lint_project |
对项目进行静态分析 |
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Ren’Py MCP Server
联络网址、communicate website:https://space.bilibili.com/341162425?spm_id_from=333.788.0.0 email:[email protected]
English
An MCP (Model Context Protocol) server that lets AI agents interact with Ren’Py visual novel projects — read scripts, inject code, and validate everything automatically.
Built with FastMCP.
Why?
Ren’Py has no built-in editor. Developers manually write .rpy text files and click “Launch Project” to test. This MCP turns any AI agent (Claude, OpenCode,OpenClaw etc.) into a native Ren’Py development assistant — you describe what you want in natural language, the AI writes valid Ren’Py script, inserts it at the right location, and auto-compiles to verify.
Tools
| Tool | Description |
|---|---|
list_labels |
Scan a project and list all labels |
read_script |
Read the full script content of a specific label |
exec_rpy |
Inject/replace Ren’Py code (7 positioning modes, auto-creates files, CJK font auto-setup) |
compile_project |
Compile .rpy files with optional forced cache clear |
lint_project |
Run static analysis on a project |
copy_asset |
Copy images, fonts, audio into a project (auto game/ prefix) |
get_image_size |
Get image dimensions for sprite positioning calculations |
Quick Start
# Clone
git clone https://github.com/Muanchen2/renpy-mcp.git
cd renpy-mcp
# Install
python -m venv .venv
.venv\Scripts\pip install -e .
# Run
.venv\Scripts\python -m renpy_mcp.server
MCP Config
Add to ~/.workbuddy/mcp.json:
{
"mcpServers": {
"renpy-mcp": {
"command": "D:\\path\\to\\renpy-mcp\\.venv\\Scripts\\python.exe",
"args": ["-m", "renpy_mcp.server"],
"env": {
"PYTHONPATH": "D:\\path\\to\\renpy-mcp\\src"
}
}
}
}
Requirements
- Python 3.12+
- Ren’Py SDK 8.0+ (for
compile_projectandlint_project) - MCP Python SDK
License
MIT — see LICENSE
中文
一个 MCP(模型上下文协议)服务器,让 AI Agent 能够操作 Ren’Py 视觉小说项目——读取脚本、注入代码、自动编译验证。
基于 FastMCP 构建。
为什么做这个?
Ren’Py 没有内置编辑器,开发者需要手动编写 .rpy 文本文件,然后点「启动项目」测试。这个 MCP 让任何 AI Agent 都可以成为 Ren’Py 的原生开发助手——你用自然语言描述需求,AI 生成正确的 Ren’Py 脚本、插入到正确位置、自动编译验证。
7 个工具
| 工具 | 功能 |
|---|---|
list_labels |
扫描项目,列出所有 label |
read_script |
读取指定 label 的完整脚本 |
exec_rpy |
注入/替换 Ren’Py 代码(7种定位,自动建文件,CJK字体自动配置) |
compile_project |
编译 .rpy 文件,支持强制清缓存 |
lint_project |
静态分析项目代码质量 |
copy_asset |
拷贝图片/字体/音频到项目(自动补 game/ 前缀) |
get_image_size |
获取图片尺寸,用于立绘位置计算 |
⚠️ AI Agent 使用前请先阅读 AI_GUIDE.md —— 包含完整工作流、常见坑和 9 大禁止事项。
快速开始
同上 English 部分。
演示流程
- 用
list_labels查看项目结构 - 用
read_script阅读现有脚本 - 用
exec_rpy注入新对话/角色/image/screen - 用
compile_project验证语法 - 在 Ren’Py Launcher 点「Launch Project」看效果
要求
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"renpy-mcp": {
"command": "D:\\path\\to\\renpy-mcp\\.venv\\Scripts\\python.exe",
"args": ["-m", "renpy_mcp.server"],
"env": {
"PYTHONPATH": "D:\\path\\to\\renpy-mcp\\src"
}
}
}
}