pixiv-mcp-server

222wcnm/pixiv-mcp-server

3.2

If you are the rightful owner of pixiv-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A powerful Pixiv toolkit that enables large language models, such as Claude, to browse, search, and download Pixiv content through the Model Context Protocol (MCP).

Tools
3
Resources
0
Prompts
0

Pixiv MCP Server

A powerful Pixiv toolkit that empowers Large Language Models (like Claude / Cursor) to browse, search, and download content from Pixiv via the Model Context Protocol (MCP). Now featuring a brand-new card-based view for a more intuitive interactive experience.


✨ Key Features

πŸ› οΈ General Tools

  • next_page(): Fetches the next page of results from the previous command.
  • update_setting(key, value): Updates any server configuration at runtime (e.g., download_path).

πŸ“₯ Download Management

  • download(illust_id | illust_ids, ...): Asynchronously downloads specified artworks. Can accept optional parameters (webp_quality, gif_preset, etc.) to control ugoira conversion quality.
  • manage_download_tasks(task_id, action): Manages download tasks. Supports status and cancel actions.

πŸ” Search & Discovery

  • search_illust(word, ...): Searches for illustrations by keyword.
  • search_user(word, ...): Searches for users.
  • get_illust_ranking(mode, ...): Retrieves the illustration rankings.
  • get_illust_related(illust_id, ...): Gets recommended artworks related to the specified illustration.
  • get_illust_recommended(...): Fetches a list of official recommended illustrations (Authentication required).
  • get_trending_tags(): Gets the current trending tag trends.
  • get_illust_detail(illust_id): Retrieves detailed information for a single illustration.

πŸ‘₯ Community & User

  • get_follow_illusts(...): Fetches the latest works from followed artists (home feed) (Authentication required).
  • get_user_bookmarks(user_id_to_check, ...): Retrieves a user's bookmark list (Authentication required).
  • get_user_following(user_id_to_check, ...): Retrieves a user's following list (Authentication required).

βš™οΈ Output Views

To enhance the user experience in AI conversations, this toolkit introduces a view parameter to control the output format:

  • view='cards' (Default): Displays results as rich Markdown cards with embedded image previews. This is the recommended mode for its intuitive and visually appealing presentation.
  • view='raw': Returns the raw, unprocessed JSON data. This mode is suitable for programmatic use or when results need to be piped into other tools.

The default view is hardcoded as cards and cannot be changed via environment variables.

πŸ”§ Requirements

ComponentVersionNotes
Python3.10+Latest stable version is recommended.
FFmpegLatestOptional, for downloading Ugoira.
MCP Client-e.g., Claude for Desktop / Cursor.

πŸš€ Quick Start

Step 1: Clone or Download the Project

git clone https://github.com/222wcnm/pixiv-mcp-server.git
cd pixiv-mcp-server

Step 2: Install Dependencies (uv recommended)

# Install uv (if not already installed)
pip install uv

# Create a virtual environment and install dependencies
uv venv
uv pip install -e .

Step 3: Obtain Authentication Token

Run the authentication wizard:

python get_token.py

A .env file containing PIXIV_REFRESH_TOKEN will be created or updated automatically upon success.

Step 4: Launch and Configure

In your MCP client, use the following configuration:

{
  "mcpServers": {
    "pixiv-server": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/your/pixiv-mcp-server",
        "run",
        "pixiv-mcp-server"
      ],
      "env": {
        "PIXIV_REFRESH_TOKEN": "Copy from .env file or leave empty to read automatically",
        "DOWNLOAD_PATH": "./downloads",
        "FILENAME_TEMPLATE": "{author} - {title}_{id}",
        "DEFAULT_LIMIT": "10",
        "UGOIRA_FORMAT": "webp"
      }
    }
  }
}

Please replace /path/to/your/pixiv-mcp-server with the absolute path to the project's root directory.

βš™οΈ Environment Variables

Variable NameRequiredDescriptionDefault Value
PIXIV_REFRESH_TOKENβœ…Pixiv API authentication token.""
DOWNLOAD_PATH❌Root directory for downloaded files../downloads
FILENAME_TEMPLATE❌File naming template.{author} - {title}_{id}
UGOIRA_FORMAT❌Default format for ugoira conversion (webp/gif).webp
DEFAULT_LIMIT❌Default number of items for card view. (String is auto-cast)10
HTTPS_PROXY❌URL for the HTTPS proxy.""
PREVIEW_PROXY_ENABLED❌Enable the local image preview proxy (true/false).true
PREVIEW_PROXY_HOST❌Host for the local preview proxy.127.0.0.1
PREVIEW_PROXY_PORT❌Port for the local preview proxy.8643
DOWNLOAD_SEMAPHORE❌Number of concurrent downloads.8
CPU_BOUND_SEMAPHORE❌Number of concurrent CPU-intensive tasks (e.g., ugoira).2

πŸ”— Related Resources

⚠️ Disclaimer

This tool is intended to facilitate access to your personal Pixiv account content through modern AI tools. Please adhere to the Pixiv user agreement and respect copyright and creator rights. The developer assumes no responsibility for any account-related issues.


πŸ€– The code and documentation for this project were entirely generated by AI. While it has undergone structural analysis and functional testing, imperfections may still exist. Contributions via Issues/PRs to improve the experience are welcome.