MCP · Streamable HTTP

NovelAI over MCP: Claude Code, Cursor and VS Code

The AniworldAI MCP server gives agents NovelAI tools: draw an image, check a job, get the file or a link. It connects with a URL and a key in a header, the same key as for the OpenAI SDK and SillyTavern.

See plans

No card needed: 3 NovelAI images and 3 on Qwen-Image and FLUX, valid 7 days. The key appears here and in Telegram. API documentation (Swagger)

URL and authorization

MCP URL https://novelai.api.aniworldai.org/mcp
  • Transport: Streamable HTTP.
  • Authorization — the Authorization: Bearer YOUR_KEY header, the key without “api:”.
  • You need a client that lets you set a header. The server doesn’t support OAuth sign-in yet, so claude.ai and ChatGPT connectors, which require OAuth, won’t connect.

Claude Code

bash
claude mcp add --transport http novelai https://novelai.api.aniworldai.org/mcp --header "Authorization: Bearer YOUR_KEY"

By default the server is visible only to you and only in the current project; add --scope user for all projects. Don’t put the key into a shared project .mcp.json: everyone with the repository would see it.

Cursor

The ~/.cursor/mcp.json file (for all projects) or .cursor/mcp.json in a project:

JSON
{
  "mcpServers": {
    "novelai": {
      "url": "https://novelai.api.aniworldai.org/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_KEY"
      }
    }
  }
}

To keep the key out of the file, write "Bearer ${env:NOVELAI_KEY}" and set the NOVELAI_KEY environment variable.

VS Code

The .vscode/mcp.json file in a project. VS Code asks for the key when the server starts, so it doesn’t end up in the file:

JSON
{
  "servers": {
    "novelai": {
      "type": "http",
      "url": "https://novelai.api.aniworldai.org/mcp",
      "headers": {
        "Authorization": "Bearer ${input:novelai-key}"
      }
    }
  },
  "inputs": [
    {
      "type": "promptString",
      "id": "novelai-key",
      "description": "NovelAI API key",
      "password": true
    }
  ]
}

Tools

  • generate_image: draw an image from a prompt;
  • get_job: job status;
  • get_image: the finished image as PNG;
  • get_image_link: a temporary link to the image;
  • cancel_job: cancel a job before it is sent to NovelAI;
  • get_account: remaining quota, images per day on your plan, how many are used and when the whole limit comes back;
  • get_models: the model list.

Check without a client

MCP Inspector in command-line mode lists the tools:

bash
npx @modelcontextprotocol/inspector --cli https://novelai.api.aniworldai.org/mcp --transport http --header "Authorization: Bearer YOUR_KEY" --method tools/list
Questions

FAQ

Does it work in claude.ai or ChatGPT?

Not yet: their connectors require OAuth sign-in, and our server takes the key in a header. Connect from Claude Code, Cursor, VS Code and other clients that let you set a header.

Is it the same key as for SillyTavern?

Yes, one key for every format. In MCP it goes into the Authorization: Bearer header without the api: prefix.

How does the agent get the image?

generate_image creates a job; the agent fetches the finished image as a PNG file (get_image) or a temporary link (get_image_link).