克劳德角色库
Claude的专家角色选择器-在Claude Code CLI和Claude Desktop中无缝切换AI角色。
概述
Claude角色库是一个MCP(模型上下文协议)服务器,使用户能够在Claude生态系统中管理和应用专门的AI角色。与OpenAI的GPT商店在概念上类似,它提供了一种本地优先的方法来组织和使用精心策划的提示。
主要特点
- 与跨平台支持 -通过MCP与Claude Code CLI和Claude Desktop一起使用
- 当地第一建筑 -所有数据都存储在本地,不依赖于云
- 两层收藏夹 -全球和项目级角色集合
- 来源追踪 -使用同步功能跟踪提示来源
- 基于YAML的存储 -人类可读、Git友好的配置
安装
来自npm(即将推出)
# Global installation
npm install -g claude-role-library
# Or use directly with npx
npx claude-role-library本地开发
先决条件: 包子 v1.0或更高版本
# Clone the repository
git clone https://github.com/user/claude-role-library.git
cd claude-role-library
# Install dependencies
bun install
# Run the server
bun run start
# Run in development mode (with hot reload)
bun run dev运行测试
# Run all tests
bun test
# Run tests in watch mode
bun test --watch
# Run specific test file
bun test src/schemas/role.test.tsMCP配置
npm安装后(未来):
{
"mcpServers": {
"claude-role-library": {
"command": "npx",
"args": ["claude-role-library"]
}
}
}对于当地发展:
{
"mcpServers": {
"claude-role-library": {
"command": "bun",
"args": ["run", "/path/to/claude-role-library/src/index.ts"]
}
}
}用法
# List all available roles
/roles list
# Search for specific roles
/roles search "code review"
# Apply a role to the current session
/roles use senior-code-reviewer
# Manage favorites
/favorites list
/favorites add senior-code-reviewer数据结构
~/.config/claude-role-library/
├── config.yaml # Global configuration
├── sources.yaml # External source definitions
├── favorites.yaml # Favorited roles
└── roles/ # Role definitions
└── *.yaml
{project}/.claude-role-library/
└── favorites.yaml # Project-specific favorites技术栈
| 组件 | 技术 |
|---|---|
| 语言 | TypeScript |
| 运行时 | Bun |
| 协议 | MCP SDK |
| 存储 | YAML |
| 验证 | Zod |
文档
路线图
| 阶段 | 状态 | 功能 |
|---|---|---|
| 第一阶段 | 完成 | 核心角色管理,MCP集成 |
| 第二阶段 | 已完成 | GitHub源代码同步,批量导入 |
| 第3阶段 | 进行中 | 人工智能辅助转换、多源解析器、索引 |
| 第4阶段 | 计划中 | 社区共享、使用统计 |
贡献
欢迎捐款。请查看 体系结构文档 在提交更改之前。
许可证
麻省理工学院
