Skip to main content
Glama

mira_live2d · DSH Mascot Plugin

Ports xhqm-live2d (WordPress plugin) to a native DSH plugin: the mascot appears as a floating overlay in the conversation interface, and the model can speak, switch expressions, switch models, and play motions via MCP tools, with expressions automatically switching based on "thinking / awaiting confirmation / idle" states.

Installation (any DSH web profile)

This plugin is a dependency-free pure ESM package: the host side only uses Node built-in modules, and the browser-side runtime library is bundled in assets/lib/.

1. Install the package

dsh plugin --profile web add github:xhqm-xyz/mira_live2d

You can also clone it and install from a local path:

git clone https://github.com/xhqm-xyz/mira_live2d.git
dsh plugin --profile web add ./mira_live2d

2. Register it in the profile

Append to the insert list in ~/.dsh/profiles/web/cordis.patch.yml:

- id: mira_live2d
  name: 'mira_live2d'
  config:
    model: StellaMira          # 初始模型(model 目录名)
    position: right
    tts:
      enabled: false
      provider: openai         # 或 alibaba;base 可覆盖为任意 OpenAI 兼容端点
      keyEnv: 'OPENAI_API_KEY' # 建议用环境变量;或用 key 填字面量(仅本机私有配置)

For the API key, use tts.keyEnv (environment variable name) or tts.key (private config file on this machine only). Never commit it to the repository.

3. Restart

dsh web

After refreshing the page, the mascot appears in the bottom-right corner of the conversation interface.

Related MCP server: live2d-to-agent

Models

Models go in the model/ directory, one subdirectory per model, and each directory must contain a *.model3.json file (see model/README.md). mira_list_models scans automatically.

Frontend Interaction

  • Drag to move: mouse / single-finger drag (position remembered in localStorage)

  • Zoom: mouse wheel (desktop) / pinch (mobile), 0.25× ~ 3× (zoom remembered); on mobile, scales by mobileScale by default

  • Menu: right-click (desktop) / long-press (mobile) to bring up the expression / motion menu

  • Expression stacking: expression items in the menu are stacking toggles; click to turn on/off (active items are marked with ); "Default expression" clears all expressions and stacks

  • Bubble: mira_speak / mira_bubble / thinking-waiting prompts are displayed here

MCP Tools (callable by the model, prefixed with mira_)

Tool

Description

mira_get_state

Online status, visibility, current model/expression/motion/utterance, expression/motion lists, toggles, thinking-waiting config, switchable models

mira_list_models

Lists all models in the model folder

mira_get_model_capabilities

Parses model3.json and returns the expression/motion list

mira_switch_model

Switches the displayed model

mira_set_expression

Switches/stacks expressions (empty string restores default; stack=true stacks them)

mira_play_motion

Plays a motion group

mira_speak

TTS speech synthesis + bubble (makes the model speak)

mira_bubble

Shows only a bubble without speaking

mira_show / mira_hide

Show / hide

mira_set_expressions_enabled

Enables/disables the expression system

mira_set_animations_enabled

Enables/disables motion playback

mira_set_mood

Manually sets thinking / awaiting / idle

mira_set_persona

Sets thinking/awaiting expressions, bubbles, and idle clear delay

mira_get_config

Reads the current config (TTS key is never returned in plaintext)

Expressions: Mutually Exclusive and Stacking

  • By default, mira_set_expression(name) is a mutually exclusive replacement: the new expression fades out the previous one.

  • mira_set_expression(name, stack=true) is a stacking toggle: adds the expression to the stack, where it can coexist with the current exclusive expression and other stacked expressions (relies on Blend:Add in exp3.json).

  • Expression items in the right-click / long-press menu are always stacking toggles ( means enabled); click once to turn on, click again to turn off.

  • mira_set_expression("") (empty string) restores the default: clears the exclusive expression + all stacked expressions.

Configuration Options

All optional; defaults are in DEFAULTS in lib/index.js:

Key

Default

Description

enabled

true

Master switch

model

''

Initial model (model directory name)

modelsDir

plugin model/

Model directory override

canvas.w/h

480/630

Canvas internal resolution

position

right

Initial left / right

mobileScale

55

Mobile zoom percentage

showHint

true

Show operation hint on first display

pollIntervalMs

1500

Command polling interval

persona.thinking.{expression,bubble}

''

Expression/bubble while thinking (empty by default)

persona.awaiting.{expression,bubble}

''

Expression/bubble while awaiting confirmation (empty by default)

persona.idleClearMs

3200

Delay before clearing the expression when idle

tts.enabled

false

TTS switch

tts.provider

openai

openai / alibaba

tts.base

provider default

API base URL

tts.key

''

API Key (literal)

tts.keyEnv

''

Environment variable name holding the API Key

tts.model / tts.voice

provider default

Model / voice

How Thinking / Awaiting Expressions Are Triggered

  • Model starts generating (agent enters running) → mood: thinking

  • Model calls ask_user_questionmood: awaiting

  • Model finishes the turn (agent returns to idle) → mood: idle, and the default expression is restored after idleClearMs

  • You can also set it manually with mira_set_mood

Third-Party Components

assets/lib/ bundles PixiJS (MIT), pixi-live2d-display (MIT), and Live2D Cubism Core (proprietary, Live2D Software License Agreement). The full copyright and license texts for each component are in THIRD-PARTY-NOTICES.md.

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

View all related MCP servers

Related MCP Connectors

  • MCP server for AI dialogue using various LLM models via AceDataCloud

  • MCP server exposing the AceDataCloud Fish Audio API (text-to-speech with voice conditioning)

  • Generate, edit, and deploy immersive 3D/WebGL web projects from any MCP assistant.

View all MCP Connectors

Latest Blog Posts

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/xhqm-xyz/mira_live2d'

If you have feedback or need assistance with the MCP directory API, please join our Discord server