home / mcp / playfab mcp server

PlayFab MCP Server

PlayFab MCP server with CI/CD and release-please

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "akiojin-playfab-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@akiojin/playfab-mcp-server"
      ],
      "env": {
        "PLAYFAB_TITLE_ID": "YOUR_TITLE_ID",
        "PLAYFAB_DEV_SECRET_KEY": "YOUR_DEV_SECRET_KEY"
      }
    }
  }
}

You learn how to run and use the PlayFab MCP Server to let large language models interact with PlayFab services. This server acts as a secure translator that exposes catalog, player, inventory, and account operations so your AI assistant can perform actions like searching items, managing inventory, and querying user data directly through PlayFab APIs.

How to use

You connect your MCP client to the PlayFab MCP Server and then issue natural language prompts that map to PlayFab endpoints. Practical patterns include asking for item search results, updating a draft item, retrieving a player’s inventory, or getting user account details. The server handles translating your requests into PlayFab API calls and returns structured results you can present to users.

Typical usage patterns you can try after wiring up the MCP client: search the catalog for items, create or update draft items, publish items, fetch item details, inspect a user’s inventory, add or remove inventory items, or retrieve a player’s account information. The server exposes a comprehensive set of endpoints to cover catalog management, inventory operations, and user data management.

How to install

Prerequisites you need before starting:

- Node.js 18 or higher

- A PlayFab account with a Title ID and Developer Secret Key

- An MCP client such as Claude Desktop or Cursor Desktop to connect to the server

Follow these concrete steps to set up and run the server locally:

# 1) Create a project directory and enter it
mkdir playfab-mcp-server
cd playfab-mcp-server

# 2) Create a .env file with your PlayFab credentials
PLAYFAB_TITLE_ID=
PLAYFAB_DEV_SECRET_KEY=

# 3) Install dependencies
npm install

# 4) Build the project
npm run build

# 5) Start the server
npm start

Additional configuration and notes

You can configure the MCP server within your LLM client by providing the MCP server details in the client’s config. The example below shows how to set up a local stdio-based MCP server using npx to run the PlayFab MCP package and pass your credentials via environment variables.

{
  "mcpServers": {
    "playfab": {
      "command": "npx",
      "args": [
        "-y",
        "@akiojin/playfab-mcp-server"
      ],
      "env": {
        "PLAYFAB_TITLE_ID": "Your PlayFab Title ID",
        "PLAYFAB_DEV_SECRET_KEY": "Your PlayFab Developer Secret Key"
      }
    }
  }
}

Security and best practices

Always use environment variables for sensitive credentials. Rotate PlayFab secret keys periodically and keep dependencies up to date. Use least-privilege access for credentials and avoid embedding secrets in code or configuration files that travel with your source.

Available tools

search_items

Search for items in PlayFab catalog using the search_items API to retrieve matching results.

create_draft_item

Create a new draft item in the catalog using the create_draft_item API, enabling draft content before publishing.

update_draft_item

Update properties of an existing draft item with the update_draft_item API.

delete_item

Remove an item from the catalog using the delete_item API.

publish_draft_item

Publish a draft item to make it available in the live catalog using publish_draft_item API.

get_item

Get detailed information about a catalog item via the get_item API.

get_title_player_account_id_from_playfab_id

Convert a PlayFab ID to a Title Player Account ID using get_title_player_account_id_from_playfab_id API.

get_user_account_info

Retrieve comprehensive user account information through the get_user_account_info API.

get_inventory_items

Retrieve current inventory items for a player with the get_inventory_items API.

get_inventory_collection_ids

Fetch inventory collection IDs using the get_inventory_collection_ids API.

add_inventory_items

Add items to a player's inventory via the add_inventory_items API.

delete_inventory_items

Remove items from a player's inventory using the delete_inventory_items API.

subtract_inventory_items

Subtract specific amounts from inventory items with the subtract_inventory_items API.

update_inventory_items

Modify item properties in inventory through the update_inventory_items API.

execute_inventory_operations

Run batch inventory operations with the execute_inventory_operations API in Economy v2.

ban_users

Ban players by ID, IP, or MAC address using the ban_users API.

revoke_all_bans_for_user

Completely revoke all bans for a user using revoke_all_bans_for_user API.

get_user_data

Retrieve player custom data via the get_user_data API.

update_user_data

Update player custom data with the update_user_data API.

set_title_data

Set global title data using the set_title_data API.

get_title_data

Retrieve global title data via the get_title_data API.

set_title_internal_data

Set server-only internal data with the set_title_internal_data API.

get_title_internal_data

Retrieve internal data with the get_title_internal_data API.