
PlayFab MCP Server

2025.04.02
0
JavaScript游戏开发AI集成PlayFab服务开发效率
PlayFab MCP Server 是一个中间件,旨在作为大型语言模型(如Claude和VS Code)与PlayFab服务之间的安全高效翻译器。它通过Model Context Protocol (MCP) 提供通用接口,使AI助手能够直接与PlayFab的各种功能交互,包括物品搜索、段查询、玩家资料查找、库存管理以及PlayFab ID转换等。
View on GitHub
Overview
产品定位
PlayFab MCP Server 是一个中间件,旨在作为大型语言模型(如Claude和VS Code)与PlayFab服务之间的安全高效翻译器。
核心功能
- 使用PlayFab的search_items API搜索物品
- 检索完整的段信息
- 查询指定段内的玩家资料
- 使用get_inventory_items API检索当前库存物品
- 使用get_inventory_collection_ids API获取库存集合ID
- 通过get_title_player_account_id_from_playfab_id API将PlayFab ID转换为Title Player Account ID
适用场景
- 游戏开发中需要AI助手与PlayFab服务交互的场景
- 需要自动化管理PlayFab物品和玩家数据的场景
- 开发过程中需要快速查询PlayFab数据的场景
工具列表
- Smithery: 用于自动安装PlayFab MCP Server
- Cursor Desktop: 支持与PlayFab MCP Server集成的LLM客户端
常见问题解答
- 如何安装PlayFab MCP Server?
可以通过Smithery自动安装,命令为:
npx -y @smithery/cli install @akiojin/playfab-mcp-server --client claude
- 运行PlayFab MCP Server需要哪些前置条件?
- Node.js 14或更高版本
- 有效的PlayFab账户(通过PlayFab Game Manager获取Title ID和Developer Secret Key)
- 支持的LLM客户端,如Claude Desktop
- 如何配置PlayFab MCP Server? 需要在项目根目录创建.env文件,包含PLAYFAB_TITLE_ID和PLAYFAB_DEV_SECRET_KEY
使用教程
使用依赖
- Node.js 14或更高版本
- 有效的PlayFab账户
- 支持的LLM客户端
安装教程
- 通过Smithery安装:
bash npx -y @smithery/cli install @akiojin/playfab-mcp-server --client claude
- 手动安装:
bash npm install npm run build cd dist npm start
调试方式
- 启动服务器后应看到确认消息:
text PlayFab Server running on stdio
- 在Cursor中测试:
- 安装Cursor Desktop
- 复制mcp.json文件并更新值
- 启动Cursor,PlayFab MCP Server应出现在工具列表中
- 尝试提示如"Show me the latest 10 items"验证查询处理
- 在Claude Desktop中配置:
- 编辑配置文件添加PlayFab MCP Server路径和环境变量