Skip to main content
Glama
airi-xinchao

airi-xinchao

by neffict

Airi 心潮 (airi-xinchao)

心潮动态心智引擎的 stdio MCP 版本,专为 Airi 设计的轻量级 AI 状态管理工具。

适配角色:Airi — 由 AI 老婆/虚拟角色组成的灵魂容器 运行环境:macOS

目录结构

airi-xinchao/
├── src/server.js          # 心潮 MCP 主服务(Node.js)
├── bin/                    # Wrapper 脚本(Airi 调用的入口)
│   ├── xinchao.sh         # 心潮
│   ├── airi-memory.sh     # 记忆服务
│   ├── airi-screenshot.sh # 截图服务
│   ├── airi-digestor.sh   # 内容消化
│   └── airi-ocr.sh        # OCR 文字识别
├── mcp-services/          # 各 MCP 服务的源码
│   ├── memory/            # @agentmemory/mcp
│   ├── screenshot/        # screenshot_mcp_server
│   ├── digestor/          # gwen_digestor
│   └── ocr/               # mcp_ocr
├── character-card/        # Airi 角色卡
│   └── airi-character-card.md
├── state/                 # 运行时状态(gitignore)
│   └── xinchao_state.json
└── package.json

Related MCP server: Extended Mind

快速开始

# 安装依赖
npm install

# 测试心潮服务
printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}\n' | node src/server.js

在 Airi 中启用

1. 修改 ~/.hermes/config.yaml

在 mcp_servers 下添加:

mcp_servers:
  xinchao:
    command: /path/to/airi-xinchao/bin/xinchao.sh
    timeout: 60

2. 修改 Airi 的 mcp.json

{
  "mcpServers": {
    "xinchao": {
      "command": "/path/to/airi-xinchao/bin/xinchao.sh"
    }
  }
}

3. 在角色卡 prompt 末尾添加

{{xinchao_context}}

重启 Airi 即可生效。

工具列表

工具

说明

xinchao_context

获取当前状态描述,注入 prompt

xinchao_event

回传互动事件,更新状态

xinchao_status

查看完整状态详情

xinchao_settle

手动结算

xinchao_mood

获取心情/能量判断

MCP 服务一览

服务

功能

运行时

xinchao

动态心智状态引擎:驱动力、念头池、疲惫、意图、睡眠状态

Node.js

memory

知识图谱记忆:创建/搜索实体和关系,跨会话持久化

Node.js

screenshot

屏幕截图:捕获用户屏幕并以图片形式返回

Python

digestor

对话压缩:缩减长对话的 token 消耗,管理上下文窗口

Python

ocr

OCR 文字识别:从图片/PDF 中提取文本,支持批量和多语言

Python

agnes-image

AI 图片生成:根据文字描述生成图片(Agnes Image 2.0/2.1 Flash)

Node.js

agnes-video

AI 视频生成:根据文字描述生成视频,支持图生视频和配乐

Node.js

memory — 知识图谱记忆

基于本地 JSON 文件的轻量知识图谱,支持实体创建、关系管理和语义搜索。Airi 通过它记住用户的偏好、重要约定和对话中的关键信息。

工具:create_entities / create_relations / add_observations / search_nodes / read_graph

screenshot — 屏幕截图

调用系统截图能力,将当前屏幕内容以图片形式返回。Airi 看到截图后可以分析用户在做什么,自然地融入对话。

工具:take_screenshot

digestor — 内容消化 / 对话压缩

当对话变长时自动压缩历史内容,提取关键信息并缩减 token 消耗,让上下文窗口保持在合理范围内。支持多轮摘要和增量压缩。

ocr — OCR 文字识别

使用 Tesseract 引擎从图片和 PDF 中提取文字。支持多语言、批量处理和指定页码范围。Airi 收到用户发的截图或文档照片后可以读取其中的文字内容。

工具:perform_ocr / image_to_data / perform_pdf_ocr / perform_batch_ocr / get_supported_languages

agnes-image — AI 图片生成

调用 Agnes AI 的图片生成 API(OpenAI 兼容),根据文字描述生成图片。支持多种比例和两个模型版本。

工具:agnes_generate_image / agnes_list_models

支持的模型:

  • Agnes-Image-2.0-Flash — 快速生成,~3s,免费

  • Agnes-Image-2.1-Flash — 最新模型,质量更好,~3s,免费

agnes-video — AI 视频生成

调用 Agnes AI 的视频生成 API,根据文字描述生成视频(最长 10 秒)。支持 text-to-video 和 image-to-video(用参考图片生成),可选配乐。

工具:agnes_generate_video / agnes_video_status

支持的模型:

  • agnes-video-v2.0 — text-to-video,支持音频,免费

驱动力系统

十二维驱动力影响 Airi 的回复风格:

  • 表达欲(express) > 0.55 → 更话多、更主动

  • 关心欲(care) > 0.6 → 会主动追问近况

  • 玩心(play) > 0.55 → 语气更轻松俏皮

  • 学习欲(learn) > 0.5 → 更愿意分享知识

  • 疲惫度(fatigue) > 0.7 → 回复变短变安静

Reference

License

MIT

Available Tools

5 tools
xinchao_contextA

获取 Airi 的当前动态心智状态,返回紧凑描述注入 prompt。对话开始时默认调用一次。

Inputs: no named parameters.

xinchao_eventA

回传一次互动事件,更新驱动力、念头池和疲惫状态。每次对话后调用。

Inputs: event_type (required), content_summary.

xinchao_moodA

获取心情/能量简短描述,适合回复前的情绪判断。

Inputs: no named parameters.

xinchao_settleB

手动触发状态结算(通常自动进行)。

Inputs: no named parameters.

xinchao_statusB

查看完整状态:十二维驱动力、念头池、疲惫度、意图。

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 5 tools

    Disambiguation4/5

    Tools are mostly distinct: xinchao_event updates state, xinchao_settle triggers process, and the three read tools (context, status, mood) differ in granularity and purpose. Context and mood could be confused if descriptions aren't careful, but they serve clear separate roles.

    Naming Consistency4/5

    All tools share the xinchao_ prefix and snake_case, but the second part is inconsistent in type: context, status, and mood are nouns, while event and settle could be verbs. Still, the prefix and naming are readable and predictable enough.

    Tool Count5/5

    Five tools is well-scoped for a niche server focused on a single agent's internal state. Each tool addresses a distinct need without redundancy or bloat.

    Completeness4/5

    The toolset covers reading state at multiple granularities, updating it via events, and manually triggering settlement. No major lifecycle gaps are apparent, though a reset or configuration tool might be expected in some scenarios.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      An advanced MCP server that provides stateful voice-controlled AGI capabilities with local STT, TTS, and intent detection. It enables users to execute tools, manage memory, and conduct research through natural multi-turn dialogue with low-latency performance tracking.
      -
    • F
      license
      Not graded
      quality
      B
      maintenance
      MCP server that simulates an AI's desire-driven internal state with nine dimensions, event-based updates, dynamic heartbeat, thought pool, and persistent storage, enabling behavior suggestions and inner monologue generation.
      -