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
> Settings
Developer
then Edit Config
claude_desktop_config.json
file for editingFile
> Preferences
> Cursor Settings
+ Add new global MCP server
mcp.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_entities
create_entities
delete_entities
duplicate_entities
modify_entities
reparent_entity
add_components
remove_components
add_script_component_script
list_assets
create_assets
delete_assets
instantiate_template_assets
set_script_text
script_parse
set_material_diffuse
query_scene_settings
modify_scene_settings
store_search
store_get
store_download
Once connected, you can issue these commands through Claude Desktop or Cursor to automate your PlayCanvas Editor workflow.
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 > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.