NovelAI-Image-MCP: Instructions file for Codex

AGENTS.md

NovelAI-Image-MCP AGENTS.md is an instructions file for Codex, OpenCode from xinvxueyuan/NovelAI-Image-MCP. It costs 6,414 tokens per session, scanned A, original, MIT.

Project instructions for NovelAI Image MCP, a Python server that exposes NovelAI image-generation functions to AI assistants through the Model Context Protocol.

In plain words
What is it for?
Use them when changing the server, its image-generation tools, tests, documentation, or the surrounding Python and JavaScript workspace.
Why use it?
They explain the repository layout, required tools, commands, and constraints so development follows the project’s conventions.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md; built for cline.

This is xinvxueyuan/NovelAI-Image-MCP's own configuration. It tells Codex and OpenCode how to work on NovelAI-Image-MCP itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything NovelAI-Image-MCP configures →

Reuse

Borrowing it

Nothing to install: this file belongs to xinvxueyuan/NovelAI-Image-MCP. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/xinvxueyuan/NovelAI-Image-MCP/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/xinvxueyuan/NovelAI-Image-MCP

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for NovelAI-Image-MCP AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/xinvxueyuan/novelai-image-mcp/agents-md/github.svg)](https://agentmods.dev/instructions/xinvxueyuan/novelai-image-mcp/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/xinvxueyuan/novelai-image-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/xinvxueyuan/novelai-image-mcp/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for NovelAI-Image-MCP AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/xinvxueyuan/novelai-image-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/xinvxueyuan/novelai-image-mcp/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 6,414 This file is loaded in full into every session.
When invoked 6,414 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.06414 $0.06414
Opus 5.5 $0.02566 $0.02566
Sonnet 5.5 $0.01283 $0.01283
Haiku 4.5 $0.00641 $0.00641

Measured 15d ago against content hash 224137933e46, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

NovelAI-Image-MCP AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 15d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 307 lines

How it starts

The opening of the file, as written. The whole thing — 307 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

面向 AI agent 的仓库级上下文索引。完整开发者文档见 CONTRIBUTING.md 与 docs 站。 本文件只沉淀"约束 + 指针",避免与 docs 站重复。

项目是什么

NovelAI Image MCP —— 一个基于 fastmcp 4 (fastmcp>=4.1.0,<5,底层运行在 MCP SDK v2 mcp>=2.3.0 上)的模型上下文协议 服务器,把 NovelAI 图像生成 API 暴露为 11 个 MCP 工具、2 个 prompt、3 个资源 + 1 个资源模板,供 Claude Desktop / Cline / 自研 agent 调用。Python 3.13,MIT 协议。

仓库布局(uv + pnpm monorepo,Turbo 编排)

apps/server/  → 可安装的 MCP 服务器包(PyPI: novelai-image-mcp)
  src/novelai_image_mcp/
    nai/         # NovelAI HTTP 客户端(必须走 create_http_client())
    tools/       # 11 个 MCP 工具(模块级 @mcp.tool 装饰器)
    resources.py # novelai://models / samplers / defaults / outputs/{name}
    prompts.py   # novelai_prompt_writer / novelai_image_workflow
    middleware.py# 工具调用日志 + 分路审计 + 实验性工具双闸门控
    mcp_auth.py  # 可选 HTTP Bearer Token(MCP_AUTH_TOKEN / MCP_ROUTE_TOKENS)
    deps.py      # AppContext + Depends 依赖提供者(含 insiders / routing providers)
    insiders.py  # X-MCP-Insiders 头解析(纯逻辑,无 I/O)
    features.py  # INSIDERS_FEATURES 特性注册表 + resolve_features
    routing.py   # 声明头 → RoutingContext(route 白名单 + 头脱敏)
    audit.py     # append-only JSONL 审计(单次 os.write + O_APPEND)
    schemas.py   # 结构化输出模型(AnlasEstimate / TagSuggestion)
    server.py    # FastMCP 实例 + lifespan + 组件导入
    cli.py       # typer CLI(同步入口)
  tests/
  mcp_server.py  # fastmcp run/dev 入口(绕开相对导入问题)
  pyproject.toml # 版本号唯一权威源 + ruff/pyright/pytest 配置
fastmcp.json (根或 member) → fastmcp run 的声明式配置(source 指向 mcp_server.py)
apps/docs/    → Sphinx 文档站(Furo + MyST)
.github/      → workflows (ci/release/docs) + detect-changes composite action
pyproject.toml (根) → uv workspace 虚拟根(不可安装)
uv.lock       → 全仓库唯一锁文件

常用命令

uv sync                                              # 同步 Python workspace
uv run --directory apps/server poe check             # format-check + lint + typecheck + test
uv run reuse lint                                    # REUSE 合规
uv run --directory apps/server poe serve             # 启动 stdio 服务器
uv run --directory apps/server poe serve-http        # 启动 HTTP 服务器
uv run fastmcp run fastmcp.json                      # 标准 FastMCP 入口(仓库根)
uv run --directory apps/server poe inspect           # 组件/版本一览(fastmcp inspect)
uv run --directory apps/server poe dev               # MCP Inspector(交互调试)
pnpm docs:serve                                      # sphinx-autobuild 实时预览

Read the full file on GitHub · 307 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 15d ago Changed · +71 lines · +1,695 tokens per session 224137933e46
  2. 19d ago Changed · -3 lines · -15 tokens per session 3a9186f60e2c
  3. 23d ago Changed · +31 lines · +751 tokens per session 88357c0e381e
  4. 2mo ago First seen · 208 lines · 3,983 tokens per session scan A f5f78c33f8e4

Subscribe to this mod's changes

NovelAI-Image-MCP AGENTS.md is an instructions file published in the GitHub repository xinvxueyuan/NovelAI-Image-MCP (12 stars, last pushed yesterday), licensed MIT. It adds 6,414 tokens to every session, about $0.0257 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,719 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,461 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,334 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,792 tokens

generative-ai-for-beginners AGENTS.md

AGENTS.md instructions for microsoft/generative-ai-for-beginners, covering agents.md, project overview, setup commands, initial repository setup and clone the repository.

microsoft/generative-ai-for-beginners · 2,850 tokens