NovelAI MCP Server
基于 novelai-python SDK 的 MCP 服务器,为 AI 助手提供 NovelAI 图像生成能力。
✨ 功能
| 工具 | 说明 |
|---|---|
generate_image |
文生图,支持多角色定位、Vibe Transfer、Precise Reference |
img2img |
图生图,基于已有图片变换 |
suggest_tags |
Danbooru 标签搜索/自动补全 |
check_subscription |
查询订阅状态和 Anlas 余额 |
支持模型
| 名称 | 模型 ID | 说明 |
|---|---|---|
v4.5-full |
nai-diffusion-4-5-full | 最新最完整(默认) |
v4.5-curated |
nai-diffusion-4-5-curated | 更干净的数据集 |
v4-full |
nai-diffusion-4-full | V4 Full |
v4-curated |
nai-diffusion-4-curated-preview | V4 预览 |
v3 |
nai-diffusion-3 | V3(老款) |
🚀 快速开始
前置条件
- Python 3.11+
- NovelAI API Key(以
pst-开头,从 novelai.net 获取)
方式一:通过 PyPI 安装(推荐)
# 使用 uvx 直接运行(无需手动安装)
NOVELAI_API_KEY=pst-xxx uvx novelai-mcp
# 或者用 pip 安装
pip install novelai-mcp
NOVELAI_API_KEY=pst-xxx novelai-mcp
方式二:从源码安装
# 克隆项目
git clone https://github.com/hesoyamlp1/MCP-NovelAI.git
cd MCP-NovelAI
# 使用 uv 安装依赖
uv sync
# 运行
NOVELAI_API_KEY=pst-xxx uv run novelai-mcp
运行选项
# Stdio 模式(默认,Claude Desktop / Antigravity / Cursor)
NOVELAI_API_KEY=pst-xxx novelai-mcp
# HTTP 模式(LobeChat / Dify)
NOVELAI_API_KEY=pst-xxx novelai-mcp --transport streamable-http --port 3000
# 或者使用 .env 文件
cp .env.example .env
# 编辑 .env 填入你的 API Key
novelai-mcp
调试
# 使用 MCP Inspector
uvx mcp dev src/novelai_mcp/server.py
🔧 接入配置
Claude Desktop / Antigravity / Cursor
通过 PyPI(推荐):
{
"mcpServers": {
"novelai": {
"command": "uvx",
"args": ["novelai-mcp"],
"env": {
"NOVELAI_API_KEY": "pst-xxx"
}
}
}
}
从源码:
{
"mcpServers": {
"novelai": {
"command": "uv",
"args": ["run", "--directory", "/path/to/MCP-NovelAI", "novelai-mcp"],
"env": {
"NOVELAI_API_KEY": "pst-xxx"
}
}
}
}
LobeChat / Dify
启动 HTTP 模式后,在客户端配置:
- URL:
http://localhost:3000/mcp - 传输: Streamable HTTP
🌍 环境变量
| 变量 | 必需 | 说明 |
|---|---|---|
NOVELAI_API_KEY |
✅ | NovelAI API Key |
NOVELAI_SAVE_DIR |
❌ | 图片自动保存目录 |
HTTPS_PROXY |
❌ | HTTPS 代理地址 |
📄 许可证
MIT
Metadata
Release files for novelai-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| novelai_mcp-0.1.0.tar.gz | 136.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| novelai_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 150.0 kB
Release files / novelai_mcp-0.1.0.tar.gz
| Download URL | novelai_mcp-0.1.0.tar.gz |
|---|---|
| Size | 136.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
714a2d4b48091a4486cb2743998217e7a6167667e1b1e20c13705148a3ae040f
|
|
BLAKE2b-256 checksum How to use checksums |
94de02c3b46ab8511a9816f3ff59b779725fc08e1d1c12082b999ea90b19014b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / novelai_mcp-0.1.0-py3-none-any.whl
| Download URL | novelai_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0cbef5b16d24097cdf102abbbe4b6382cf92d494e9247c96b2d5ee62e9a9d845
|
|
BLAKE2b-256 checksum How to use checksums |
e2a6a638efa7c7fc0a47939fe3cdbaccf5e373435f6c57f2440166acfce71af8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for novelai-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.