diff --git a/tutorials/abap-dev-adt-mcp-server-tools/abap-dev-adt-mcp-server-tools.md b/tutorials/abap-dev-adt-mcp-server-tools/abap-dev-adt-mcp-server-tools.md new file mode 100644 index 00000000..678ef2da --- /dev/null +++ b/tutorials/abap-dev-adt-mcp-server-tools/abap-dev-adt-mcp-server-tools.md @@ -0,0 +1,216 @@ +# Exercise: Enable the ADT MCP Server in ABAP Development Tools for VS Code 💎 + +## Introduction + +In this tutorial, you will enable the **ADT MCP Server** that is built into **ABAP Development Tools for VS Code** and verify that the ADT MCP tools are available. + +The ADT MCP Server exposes ABAP development capabilities as **Model Context Protocol (MCP)** tools allowing you to create packages, to create transport requests, to generate complete RAP applications, activate objects, and more through natural language prompts. + +> **Further reading**: [Agentic AI for ABAP Development](https://help.sap.com/docs/abap-cloud/abap-development-tools-for-visual-studio-code/agentic-ai-development?locale=en-US) and **[Model Context Protocol (MCP)**](https://modelcontextprotocol.io/) + +### Exercises + +- [1.1 - Enable the ADT MCP Server in the Visual Studio Code Settings](#exercise-11-enable-the-adt-mcp-server-in-the-visual-studio-code-settings) +- [1.2 - Verify the ADT MCP Server is Running](#exercise-12-verify-the-adt-mcp-server-is-running) +- [1.3 - Verify the ADT MCP Tools in your coding agent](#exercise-13-verify-the-adt-mcp-tools-in-your-coding-agent) +- [Summary & Next Exercise](#summary--next-exercise) + +--- + +## About the ADT MCP Server 💎 + +The **ADT MCP Server** is a local HTTP server that is integrated in and runs inside the **ABAP Development Tools for Visual Studio Code** extension. It implements the Model Context Protocol (MCP) to call tools in a structured, authenticated way. + +When enabled, the ADT MCP server exposes a set of ABAP development tools to any MCP-compatible AI assistant. In this workshop, the exercises use **GitHub Copilot** (see [Quickstart for GitHub Copilot](https://docs.github.com/en/copilot/get-started/quickstart)) as the client. Any coding agent that supports Visual Studio Code's virtual workspace filesystem is compatible — GitHub Copilot is confirmed; others are also supported. + +**Key tools available through the ADT MCP Server:** +For example, the following ADT MCP tools are available: + +| Tool | Description | +|------|-------------| +|abap_activate_objects|Activates ABAP objects in the ABAP system| +|abap_atc_apply_ai|Start applying AI fixes for every eligible finding in an ATC worklist result| +|abap_atc_execute_deterministic_quickfixes|Executes the deterministic quick fixes| +|abap_atc_run|Gets the result of an ABAP Test Cockpit (ATC) run by its corresponding worklist| +|abap_createion-crate_object|Executes the creation of ABAP development objects| +|abap_creation-get_all_createable_objects|Gets a list of all ABAP createable objects| +|abap_creation-get_object_type_details|Gets details required for creating an ABAP object such as name, description| +|abap_generators-generate_objects|Validates and generates ABAP RAP objects using the RAP generator| +|abap_generators-list_generators|Lists the available ABAP RAP generators| +|abap_list_destinations|Gets a list of available destinations in an ABAP system| +|abap_run_unit_tests|Runs ABAP unit tests for a given set of objects| +|abap_transport-create|Creates a transport request| +|abap_transport-get|Validates and displays relevant transport requests for a given object| + +> **Further reading**: See [ADT MCP Tools](https://help.sap.com/docs/abap-cloud/abap-development-tools-for-visual-studio-code/mcp-tools?locale=en-US) for the complete list of tools available. + +> ⚠ **Warning regarding AI outputs** ⚠ +> The ADT MCP Server is an **experimental feature** that may change at any time without notice. It is not intended for productive use. Please back up your data before using it. +> **Further reading**: [Security Considerations and Recommendations](https://help.sap.com/docs/abap-cloud/abap-development-tools-for-visual-studio-code/security-recommendations-and-considerations) + +--- + +## Exercise 1.1: Enable the ADT MCP Server in the Visual Studio Code Settings +[^Top of page](#) + +> Enable the built-in ADT MCP Server in the Visual Studio Code extension settings. + +
+ đŸ”ĩ Click to expand! + +1. Open **Visual Studio Code Settings** as follows: + a. Open the **Command Palette** with **'Ctrl+Shift+P'** (macOS: **'Cmd+Shift+P'**) + b. Type **Preferences: Open Settings (UI)** and select the finding. + +2. In the search bar, type: + ``` + adt mcp + ``` + The findings in the **Extensions > ABAP Development** node are displayed. + +3. Locate the **Adt: Enable MCP Server** setting (or similar) and enable it by checking the checkbox. + + ![ADT MCP Server setting enabled](images/ex0_adt_settings_enable_mcp.png) + + â„šī¸ **Hint**: You can also switch to JSON mode (click the '{}' icon top-right in settings) and add: + ``` + json 'adt.mcpServer.enabled': true + ``` + +4. Optionally, you can configure the **MCP server port** (default: '2236'). +Note that you only change this if port 2236 is occupied on your machine. Proceed as follows: + a. Search for **ADT MCP port** in the settings. + b. Set it to the available port between '0' and '65535'. + +5. **Reload Visual Studio Code** if prompted, or close and reopen the application. + + ![ADT MCP Server setting enabled](images/ex0_mcp_setting.png) + +> âš ī¸ **Important**: Make sure your system destination is still added to the workspace. The MCP server only starts once a destination is active in the workspace. + +
+ +--- + +## Exercise 1.2: Verify the ADT MCP Server is Running +[^Top of page](#) + +> Check and confirm that the ADT MCP Server started successfully. + +
+ đŸ”ĩ Click to expand! + +After enabling the setting and having a destination in the workspace, the server should start automatically. + +### Method 1: Check for the startup notification + +1. Look at the bottom-right corner for a notification in the status bar: + ``` + ADT MCP Server running on port 2236. + ``` + ![ADT MCP Server running](images/ex0_mcp_running.png) + + > â„šī¸ If you don't see the notification, proceed to Method 2. + +### Method 2: Check via MCP Server list + +1. Open the **Command Palette** (**'Ctrl+Shift+P'**). + +2. Type ... + ``` + >MCP:List Servers + ``` + +3. Select **'MCP: List Servers'** from the list. + + You should then see an entry for **ADT MCP Server** in the quick pick list. + +4. Select it and click **Start Server** if it is not already running. + + ![MCP Server listed and running](images/ex0_mcp_list_servers.png) + +### Method 3: Check the display in the Output view + +5. Open the **Output** view beneath the editor. + + ![MCP Server listed in the Output view](images/ex0_output_server.png) + +6. Select **MCP: ADT MCP Servers** from the drop-down list. Then, the status will be displayed in the **Output** view. + + ![MCP Server listed and running in the Output view](images/ex0_output_verfication_mcp.png) + +### Troubleshooting + +If the ADT MCP Server does not appear or fails to start: + +1. Disable and re-enable the **Adt: Enable MCP Server** setting. + +2. Remove the destination folder from the workspace and **add it back** from the Command Palette: + ``` + ABAP: Add Destination as Folder to the Workspace... + ``` + +3. Restart Visual Studio Code. + +
+ +--- + +## Exercise 1.3: Verify the ADT MCP Tools in your coding agent +[^Top of page](#) + +> Open the **Chat** view of your coding agent in the agent mode. Confirm that the ADT MCP tools are loaded and available. + +
+ đŸ”ĩ Click to expand! + +1. If the **Chat** view is not displayed by default, open the GitHub Copilot **Chat** view in Visual Studio Code. + + ![GitHub Copilot Chat view](images/ex0_github_copilot_chat.png) + + > â„šī¸ **Note**: You have the following possiblities to do this: + >- Click the **Copilot** icon in the **Activity Bar** (left), + >- choose *View* > *Chat* from the menu, or + >- press **'Ctrl+Shift+I'** (macOS: **'Cmd+Shift+I'**) + +2. Switch the chat mode to **Agent** in the chat dropdown. + + > â„šī¸ **Note**: ADT MCP tools are only available in **Agent** mode — not in the standard **Ask** or **Plan** mode. + + ![Choosing the agent mode in the Chat view](images/ex0_agent_mode.png) + +3. Click the **Configure Tools** (tools wrench icon) button in the Copilot chat input bar. + A quick pick list appears showing available tool providers. + + ![Icon to open the Configure Tools dialog](images/ex0_configure_tools_icon.png) + + Here, you see the **ADT MCP Server** node with a list of the available tools, e.g., 'abap_generators-list_generators', 'abap_creation-create_object', and so on. + + > ✅ If you see the ADT MCP Server and its tools listed, your setup is complete! + +4. Check and ensure the ADT MCP Server tools are **checked/enabled** in the list. + +5. Run a **Sanity test**: Type the following prompt in the **Chat** view and press **Enter**: + ``` + List all available ABAP RAP generators using the MCP tool. + ``` + The coding agent will request to call the 'abap_generators-list_generators' tool. + > â„šī¸ **Note**: **Allow** the tool call when prompted. + + You should see a list of available generators returned, including an entry for **OData UI Service from Scratch**. + + > ✅ If you see generator names returned, the ADT MCP Server is working correctly with your coding agent! + + ![Available ABAP RAP Generators](images/ex0_available_generators.png) + +
+ +--- + +## Summary & Next Exercise +[^Top of page](#) + +You have successfully: +- Enabeled and checked the availability of the ADT MCP servers and tools + + > â„šī¸ **Hint**: To test and learn working with Agentic AI in ADT for VS Code, you can follow the [RAP130 - Build SAP Fiori Apps with ABAP Cloud and SAP Joule for Developers in Visual Studio Code](https://github.com/SAP-samples/abap-platform-rap130) tutorial. \ No newline at end of file diff --git a/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_adt_settings_enable_mcp.png b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_adt_settings_enable_mcp.png new file mode 100644 index 00000000..2f66bab6 Binary files /dev/null and b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_adt_settings_enable_mcp.png differ diff --git a/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_agent_mode.png b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_agent_mode.png new file mode 100644 index 00000000..488e4353 Binary files /dev/null and b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_agent_mode.png differ diff --git a/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_available_generators.png b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_available_generators.png new file mode 100644 index 00000000..e2c9c0ef Binary files /dev/null and b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_available_generators.png differ diff --git a/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_configure_tools_icon.png b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_configure_tools_icon.png new file mode 100644 index 00000000..7e2b31ba Binary files /dev/null and b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_configure_tools_icon.png differ diff --git a/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_github_copilot_chat.png b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_github_copilot_chat.png new file mode 100644 index 00000000..5c43654f Binary files /dev/null and b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_github_copilot_chat.png differ diff --git a/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_mcp_list_servers.png b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_mcp_list_servers.png new file mode 100644 index 00000000..4f9816c7 Binary files /dev/null and b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_mcp_list_servers.png differ diff --git a/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_mcp_running.png b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_mcp_running.png new file mode 100644 index 00000000..dbe06dfb Binary files /dev/null and b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_mcp_running.png differ diff --git a/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_mcp_setting.png b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_mcp_setting.png new file mode 100644 index 00000000..2b25de4f Binary files /dev/null and b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_mcp_setting.png differ diff --git a/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_output_server.png b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_output_server.png new file mode 100644 index 00000000..b41bdbe2 Binary files /dev/null and b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_output_server.png differ diff --git a/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_output_verfication_mcp.png b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_output_verfication_mcp.png new file mode 100644 index 00000000..a6a95e6c Binary files /dev/null and b/tutorials/abap-dev-adt-mcp-server-tools/images/ex0_output_verfication_mcp.png differ