emotion-mcp
Click on "Deploy 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., "@emotion-mcp analyze message: 'I missed you' for character Alice"
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.
Emotion MCP Server
弗洛伊德双驱情绪管理 MCP 服务器 —— astrbot_plugin_affection 的独立 MCP 实现。
NPM: https://www.npmjs.com/package/emotion-mcp GitHub: https://github.com/yaoxiaolinglong/emotion-mcp
为 AI 角色扮演/伴侣场景提供动态情绪模拟系统。基于弗洛伊德心理动力学(力比多/攻击性),通过潜意识 LLM 分析对话内容实时调整情绪数值,具备时间衰减能力。
快速开始
npx -y emotion-mcpRelated MCP server: Ombre Brain
集成方式
零配置(推荐) — Agent 自主分析
mcpServers:
emotion:
type: stdio
command: npx
args:
- -y
- emotion-mcp
timeout: 60000无需任何环境变量! Agent 通过两步模式完成情绪分析:
用户发言
→ emotion_get_analysis_prompt(user_id, message) # 获取分析任务
→ Agent 自己分析 → 输出 JSON
→ emotion_apply_deltas(user_id, deltas) # 提交结果,数值更新
→ emotion_get_emotion_prompt(user_id) # 获取情绪文本
→ 注入 system prompt → 生成回复后台 LLM 模式 — 独立分析
如果配置了 EMOTION_LLM_API_KEY,可用 emotion_analyze 一步完成:
mcpServers:
emotion:
type: stdio
command: npx
args:
- -y
- emotion-mcp
env:
EMOTION_LLM_API_KEY: sk-your-key-here
timeout: 60000环境变量
变量 | 默认值 | 说明 |
| (必填) | 潜意识 LLM API Key |
|
| API 地址 |
|
| 模型名(建议轻量模型) |
|
| 情绪敏感度 (0-100) |
|
| 初始好感度 (0-100) |
MCP 工具
emotion_analyze ★ 核心
分析用户消息 → 调用潜意识 LLM → 更新情绪数值。每次用户发言后调用。
输入:
user_id,message,history(可选)输出: 更新后的完整情绪面板 + 增量详情
emotion_get_emotion_prompt
生成可追加到 system prompt 的情绪文本。
输入:
user_id输出: 情绪数值面板文本
emotion_get_panel
获取当前情绪数值面板(JSON 格式)。
输入:
user_id
emotion_get_status
完整情绪档案,含参考表。
emotion_reset / emotion_set / emotion_reset_all
管理工具。
Agent 角色的「情绪驱动规则」
将以下规则加入角色设定的 system prompt 末尾:
【情绪驱动规则】
你的回复风格和情感倾向由系统实时计算的「力比多/攻击性/好感」数值决定。每次对话前,你会收到【当前情绪数值】面板,包含:
- 他力比多(0-50):想亲近对方的欲望。高→主动撒娇黏人,低→冷淡回避疏远。
- 他攻击性(0-50):想伤害对方的冲动。高→敌意烦躁刻薄,低→温顺容忍顺从。
- 好感度(0-100):长期累积的喜欢和依恋。≥70 时攻击性表现为"吃醋""占有欲";≤30 时表现为"厌恶""敌意"。
- 自力比多(0-50):自爱程度。高→自信自爱,低→自卑空虚。
- 自攻击性(0-50):自责/自我毁灭冲动。高→崩溃自我贬低。
重要约束:不要提及任何具体数值,根据数值强度自然演绎。数值的微小变化也应体现在语气强度上。许可
基于 astrbot_plugin_affection (AGPL-3.0) 改造。同样采用 AGPL-3.0。
Available Tools
10 toolsemotion_analyzeA
【一键模式】分析用户消息 + 更新情绪。如果配置了 EMOTION_LLM_API_KEY 则由后台 LLM 分析,否则由调用方(Agent)分析。推荐使用 emotion_get_analysis_prompt + emotion_apply_deltas 两步模式以获得更好的控制
Inputs: message (required), user_id (required), history.
emotion_apply_decayB
手动触发时间衰减(通常自动执行)
Inputs: no named parameters.
emotion_apply_deltasA
提交情绪增量 JSON 以更新数值。配合 emotion_get_analysis_prompt 使用:分析完成后将 JSON 结果提交于此
Inputs: deltas (required), user_id (required).
emotion_get_analysis_promptA
获取情绪分析任务 — 返回当前数值 + 分析指南 + 消息和对话历史。调用后你会得到一个分析任务,请根据指南判断情绪变化并输出 JSON,然后调用 emotion_apply_deltas 提交结果。这样就由你(主 LLM)来做潜意识分析,无需额外配置 API Key
Inputs: message (required), user_id (required), history.
emotion_get_emotion_promptA
生成可注入 system prompt 的情绪数值文本,让 AI 根据当前情绪数值演绎角色
Inputs: user_id (required).
emotion_get_panelB
获取用户当前情绪数值面板,返回所有情绪维度的当前值和基线值
Inputs: user_id (required).
emotion_get_statusA
获取用户完整情绪档案:好感度、力比多/攻击性、情感标签、对话轮次、完整参考表
Inputs: user_id (required).
emotion_resetA
重置指定用户的情绪数值至初始状态
Inputs: user_id (required).
emotion_reset_allA
⚠️ 清除所有用户情绪档案,重置机器人自身情绪
Inputs: no named parameters.
emotion_setA
手动设置用户情绪数值。未指定的字段保持不变
Inputs: user_id (required), affection, libido_self, libido_other, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Several get tools overlap in the data they return. get_panel and get_status both provide current emotion values, and get_analysis_prompt also includes current values, which could confuse agents. However, descriptions clearly differentiate their broader purposes (UI panel, full profile, analysis task), so overlaps are manageable.
All tools use the emotion_ prefix with snake_case, and verbs like get, apply, set, reset are consistent and predictable. The pattern is verb_noun or verb, with only minor exceptions like emotion_analyze and emotion_reset_all, but these are still clear and uniform.
10 tools is well within the typical 3-15 range and each tool serves a distinct function in managing emotion state. The number feels appropriate for a focused emotion management server, covering read, update, reset, and analysis operations without unnecessary bloat.
The server covers the full emotion lifecycle: reading (get_panel, get_status, get_analysis_prompt), updating (set, apply_deltas, analyze, apply_decay), and resetting (reset, reset_all). Minor gaps like listing all users are not essential for typical role-play scenarios, so the surface is almost complete.
Related MCP Connectors
Persistent AI entity framework with causal memory, emotional state, and identity.
Affect analysis, 3D avatar params, empathy hints and somatic emotion decode.
Psychological text analysis: tone, emotions, communication style, multilingual replies.
Psyche audits for AI agents: declared vs self-reported vs revealed objectives, diffed and flagged.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceProvides AI agents with a persistent internal dynamical state and emotional reservoir that evolves based on text interactions. This server enables agents to maintain a consistent affective substrate across sessions through tools that track phase coherence and emergent emotional vibes.2MIT
- AlicenseNot gradedqualityDmaintenanceA long-term emotional memory system for Claude, enabling persistent, cross-conversation memory with emotional tagging using Russell's valence/arousal model and natural forgetting curves.158MIT
- AlicenseNot gradedqualityDmaintenanceEnables persistent AI entities with causal memory, emotional state, and identity continuity. Provides 31 tools for memory, cognition, emotion, planning, reasoning, and more.71 npm-
- FlicenseNot gradedqualityDmaintenanceEnables dynamic persona injection and post-processing for LLM conversations through a six-layer engine. Supports commands and state management for personalized interactions.-