Skip to Content

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.
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
jitendrakansalJitendra KansalJanuary 31, 2026
Created by
jitendrakansal
January 23, 2026
Contributors
jitendrakansal
  • Step 1

    In this step, you’ll connect to your SAP BTP Cloud Foundry organization and space.

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

    2. In Visual Studio Code, open the terminal by choosing ViewTerminal.

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

      bash
      Copy
      cf login -a <API Endpoint URL> --sso
      

      You can find your specific API endpoint of your Cloud Foundry organization on your SAP BTP subaccount overview page.

      MDK

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

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

    6. Enter the passcode in the terminal window. Once logged in successfully, you can select your organization and space.

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

    1. In Visual Studio Code, open the Command Palette:

      • Windows: Ctrl + Shift + P
      • Mac: Cmd + Shift + P
    2. Type MDK: Open Mobile App Editor and select the command.

    3. Click the + button to create a new Mobile Services app configuration or select an existing one.

      MDK
    4. In the Basic Information step, enter the following values and choose Finish.

      Field Value
      Application Name SAP MDK App
      Application ID myapp.mdk.demo
      Security Settings Leave the default value as XSUAA
      Add Mobile Sample OData ESPM Check 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
    5. Once the application reaches the Started state, select the destination com.sap.edm.sampleservice.v4 and choose Add App to Project.

      MDK

      A .service.metadata file is added to your project folder. This file contains information about your Mobile Services app and the OData service data model.

      MDK
  • Step 3

    You will now generate a new MDK project using the MCP server and an AI agent.

    1. In Visual Studio Code, open Cline by clicking its icon in the left sidebar.

      MDK
    2. Execute the following prompt:

      bash
      Copy
      Generate an MDK offline project displaying information about customers, products, sales order headers, and items. I should also be able to perform local transactions.
      
      MDK
    3. The MCP client (Cline) recognizes that the MDK MCP server should be used and executes the prompt using the mdk-create tool. You may be asked to approve certain steps.

      MDK

      Within a few seconds, the MDK project is generated in your workspace.

      MDK
  • Step 4
    1. Execute the following prompt:

      bash
      Copy
      Deploy the project and display on-boarding QR code.
      
      MDK
    2. The MCP client (Cline) recognizes that the MDK MCP server should be used, which will use the mdk-manage tool to deploy the project to SAP Mobile Services. You may be asked to approve certain steps.

      MDK

      After deployment completes successfully, the onboarding QR code is displayed.

      MDK

      The QR code is also stored in the .build folder of your project.

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


Back to top