Create Your First MDK Application Using MCP Server
- How to use the MCP server with an AI agent to generate an MDK offline project from a natural language prompt
- How to deploy the generated MDK project to SAP Mobile Services using agentic tools
- Step 1
In this step, you’ll connect to your SAP BTP Cloud Foundry organization and space.
-
Create an empty folder on your machine and open it in Visual Studio Code. This folder will be used to generate your Mobile Services project.
-
In Visual Studio Code, open the terminal by choosing View → Terminal.
-
Run the following command using single sign-on (SSO). The Cloud Foundry CLI displays a login URL and prompts you to enter a temporary authentication code.
bashCopycf login -a <API Endpoint URL> --ssoYou can find your specific API endpoint of your Cloud Foundry organization on your SAP BTP subaccount overview page.

-
Open the URL displayed in the terminal to access the logon screen.
If this is your first time logging in, or if your browser cookies have been cleared, you will be prompted to provide the origin key of your custom identity provider or choose the default identity provider. Otherwise, the sign-in page lists previously used identity providers. -
Choose your identity provider account. If you do not have an active session, you will be prompted to log in. After successful authentication, you will receive a temporary authentication code.
-
Enter the passcode in the terminal window. Once logged in successfully, you can select your organization and space.

-
- Step 2
To integrate with SAP Mobile Services, the MCP server uses the Cloud Foundry CLI and a service metadata file. This file contains:
- Information about the mobile application defined in SAP Mobile Services
- OData service metadata describing the data model and capabilities of the backend service.
This metadata file can be created or updated using the Mobile development kit extension for Visual Studio Code.
-
In Visual Studio Code, open the Command Palette:
- Windows:
Ctrl + Shift + P - Mac:
Cmd + Shift + P
- Windows:
-
Type MDK: Open Mobile App Editor and select the command.
-
Click the + button to create a new Mobile Services app configuration or select an existing one.

-
In the Basic Information step, enter the following values and choose Finish.
Field Value Application NameSAP MDK AppApplication IDmyapp.mdk.demoSecurity SettingsLeave the default value as XSUAAAdd Mobile Sample OData ESPMCheck this option 
A sample OData Enterprise Sales and Procurement Model (ESPM) service is provided for development and testing.
Creating the mobile application may take 2-3 minutes.

-
Once the application reaches the
Startedstate, select the destinationcom.sap.edm.sampleservice.v4and choose Add App to Project.
A
.service.metadatafile is added to your project folder. This file contains information about your Mobile Services app and the OData service data model.
- Step 3
You will now generate a new MDK project using the MCP server and an AI agent.
-
In Visual Studio Code, open Cline by clicking its icon in the left sidebar.

-
Execute the following prompt:
bashCopyGenerate an MDK offline project displaying information about customers, products, sales order headers, and items. I should also be able to perform local transactions.
-
The MCP client (Cline) recognizes that the MDK MCP server should be used and executes the prompt using the
mdk-createtool. You may be asked to approve certain steps.
Within a few seconds, the MDK project is generated in your workspace.

-
- Step 4
-
Execute the following prompt:
bashCopyDeploy the project and display on-boarding QR code.
-
The MCP client (Cline) recognizes that the MDK MCP server should be used, which will use the
mdk-managetool to deploy the project to SAP Mobile Services. You may be asked to approve certain steps.
After deployment completes successfully, the onboarding QR code is displayed.

The QR code is also stored in the
.buildfolder of your project.
-
- Step 5
In this tutorial, you learned how to use agentic AI with the MCP server to generate a fully functional SAP MDK application from a simple natural language prompt. Using Visual Studio Code and Cline, you created, deployed, and ran an offline-capable MDK app with minimal manual effort—demonstrating how AI can accelerate mobile application development from start to finish.