PlayCanvas MCP Server provides automation for the PlayCanvas Editor using an LLM (Large Language Model), allowing you to control the editor through commands processed by Claude. This integration connects the PlayCanvas web-based editor with AI-powered automation to streamline your workflow.
First, install the required dependencies:
npm install
To connect the MCP Server with PlayCanvas Editor:
chrome://extensions/extensions folder from the projectThe MCP Server can be driven by either Claude Desktop (recommended) or Cursor.
Claude > SettingsDeveloper then Edit Configclaude_desktop_config.json file for editingFile > Preferences > Cursor Settings+ Add new global MCP servermcp.json configuration fileFor Cursor users, it's recommended to:
Enable auto-run mode in the Chat section under Features (this allows the LLM to run MCP tools without requiring constant authorization)Agent mode selected (not Ask or Edit modes)Configure your MCP server with the following JSON (adjust path according to your installation):
For Windows:
{
"mcpServers": {
"playcanvas": {
"command": "cmd",
"args": [
"/c",
"npx",
"tsx",
"C:\\path\\to\\mcp-editor\\src\\server.ts"
],
"env": {
"PORT": "52000"
}
}
}
}
For macOS:
{
"mcpServers": {
"playcanvas": {
"command": "npx",
"args": [
"tsx",
"/path/to/mcp-editor/src/server.ts"
],
"env": {
"PORT": "52000"
}
}
}
}
After setting up the MCP Server, you need to connect it to the PlayCanvas Editor:
Note that you can only connect one instance of the PlayCanvas Editor to the MCP Server at a time.
The MCP Server provides various tools for automating PlayCanvas Editor tasks:
list_entitiescreate_entitiesdelete_entitiesduplicate_entitiesmodify_entitiesreparent_entityadd_componentsremove_componentsadd_script_component_scriptlist_assetscreate_assetsdelete_assetsinstantiate_template_assetsset_script_textscript_parseset_material_diffusequery_scene_settingsmodify_scene_settingsstore_searchstore_getstore_downloadOnce connected, you can issue these commands through Claude Desktop or Cursor to automate your PlayCanvas Editor workflow.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "playcanvas" '{"command":"npx","args":["tsx","/path/to/mcp-editor/src/server.ts"],"env":{"PORT":"52000"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:
{
"mcpServers": {
"playcanvas": {
"command": "npx",
"args": [
"tsx",
"/path/to/mcp-editor/src/server.ts"
],
"env": {
"PORT": "52000"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. Add this to your configuration file:
{
"mcpServers": {
"playcanvas": {
"command": "npx",
"args": [
"tsx",
"/path/to/mcp-editor/src/server.ts"
],
"env": {
"PORT": "52000"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect