NovelAI Image MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@NovelAI Image MCPCreate an image of a cozy cabin in a snowy forest at twilight"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
NovelAI Image MCP
An MCP (Model Context Protocol) server that exposes NovelAI image generation as tools for AI agents (Claude Desktop, Cline, custom agents, remote clients).
Built on the official MCP Python SDK v2 (MCPServer), it lets an agent generate
images (txt2img / img2img / inpaint), upscale, run Director tools (line art,
emotion, background removal, ā¦), annotate with ControlNet, suggest tags, encode
vibes, and query account subscription ā all through the standard MCP tool
interface.
š Documentation: https://xinvxueyuan.github.io/NovelAI-Image-MCP/
Features
11 MCP tools covering the full NovelAI image API surface.
Two transports: stdio (local agents) + streamable-http (remote / multi-client).
Dual image return: base64
Imagecontent blocks (the agent sees the image) and PNG saved to disk (path returned as text).Async + sync: async tool handlers + a
typerCLI for direct invocation.Monorepo: uv workspace (Python) + pnpm workspace (Node tooling) orchestrated by Turbo; MIT-licensed, Docker-ready, GitHub Pages docs.
Related MCP server: comfyui-mcp-server-node
Repository layout
This is a uv + pnpm monorepo:
NovelAI-Image-MCP/
āāā apps/
ā āāā server/ # MCP server (the installable PyPI package)
ā ā āāā src/novelai_image_mcp/ # 11 MCP tools + NovelAI HTTP client
ā ā āāā tests/
ā ā āāā docker/ # smoke-test entrypoint
ā ā āāā Dockerfile # built with repo root as context
ā ā āāā pyproject.toml # ruff / pyright / pytest config
ā āāā docs/ # Sphinx documentation site
ā āāā source/ # MyST Markdown + conf.py
ā āāā Makefile
ā āāā pyproject.toml
āāā .github/ # workflows, CODEOWNERS, issue templates
āāā pyproject.toml # uv workspace root (virtual)
āāā uv.lock # single shared lockfile
āāā pnpm-workspace.yaml # pnpm workspace declaration
āāā pnpm-lock.yaml # Node toolchain lockfile
āāā turbo.json # cross-workspace task graph
āāā package.json # root scripts + dev toolchain
āāā docker-compose.yml # local container orchestrationSee CONTRIBUTING.md for the developer guide and
apps/docs/source/ for the full documentation source.
Quick start
Install from source (development)
# 1. Clone
git clone https://github.com/xinvxueyuan/NovelAI-Image-MCP.git
cd NovelAI-Image-MCP
# 2. Sync the uv workspace (installs server + docs + dev tools)
uv sync
# 3. Configure credentials
cp .env.example .env
# set NOVELAI_TOKEN=... (preferred)
# or NOVELAI_USERNAME + NOVELAI_PASSWORD
# 4. Run (stdio ā for local agents)
uv run python -m novelai_image_mcp serve
# 5. Or over HTTP
MCP_TRANSPORT=streamable-http uv run python -m novelai_image_mcp serve
# ā http://127.0.0.1:8000/mcpInstall from PyPI (runtime only)
pip install novelai-image-mcp
export NOVELAI_TOKEN=pst-...
novelai-image-mcp serveOptional: Node tooling (contributors)
If you plan to contribute, install the cross-cutting Node toolchain (turbo, husky, markdownlint) via pnpm:
corepack enable pnpm # one-time
pnpm install --frozen-lockfileThis wires the husky pre-commit + commit-msg hooks and gives you turbo /
markdownlint-cli2 for local development. The MCP server has zero Node
runtime dependencies ā this step is only for contributors.
Connect an agent
The MCP server supports two transports (stdio + http), all configured under
mcpServers:
stdio (local agent ā Claude Desktop / Cline)
claude_desktop_config.json:
{
"mcpServers": {
"novelai-image": {
"type": "stdio",
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/NovelAI-Image-MCP",
"python",
"-m",
"novelai_image_mcp",
"serve"
],
"env": {
"NOVELAI_TOKEN": "${input:novelai_token}"
}
}
}
}Alternative: uvx (published package)
{
"mcpServers": {
"novelai-image": {
"command": "uvx",
"args": ["--prerelease=allow", "novelai-image-mcp", "serve"],
"env": { "NOVELAI_TOKEN": "pst-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }
}
}
}Set NOVELAI_TOKEN (or NOVELAI_USERNAME + NOVELAI_PASSWORD) in the host
environment before launching ā uvx inherits the parent shell env.
http (remote / Docker deployment)
After docker compose up --build (server listens on http://HOST:8000/mcp):
{
"mcpServers": {
"novelai-image-http": {
"type": "http",
"url": "http://127.0.0.1:8000/mcp",
"headers": {
"Authorization": "Bearer pst-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
}Replace http://127.0.0.1:8000/mcp with your self-deployed endpoint (e.g.
https://mcp.example.com/mcp behind a TLS-terminating reverse proxy). Swap
the literal token placeholder for a host-managed secret reference if your
MCP host supports one (Claude Desktop, Cline, etc. expose this via their
own secrets UI).
CLI (sync, for scripting)
uv run python -m novelai_image_mcp generate --prompt "a cat, masterpiece" --width 832 --height 1216
uv run python -m novelai_image_mcp upscale --image ./in.png --factor 4
uv run python -m novelai_image_mcp info # subscription / Anlas balance
uv run python -m novelai_image_mcp --helpTools
Tool | Description |
| Text-to-image (V3 / V4 / V4.5 models, character prompts, vibes) |
| Image-to-image with strength/noise |
| Inpainting (requires an inpaint model + mask) |
| 2Ć / 4Ć upscale |
| Line art / sketch / bg-removal / declutter / colorize / emotion |
| ControlNet annotation (hed, midas, scribble, mlsd, uniformer) |
| Prompt tag suggestions |
| Encode a reference image into a vibe token |
| Account subscription + Anlas balance |
| Account user data |
| Estimate Anlas cost for a generation (no API call) |
See the tools reference on the docs site for parameters and examples.
Configuration
All settings are environment variables (see .env.example). Key ones:
Variable | Default | Notes |
| ā | Persistent API token (preferred auth) |
| ā | Access-key login (argon2id) |
|
| Where generated PNGs are saved |
|
|
|
|
| For streamable-http |
NovelAI API reference: https://image.novelai.net/docs/index.html
Development
The project is a uv + pnpm monorepo orchestrated by Turbo. See
CONTRIBUTING.md for the full setup; the short version:
uv sync # Python workspace (server + docs + dev)
pnpm install --frozen-lockfile # Node toolchain (turbo + husky + markdownlint)
pnpm check # lint + typecheck + test (all workspaces)
pnpm docs:build # build the docs site
pnpm server:serve # run the MCP server
pnpm docs:serve # sphinx-autobuild with live reloadPer-member commands (via uv):
uv run --directory apps/server ruff check src tests # lint
uv run --directory apps/server -m pyright # typecheck
uv run --directory apps/server -m pytest # testsDocker
docker compose up --build # builds and runs the server (HTTP transport)The Dockerfile lives at apps/server/Dockerfile but
the build context is the repository root (so uv can resolve the workspace
graph). See docker-compose.yml.
Documentation
The Sphinx documentation site is built with Furo + MyST Markdown and
auto-deploys to GitHub Pages on every push to main:
Source:
apps/docs/source/Build locally:
pnpm docs:serve
License
MIT ā see LICENSE. Per-file SPDX annotations live in
REUSE.toml. Contributions are subject to the
Developer Certificate of Origin (the
commit-msg hook signs off commits automatically).
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceMCP server that wraps OpenAI's image generation and editing APIs, enabling text-to-image and image-to-image operations via tools.Last updated61337ISC
- Alicense-qualityCmaintenanceA lightweight MCP server that bridges AI agents with a local ComfyUI instance to generate and iteratively refine images, audio, and video through conversational tool calls.Last updated30MIT
- Flicense-qualityDmaintenanceAn MCP server for AI-powered image processing (generate, edit, vary, analyze) supporting OpenAI, Gemini, Ideogram, and custom relay endpoints.Last updated
- Alicense-qualityDmaintenanceMCP server that provides image generation, captioning, and tagging via ComfyUI API, configurable for agent tools.Last updated3MIT
Related MCP Connectors
MCP server for Flux AI image generation
MCP server for NanoBanana AI image generation and editing
MCP server for AI dialogue using various LLM models via AceDataCloud
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/xinvxueyuan/NovelAI-Image-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server