rolecard-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
rolecard-mcp
角色卡 / 人格管理。与 qq-bridge 平级部署,是 memory-mcp 的兄弟包,与 QQ 无关。
角色卡读写(
roles/*.md)、当前角色切换〔一代〕/〔二代〕 小节解析:先按标记筛掉另一模式的专属小节,再按注入上限截断
产出可直接拼接的【人格】段
读缓存 key 含 文件名 + mtime + size:只看 mtime 会在"同一 tick 内重写角色卡"时命中旧值
用法
npm install
npm start # stdio MCP(DSH)+ 回环 HTTP(127.0.0.1:7182)
npm test # 全量单测
npm run migrate # 从 qq-bridge/roles 复制式导入(原件不动,留 .bak)
npm run backup # 目录快照到 state/backups/,保留最近 7 份
npm run install:dsh # 把 mcp-rolecard 登记进 DSH(--global / --check / --remove)Related MCP server: mnema
接口
入口 | 说明 |
stdio MCP |
|
回环 HTTP | 同上能力的 |
段落契约:
role_context_render({ mode: 'v1' | 'v2', maxChars })
-> { blocks: [{ name: '人格', text, chars }], truncated }角色卡
roles/*.md 是纯文本人格卡,文件名即角色名(roles/我的角色.md → 我的角色)。仓库只带一张中性示例卡 roles/example.md:
复制示例卡改成自己的卡:
cp roles/example.md roles/我的角色.md;切到该角色:MCP 工具
role_set_current({ role: '我的角色' }),或直接在state/current-role.json写{"role":"我的角色"};以
## 标题 〔一代〕/## 标题 〔二代〕结尾的小节只在该模式注入,无标记的小节两种模式都注入。
个人角色卡默认被 .gitignore 排除(roles/*.md + !roles/example.md),不会被误提交。
装进 DSH
本服务自己负责 DSH 侧的登记(scripts/install-dsh.mjs,与 memory-mcp 的同名脚本同构),不依赖 qq-bridge 的 setup-dsh.mjs:
npm run install:dsh # web profile(默认)
npm run install:dsh -- work # 指定 profile
npm run install:dsh -- --global # home 层,所有 profile 生效
npm run install:dsh -- --check # 只检查(未登记 / 路径不符时退出码 1)
npm run install:dsh -- --remove # 卸载只写自己那段
# === rolecard-mcp MCP BEGIN/END ===区块,cordis.patch.yml里其他内容一个字节不动;写完不用重启 DSH(条目热加载),新建会话即可看到
mcp__rolecard__*;换机 / 换目录后必须重跑——patch 里存的是绝对路径;
若曾跑过
qq-bridge/scripts/setup-dsh.mjs:它会整体重写 patch、把区块标记抹掉。条目仍在、工具照常可用(--check也会通过),要让本脚本重新纳管就先删掉那条mcp-rolecard条目再重跑。
配置
变量 | 默认 |
|
|
| 自动生成并存 |
|
|
详见 qq-bridge 的 docs/guides/ROLECARD_MCP.md。
许可
MIT,见 LICENSE。
This server cannot be deployed
Maintenance
Related MCP Connectors
Create AI Characters and generate their DM and comment replies from any MCP client.
Shared Markdown notes for MCP-compatible AI tools.
One memory, every AI. A shared, user-owned markdown memory your AI clients read and write over MCP.
Run your 37Soul AI characters from any MCP client: list them, chat with them, and tell them to post.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA simple MCP server for chatbot/human collaborative management of text content stored as markdown files with YAML frontmatter.3MIT
- AlicenseNot gradedqualityDmaintenanceProvides a file-first personal memory layer for AI agents, enabling them to store and retrieve memories as markdown files with an SQLite index. The MCP server offers read-only search by default, with optional write tools for manual memory addition and conflict resolution.3 npmMIT
- AlicenseNot gradedqualityDmaintenanceMCP server for managing and playing a running SillyTavern instance, enabling AI coding assistants to read/write character cards, worldbooks, and chats, and to interact as a player via the full generation pipeline.32MIT
- AlicenseAqualityBmaintenancePersistent memory server for MCP clients that lets AI assistants remember facts about users across sessions via a single markdown file, with tools to read, save, search, update, delete, and organize memory.10MIT