{"_id":"@boybook/ec-usercenter-mcp-server","_rev":"3-9f56878ae76c534edcec86a931b416eb","name":"@boybook/ec-usercenter-mcp-server","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@boybook/ec-usercenter-mcp-server","version":"1.0.0","keywords":["mcp","model-context-protocol","easecation","ticket-system","user-center","claude","ai-assistant","customer-service"],"author":{"name":"EaseCation Team"},"license":"MIT","_id":"@boybook/ec-usercenter-mcp-server@1.0.0","maintainers":[{"name":"boybook","email":"fangyizhou1997@qq.com"}],"homepage":"https://github.com/easecation/ec-usercenter-mcp-server#readme","bugs":{"url":"https://github.com/easecation/ec-usercenter-mcp-server/issues"},"bin":{"ec-usercenter-mcp-server":"src/index.js"},"dist":{"shasum":"f19dd1b1217479302b80f935e20c59b26a091853","tarball":"https://registry.npmjs.org/@boybook/ec-usercenter-mcp-server/-/ec-usercenter-mcp-server-1.0.0.tgz","fileCount":14,"integrity":"sha512-h59OoBC/P4gWJfD5B30thapP67avDzpS8XYYpOOdkt47VtL8Eodb8sfN/6BRGwWcJiP8j1K06+uYlFi76JXNaA==","signatures":[{"sig":"MEUCIEou5B9xTiHxeH/WLsw9NPM31MvvOcMw2DMdbGCplWpKAiEAyhiGva2bNh5iweSy9sXk6AFc1TE/233gj0RPCaArT9s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35498},"main":"src/index.js","type":"module","engines":{"node":">=18.0.0"},"gitHead":"5e2591a76b1125f50e1be0e1277e498425e7feec","scripts":{"dev":"node --watch src/index.js","test":"node --test || echo 'No tests available'","start":"node src/index.js","prepublishOnly":"npm test"},"_npmUser":{"name":"boybook","email":"fangyizhou1997@qq.com"},"repository":{"url":"git+https://github.com/easecation/ec-usercenter-mcp-server.git","type":"git"},"_npmVersion":"10.9.2","description":"MCP server for EaseCation User Center ticket system - provides read-only access to tickets and player data","directories":{},"_nodeVersion":"22.15.1","dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ec-usercenter-mcp-server_1.0.0_1754982962965_0.2653443236670856","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@boybook/ec-usercenter-mcp-server","version":"1.0.1","keywords":["mcp","model-context-protocol","easecation","ticket-system","user-center","claude","ai-assistant","customer-service"],"author":{"name":"EaseCation Team"},"license":"MIT","_id":"@boybook/ec-usercenter-mcp-server@1.0.1","maintainers":[{"name":"boybook","email":"fangyizhou1997@qq.com"}],"homepage":"https://github.com/easecation/ec-usercenter-mcp-server#readme","bugs":{"url":"https://github.com/easecation/ec-usercenter-mcp-server/issues"},"bin":{"ec-usercenter-mcp-server":"src/index.js"},"dist":{"shasum":"5263535c572b454aa0df3d8766d56d7500ee108c","tarball":"https://registry.npmjs.org/@boybook/ec-usercenter-mcp-server/-/ec-usercenter-mcp-server-1.0.1.tgz","fileCount":14,"integrity":"sha512-cDU+sZfGdc9KF67CVLU/FaIF1orCYxH6Kd3ulsX4WFA3r3UnTUd9ho5fzVtQHluKUQPw8t52iE+GiBFB+KrViA==","signatures":[{"sig":"MEUCIQDlYlqYsI/lHAWb+wOjDrrNslAg6FBjWRy4KAbhqGNQuwIgOHU1o9k1iJUwa0Wq517xGahDV7HWsT7lpp9mk4bdMSw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35646},"main":"src/index.js","type":"module","engines":{"node":">=18.0.0"},"gitHead":"5e2591a76b1125f50e1be0e1277e498425e7feec","scripts":{"dev":"node --watch src/index.js","test":"node --test || echo 'No tests available'","start":"node src/index.js","prepublishOnly":"npm test"},"_npmUser":{"name":"boybook","email":"fangyizhou1997@qq.com"},"repository":{"url":"git+https://github.com/easecation/ec-usercenter-mcp-server.git","type":"git"},"_npmVersion":"10.9.2","description":"MCP server for EaseCation User Center ticket system - provides read-only access to tickets and player data","directories":{},"_nodeVersion":"22.15.1","dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ec-usercenter-mcp-server_1.0.1_1754983070881_0.41371340775121457","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@boybook/ec-usercenter-mcp-server","version":"1.0.2","description":"MCP server for EaseCation User Center ticket system - provides read-only access to tickets and player data","type":"module","main":"src/index.js","bin":{"ec-usercenter-mcp-server":"src/index.js"},"publishConfig":{"access":"public"},"scripts":{"start":"node src/index.js","dev":"node --watch src/index.js","prepublishOnly":"npm test","test":"node --test || echo 'No tests available'"},"keywords":["mcp","model-context-protocol","easecation","ticket-system","user-center","claude","ai-assistant","customer-service"],"author":{"name":"EaseCation Team"},"license":"MIT","homepage":"https://github.com/easecation/ec-usercenter-mcp-server#readme","repository":{"type":"git","url":"git+https://github.com/easecation/ec-usercenter-mcp-server.git"},"bugs":{"url":"https://github.com/easecation/ec-usercenter-mcp-server/issues"},"dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"engines":{"node":">=18.0.0"},"_id":"@boybook/ec-usercenter-mcp-server@1.0.2","gitHead":"5e2591a76b1125f50e1be0e1277e498425e7feec","_nodeVersion":"22.15.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-tuUmhw71gEFAw8cRPNLXg3gVOmuGKWtBsu5aPoccBgbR0DQKZc2UHqd4TTnvUUBw06wXwkH2Ge/EfT3Qy3fVGA==","shasum":"6fe189f5c9c1dbe97bc198f80e185edc3bbe9fb3","tarball":"https://registry.npmjs.org/@boybook/ec-usercenter-mcp-server/-/ec-usercenter-mcp-server-1.0.2.tgz","fileCount":14,"unpackedSize":35693,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDrxhc5tH+J5+CA/3/uZGlU0Z8+VQ9Gnvw+o8QNrpfwWQIhAJEcfZQ5Lu+nKuMynfQfZSl+ZGT0JZ54RXEumUKI7vCy"}]},"_npmUser":{"name":"boybook","email":"fangyizhou1997@qq.com"},"directories":{},"maintainers":[{"name":"boybook","email":"fangyizhou1997@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ec-usercenter-mcp-server_1.0.2_1754983205542_0.12737816898359222"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-12T07:16:02.847Z","modified":"2025-08-12T07:20:05.913Z","1.0.0":"2025-08-12T07:16:03.179Z","1.0.1":"2025-08-12T07:17:51.068Z","1.0.2":"2025-08-12T07:20:05.728Z"},"bugs":{"url":"https://github.com/easecation/ec-usercenter-mcp-server/issues"},"author":{"name":"EaseCation Team"},"license":"MIT","homepage":"https://github.com/easecation/ec-usercenter-mcp-server#readme","keywords":["mcp","model-context-protocol","easecation","ticket-system","user-center","claude","ai-assistant","customer-service"],"repository":{"type":"git","url":"git+https://github.com/easecation/ec-usercenter-mcp-server.git"},"description":"MCP server for EaseCation User Center ticket system - provides read-only access to tickets and player data","maintainers":[{"name":"boybook","email":"fangyizhou1997@qq.com"}],"readme":"# EaseCation 用户中心 MCP Server\n\n这是一个专为 EaseCation用户中心 设计的MCP（Model Context Protocol）服务器，提供对EaseCation用户中心工单系统的只读访问能力。\n\n## 功能特性\n\n- **工单管理**：支持工单查询、详情获取、统计分析、AI回复建议等\n- **玩家管理**：支持玩家搜索、基本信息查询、工单历史、操作日志等\n- **权限管理**：支持用户信息获取和权限检查\n- **只读访问**：仅提供查询类API，不包含创建、修改工单等写操作\n- **管理员权限**：以管理员身份访问，可查看所有工单和玩家信息\n\n## 安装配置\n\n### 1. 安装依赖\n\n```bash\nnpm install\n```\n\n### 2. 配置环境变量\n\n复制环境变量模板并填入配置信息：\n\n```bash\ncp .env.example .env\n```\n\n编辑 `.env` 文件，配置以下必需参数：\n\n```bash\n# API 基础 URL\nEC_API_BASE_URL=https://ucapi.easecation.net\n\n# 管理员 JWT Token（必需）\nEC_JWT_TOKEN=your_admin_jwt_token_here\n\n# API 超时时间（可选，默认30秒）\nEC_API_TIMEOUT=30000\n```\n\n### 3. MCP 客户端配置\n\n在使用此MCP服务器之前，需要在MCP客户端中添加服务器配置。以下是常见的配置示例：\n\n#### Claude Desktop 配置\n\n在 Claude Desktop 的配置文件中添加：\n\n**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`\n**Windows**: `%APPDATA%\\Claude\\claude_desktop_config.json`\n\n```json\n{\n  \"mcpServers\": {\n    \"ec-usercenter\": {\n      \"command\": \"npx\",\n      \"args\": [\"@boybook/ec-usercenter-mcp-server\"],\n      \"env\": {\n        \"EC_API_BASE_URL\": \"https://ucapi.easecation.net\",\n        \"EC_JWT_TOKEN\": \"your_admin_jwt_token_here\",\n        \"EC_API_TIMEOUT\": \"30000\"\n      }\n    }\n  }\n}\n```\n\n#### 使用本地路径配置（开发环境）\n\n```json\n{\n  \"mcpServers\": {\n    \"ec-usercenter\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/ec-usercenter-mcp-server/src/index.js\"],\n      \"env\": {\n        \"EC_API_BASE_URL\": \"https://ucapi.easecation.net\",\n        \"EC_JWT_TOKEN\": \"your_admin_jwt_token_here\",\n        \"EC_API_TIMEOUT\": \"30000\"\n      }\n    }\n  }\n}\n```\n\n#### 通用 MCP 客户端配置\n\n```json\n{\n  \"name\": \"ec-usercenter\",\n  \"command\": \"npx\",\n  \"args\": [\"@boybook/ec-usercenter-mcp-server\"],\n  \"env\": {\n    \"EC_API_BASE_URL\": \"https://ucapi.easecation.net\", \n    \"EC_JWT_TOKEN\": \"your_admin_jwt_token_here\"\n  }\n}\n```\n\n### 4. 安装和使用\n\n#### 从 npm 安装（推荐）\n\n```bash\n# 全局安装\nnpm install -g @boybook/ec-usercenter-mcp-server\n\n# 或者直接使用 npx（无需安装）\nnpx @boybook/ec-usercenter-mcp-server\n```\n\n#### 本地开发\n\n独立启动（用于调试）：\n\n```bash\nnpm start\n```\n\n或者开发模式（自动重启）：\n\n```bash\nnpm run dev\n```\n\n#### 本地开发测试\n\n确保npx入口工作正常：\n\n```bash\n# 在项目根目录下\nnpm link\nnpx ec-usercenter-mcp-server\n```\n\n#### 验证发布\n\n```bash\n# 检查包信息\nnpm view @boybook/ec-usercenter-mcp-server\n\n# 直接运行（npm可能需要几分钟同步）\nnpx @boybook/ec-usercenter-mcp-server\n```\n\n## 可用工具\n\n### 工单管理工具 (6个)\n\n1. **query_tickets** - 高级工单查询\n   - 支持分页、多条件筛选\n   - 参数：page, pageSize, tid[], type[], status[], priority, initiator[], target[], advisor_uid[]\n\n2. **get_ticket_detail** - 获取工单详情\n   - 包含完整历史记录\n   - 参数：tid (必需), anonymity (可选)\n\n3. **get_ticket_list** - 获取工单列表\n   - 简化版工单列表\n   - 参数：type (可选), keyword (可选)\n\n4. **get_ticket_count** - 获取工单统计\n   - 各类工单数量统计\n   - 参数：type (必需)\n\n5. **get_ticket_ai_reply** - 获取AI回复建议\n   - 为指定工单生成回复建议\n   - 参数：tid (必需), prompt (可选)\n\n6. **assign_ticket** - 分配工单\n   - 获取待处理工单进行分配\n   - 参数：type ('my'|'upgrade'|'unassigned')\n\n### 玩家管理工具 (5个)\n\n7. **search_players** - 搜索玩家\n   - 根据玩家名称搜索\n   - 参数：name (必需)\n\n8. **get_player_basic** - 获取玩家基本信息\n   - 包含等级、金币、经验等\n   - 参数：ecid (必需)\n\n9. **get_player_tickets** - 获取玩家工单历史\n   - 玩家相关的所有工单\n   - 参数：ecid (必需)\n\n10. **get_player_logs** - 获取玩家操作历史\n    - 对玩家的管理操作记录\n    - 参数：ecid (必需)\n\n11. **get_player_bans** - 获取玩家处罚历史\n    - 封禁、禁言等处罚记录\n    - 参数：ecid (必需)\n\n### 认证管理工具 (2个)\n\n12. **get_user_info** - 获取用户信息\n    - 当前Token对应的用户信息和权限\n    - 无参数\n\n13. **check_staff_permission** - 检查管理员权限\n    - 验证管理员权限\n    - 参数：authorizer (必需)\n\n## 工单类型说明\n\n- **AG**: 误判申诉\n- **AP**: 申请\n- **RP**: 举报玩家\n- **SP**: 商品补发\n- **AW**: 微信解冻\n- **OP**: 玩法咨询\n- **JY**: 建议\n- **RS**: 举报员工\n- **MB**: 媒体绑定\n- **MA**: 媒体审核\n- **AB**: 媒体审核\n- **MM**: 媒体月报\n- **OT**: 其他\n\n## 错误处理\n\n服务器会处理以下类型的错误：\n\n- **配置错误**: JWT Token 或 API URL 缺失\n- **API错误**: 网络请求失败、权限不足等\n- **参数验证错误**: 必需参数缺失、类型不匹配等\n\n错误信息会以标准MCP格式返回，包含详细的错误描述。\n\n## 开发说明\n\n### 项目结构\n\n```\nsrc/\n├── index.js                    # MCP server 入口点\n├── config.js                  # 环境变量配置管理\n├── api/\n│   ├── client.js              # HTTP API 客户端封装\n│   ├── ticket-api.js          # 工单相关 API 调用\n│   ├── player-api.js          # 玩家相关 API 调用\n│   └── auth-api.js            # 认证相关 API 调用\n├── tools/\n│   ├── ticket-tools.js        # 工单相关 MCP tools\n│   ├── player-tools.js        # 玩家相关 MCP tools\n│   └── auth-tools.js          # 认证相关 MCP tools\n└── utils/\n    ├── validators.js          # 参数验证工具\n    └── errors.js              # 错误处理工具\n```\n\n### 技术栈\n\n- **Node.js 18+**: 运行环境\n- **@modelcontextprotocol/sdk**: MCP 服务器框架\n- **fetch API**: HTTP 请求（Node.js 原生）\n- **ES Modules**: 模块系统\n\n## 许可证\n\nMIT License","readmeFilename":"README.md"}