AI Tools
Model Context Protocol (MCP)
16min
the model context protocol (mcp) is a standard for connecting large language models (llms) to platforms like back4app this guide covers how to connect back4app to the following ai tools using mcp cursor windsurf (codium) visual studio code (copilot) cline (vs code extension) claude desktop claude code once connected, your ai assistants can interact with and query your back4app projects on your behalf ai agents with mcp are configured to have full access to your back4app apps, which includes the ability to create, modify, and delete resources we strongly recommend first trying on a test account and app to understand its capabilities and potential impact before using it with production environments prerequisites an account created at back4app com (each new account has a deafult limit of apps if you need more please contact us); a recent nodejs version installed (16^); for better results we recommend to use the most advanced llm models and coding agents; activate web hosting for visualizing deployments on your subdomain; 1 create a account key first, go to your back4app dashboard and create a personal access token log into your back4app account hover over the "hello, \[username]" menu go to account keys and create a new key give it a name that describes its purpose, like "ai assistant mcp" copy the token securely you won't be able to see it again then give your account key token a name and click on + this token will be used to authenticate the mcp server with your back4app account 2 configure in your ai tool mcp compatible tools can connect to back4app using the back4app mcp server below are instructions for connecting to this server using popular ai tools cursor open cursor and go to cursor menu navitage to cursor >settings >cursor settings >mcp click on +add a new global mcp then add the following configuration macos / linux { "mcpservers" { "back4app" { "command" "npx", "args" \[ " y", "@back4app/mcp server back4app\@latest", " account key", "\<account key>" ] } } } windows { "mcpservers" { "back4app" { "command" "npx cmd", "args" \[ " y", "@back4app/mcp server back4app\@latest", " account key", "\<account key>" ] } } } replace \<account key> with your account key copied from back4app save the configuration file alternative setup if you prefer a project setup you can create a local project config file create a cursor directory in your project root if it doesn't exist create a cursor/mcp json file if it doesn't exist and open it add the connfiguration mentioned before windsurf open windsurf and navigate to the cascade assistant tap on the hammer (mcp) icon, then configure to open the configuration file add the following configuration macos / linux { "mcpservers" { "back4app" { "command" "npx", "args" \[ " y", "@back4app/mcp server back4app\@latest", " account key", "\<account key>" ] } } } windows { "mcpservers" { "back4app" { "command" "npx cmd", "args" \[ " y", "@back4app/mcp server back4app\@latest", " account key", "\<account key>" ] } } } replace \<account key> with your account key copied from back4app save the configuration file and reload by tapping refresh in the cascade assistant you should see a green active status after the server is successfully connected visual studio(copilot) open vs code and create a vscode directory in your project root if it doesn't exist create a vscode/mcp json file if it doesn't exist and open it add the following configuration macos / linux { "inputs" \[ { "type" "promptstring", "id" "back4app account key", "description" "back4app personal access token", "password" true } ], "servers" { "back4app" { "command" "npx", "args" \[" y", "@back4app/mcp server back4app\@latest"], "env" { "back4app account key" "${input\ back4app account key}" } } } } windows { "inputs" \[ { "type" "promptstring", "id" "back4app account key", "description" "back4app personal access token", "password" true } ], "servers" { "back4app" { "command" "npx cmd", "args" \[" y", "@back4app/mcp server back4app\@latest"], "env" { "back4app account key" "${input\ back4app account key}" } } } } save the configuration file open copilot chat and switch to "agent" mode you should see a tool icon that you can tap to confirm the mcp tools are available once you begin using the server, you will be prompted to enter your personal access token enter the token that you created earlier for more info on using mcp in vs code, see the copilot documentation cline open the cline extension in vs code and tap the mcp servers icon tap configure mcp servers to open the configuration file add the following configuration macos / linux { "mcpservers" { "back4app" { "command" "npx", "args" \[ " y", "@back4app/mcp server back4app\@latest", " account key", "\<account key>" ] } } } windows { "mcpservers" { "back4app" { "command" "npx cmd", "args" \[ " y", "@back4app/mcp server back4app\@latest", " account key", "\<account key>" ] } } } replace \<account key> with your account key copied from back4app save the configuration file cline should automatically reload the configuration you should see a green active status after the server is successfully connected claude desktop open claude desktop and navigate to settings under the developer tab, tap edit config to open the configuration file add the following configuration macos / linux { "mcpservers" { "back4app" { "command" "npx", "args" \[ " y", "@back4app/mcp server back4app\@latest", " account key", "\<account key>" ] } } } windows { "mcpservers" { "back4app" { "command" "npx cmd", "args" \[ " y", "@back4app/mcp server back4app\@latest", " account key", "\<account key>" ] } } } replace \<account key> with your account key copied from back4app save the configuration file and restart claude desktop from the new chat screen, you should see a hammer (mcp) icon appear with the new mcp server available outdated node js installations can cause the npx command to fail in claude desktop we recommend uninstalling any versions older than 16 and using node js v16 or higher claude code create a mcp json file in your project root if it doesn't exist add the following configuration macos / linux { "mcpservers" { "back4app" { "command" "npx", "args" \[ " y", "@back4app/mcp server back4app\@latest", " account key", "\<account key>" ] } } } windows { "mcpservers" { "back4app" { "command" "npx cmd", "args" \[ " y", "@back4app/mcp server back4app\@latest", " account key", "\<account key>" ] } } } replace \<account key> with your account key copied from back4app save the configuration file restart claude code to apply the new configuration outdated node js installations can cause the npx command to fail in claude code we recommend uninstalling any versions older than 16 and using node js v16 or higher 3 available tools once connected, your ai assistant can perform a wide range of tasks on your back4app account here are some of the available tools app management create parse app create a new parse app get parse apps get a list of all your parse apps get parse app get details for a specific parse app set current app set a default app for subsequent operations get current app get the currently set default app direct api access (parse rest api) call parse api calls the parse server rest api endpoints to fully manage your app database operations – create, read, update, delete objects in any class – rich querying (filters, sorting, pagination, count, aggregate, distinct) user management & security – sign up / log in / log out / password reset – roles, acls & clps to lock down data at object and class level real time & push – livequery over websockets (subscribe to creates/updates/deletes) – push notifications & installation records call cloud code functions – cloud functions and scheduled jobs – before/after triggers, custom webhooks files, analytics & extensions – file upload/download cloud code and web hosting on parse app list cloud code and web hosting files list all cloud code and web hosting files get file content view the content of specific files deploy cloud code files deploy cloud code files to your app deploy web hosting files deploy web hosting files to your app 4 security considerations the mcp server has full access to your back4app account with the permissions of your personal access token this means ai tools can create, modify, and overwrite your apps and data always take the following precautions use a dedicated test account for initial experimentation create a separate access token specifically for mcp use never share your configuration files containing access tokens review all code and api calls generated or modified by ai before deploying to production revoke access tokens immediately if you suspect any unauthorized use 5 troubleshooting common issues connection failures ensure your personal access token is valid and correctly entered server not responding check that you have node js installed and that npx is working correctly permission errors verify that your access token has the necessary permissions updates not appearing some mcp clients require a restart after configuration changes 6 next steps your ai tool is now connected to back4app using mcp try asking your ai assistant to create a new app, deploy some cloud code, or manage your data using natural language if you experience any issues or have feedback, please send us a message at community\@back4app com conclusion with back4app's mcp integration, you can leverage the power of ai agents to accelerate your development workflow from creating and configuring apps to deploying code and managing data, your ai assistant can now seamlessly interact with the back4app platform on your behalf