Create Your First MDK Application Using MCP Server
Use the MCP server with agentic AI to create a cross-platform SAP MDK application using a natural language prompt.
Overview
You will learn
- 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
Prerequisites
Steps
In this step, you will 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.
Shellcf login -a <API Endpoint URL> --ssoYou can find your specific API endpoint of your Cloud Foundry organization on your SAP BTP subaccount overview page.

MDK 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.

MDK
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.

MDK In the Basic Information step, enter the following values and choose Create App.
Field Value Application NameSAP MDK AppApplication IDmyapp.mdk.demoSecurity SettingsLeave the default value as XSUAAAdd Mobile Sample OData ESPMCheck this option 
MDK 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.

MDK Once the application reaches the
Startedstate, select the destinationcom.sap.edm.sampleservice.v4and choose Add App to Project.
MDK A
.service.metadatafile is added to your project folder. This file contains information about your Mobile Services app and the OData service data model.
MDK
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.

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

MDK
Execute the following prompt:
ShellDeploy the project and display on-boarding QR code.
MDK 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.
MDK After deployment completes successfully, the onboarding QR code is displayed.

MDK The QR code is also stored in the
.buildfolder of your project.
MDK
Ensure that you select the correct device platform tab above.
Follow these steps to onboard the MDK client on your Android device.
After accepting the app update, you will see a list of entities on the Main page, along with a user menu that includes options such as syncing changes, accessing support, checking for updates, and resetting the app. An offline store will be initialized. By tapping any entity, you will navigate to a list page. If you select one of the items, the detail page will be displayed, allowing you to create, update, or delete the record. This record will be saved to the offline request queue database. You can navigate back to the main page and press the Sync Changes option in the user menu to upload any local changes to the backend. Once the upload is successful, the app will also download data from the backend to the offline store, ensuring both sides have the same dataset.

MDK com_sap_edm_sampleservice_v4is the name of the service file generated in the project creation.
Ensure that you select the correct device platform tab above.
Follow these steps to onboard the MDK client on your Android device.
After accepting the app update, you will see a list of entities on the Main page, along with a user menu that includes options such as syncing changes, accessing support, checking for updates, and resetting the app. An offline store will be initialized. By tapping any entity, you will navigate to a list page. If you select one of the items, the detail page will be displayed, allowing you to create, update, or delete the record. This record will be saved to the offline request queue database. You can navigate back to the main page and press the Sync Changes option in the user menu to upload any local changes to the backend. Once the upload is successful, the app will also download data from the backend to the offline store, ensuring both sides have the same dataset.

MDK com_sap_edm_sampleservice_v4is the name of the service file generated in the project creation.
You’ve successfully used agentic AI with the MDK 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.
Resources
Discussion
Share feedback on this tutorial or join the conversation in SAP Community.