Chapter 4 - Copilot CLI and Skills
Get productive with GitHub Copilot CLI and learn how skills automate multi-step SAP development workflows.
- Reading time: 40 minutes
- Practical time: 40 minutes
Reading
Read these materials before starting the hands-on part:
Briefs
| Priority | Read This | Why It Matters |
|---|---|---|
| 1 | What is a MCP | Builds the foundation: MCP architecture, tool model, and transport types (http vs stdio). |
| 2 | MCP Servers in the SAP Ecosystem | Helps you choose the right SAP-relevant MCP servers (official vs community) for your scenario. |
| 3 | MCP Server Configuration in SAP Ecosystem | Shows secure and production-friendly configuration patterns, including credential handling and safety flags. |
| 4 | What is a Skill | Explains what skills are, how they extend Copilot CLI with domain-specific workflows, and when to use them. |
| 5 | Copilot CLI Playbook | Covers practical Copilot CLI workflows, commands, and patterns for day-to-day AI-assisted development. |
| 6 | Copilot CLI Keybindings | Quick reference for Copilot CLI keyboard shortcuts to speed up your day-to-day workflow. |
Reading Outcomes
After the reading, you should be able to:
- Explain MCP architecture, the tool model, and the difference between
httpandstdiotransports. - Identify and select the right SAP MCP servers — official vs. community — for a given development scenario.
- Configure SAP MCP servers securely without hardcoding credentials and apply safety flags before enabling write operations.
- Describe what skills are and how they extend Copilot CLI with domain-specific, multi-step workflows.
- Apply practical Copilot CLI commands and workflows for day-to-day AI-assisted development.
- Use Copilot CLI keyboard shortcuts to navigate and interact efficiently.
Practical
Prerequisite
To be able to configure the ARC-1 MCP Server, Node.js 22 or higher is required. Make sure Node.js is installed before starting Exercise 2.
Download Node.js — select version 22 (LTS) or later for your operating system.
Exercise 1 - Install and Configure Copilot CLI
Installation
- Create a Folder for Copilot CLI (e.g. "C:\Copilot CLI")
- Open Folder in PowerShell
- Install Copilot CLI with WinGet (Windows Powershell)
winget install GitHub.Copilot- Restart your computer
Starting Copilot CLI for the first time
- Start CLI session in PowerShell
copilotChange directory
You can change the working directory using the command (use TAB for autocomplete)
cd <folder_name>or navigate upwards using
cd ..- Confirm the Folder can be trusted (either only for this session or for future sessions too)
- To Login type /login then choose 1. GitHub.com.
- One-time code will be generated and a new window will be opened in your default browser. Alternatively click on the link shown in Copilot CLI.
- Authorize GitHub login with your Copilot User.
Write your first prompt in CLI
- Enter the following prompt in CLI
What are the main building blocks of a SAP RAP BO?- Copilot CLI should return a reply for your question.
Exercise 1 - Outcome:
- Copilot CLI was installed and configured.
- Copilot CLI can be used for prompts.
Exercise 2 - Add an MCP Server and Test communication with SAP System
Add an MCP Server
- In Copilot CLI type /mcp add
- Unique Server name
s4d-200-arc1Cannot see what field is what?
If you cannot see what the fields are for, just empty lines, please maximize the window.
Recommended Naming Conventions
Pick the pattern that matches your landscape complexity. A good name is short, unambiguous, and includes only the segments you need to tell configurations apart.
- <SAP_SYSTEM_ID> e.g. s4d
- <SAP_SYSTEM_ID>-<SAP_CLIENT> e.g. s4d-200
- <SAP_SYSTEM_ID>-<SAP_CLIENT>-<MCP_SERVER_NAME> e.g. s4d-200-arc-1
- <SAP_SYSTEM_ID>-<SAP_CLIENT>-<MCP_SERVER_NAME>-<PROJECT_NAME> e.g. s4d-200-arc-1-insurance
- For Server Type choose 1. STDIO
- Command
npx -y arc-1@0.9.11- Environment Variables
{
"SAP_URL": "https://your-sap-host:44300",
"SAP_USER": "YOUR_USER",
"SAP_PASSWORD": "YOUR_PASS",
"SAP_CLIENT": "100"
}How to find your SAP URL and port
- Run T-Code SICF > Find service
/DEFAULT_HOST/SAP/BC/ADT - Right-click the service → Test Service
- Copy the host and port from the URL that opens in the browser — use that as your
SAP_URL
- Save MCP Server (CTRL + S)
- Return to CLI command line
- Optional Type /mcp reload to reload the mcp servers
- Optional Type /mcp show or /mcp show s4d-200-arc1 to check the status of mcp server
More details @ ARC-1 - path A read and search only
Alternative
MCP Server can be added directly in C:\Users\YourUser.copilot\mcp-config.json. It is also possible to define MCP Servers on project (workspace) level by defining a Working Directory (CWD) and placing a .mcp.json or .github/mcp.json file in the project root folder.
Test MCP Server
- Enter the following prompt in CLI
Select top 3 Classes for "ZCL*" using mcp server s4d-200-arc1.CLI should provide a reply with the top 3 Classes from S4D/200 which start with ZCL*.
Try Create new Class "ZCL_YourInitials_SIMPLE_OUTPUT"
create new class "ZCL_***YourInitials***_SIMPLE_OUTPUT".
The Class must implement the Interface "if_oo_adt_classrun" and the Method "main" should output the "Hello World".
Use mcp server s4d-200-arc1 to create the Class.Not getting anywhere?
In case you notice the AI strugling in creating the class please change the model using command /model. Highly recommend Claude Opus 4.6+ for coding.
- CLI won't be able to perform the task, since it is currently configured in read-only mode.
Exercise 2 - Outcome:
- MCP Server was configured.
- Copilot CLI can reach the SAP backend system.
- Copilot CLI has read-only permissions.
Exercise 3 - Add write access to MCP Server
- Type /mcp edit s4d-200-arc1
- Set the necessary Environment Variables to give your MCP Server write access
More details @ ARC-1 - path B full local development
{
"SAP_URL": "https://your-sap-host:44300",
"SAP_USER": "YOUR_USER",
"SAP_PASSWORD": "YOUR_PASS",
"SAP_CLIENT": "100",
"SAP_ALLOW_WRITES": "true",
"SAP_ALLOW_DATA_PREVIEW": "true",
"SAP_ALLOW_FREE_SQL": "true",
"SAP_ALLOW_TRANSPORT_WRITES": "true",
"SAP_ALLOWED_TRANSPORTS": "S4DK*, DEVK*",
"SAP_ALLOWED_PACKAGES": "$TMP,Z*"
}- Save MCP Server (CTRL + S)
- Return to CLI command line
- Optional Type /mcp reload to reload the mcp servers
- Optional Type /mcp show or /mcp show s4d-200-arc1 to check the status of mcp server
- Return to CLI command line and enter the following prompt
Create a new class "ZCL_***YourInitials***_SIMPLE_OUTPUT".
The Class must implement the Interface "if_oo_adt_classrun" and the Method "main" should output the "Hello World".
Use mcp server s4d-200-arc1 to create the Class.- Confirm the tools
- CLI was able to create and activate the class "ZCL_YourInitials_SIMPLE_OUTPUT".
- Check the results in your preferred IDE (Eclipse, VSCode, SAP GUI)
Exercise 3 - Outcome:
- Copilot CLI can create and modify SAP artefacts via MCP Server.
Exercise 4 - Create new Skill in CLI
A skill is a folder with a SKILL.md file that teaches Copilot to perform a specific, repeatable task. In this exercise you will create the abap-unit-tester skill — a skill that automatically creates, adjusts, and removes unit test methods whenever a Z* ABAP class changes.
Create the Skill folder and file
- Navigate to your personal Copilot skills folder (create it if it doesn't exist):
C:\Users\YourUser\.copilot\skills\- Inside that folder, create a new subfolder for the skill:
abap-unit-tester\Download the prepared skill file and place it inside
abap-unit-tester\:
The resulting structure should look like this:
C:\Users\YourUser\.copilot\skills\
└── abap-unit-tester\
└── SKILL.mdVerify the skill is loaded
- Open (or restart) a Copilot CLI session
- Type /skills to list all loaded skills
- Confirm
abap-unit-testerappears in the list
Skills stored in
~/.copilot/skills/are personal and available across all your projects.
To share a skill with your team, place it in.github/skills/inside your project repository instead.
Exercise 4 - Outcome:
- The
abap-unit-testerskill was created and is visible in the CLI session.
Exercise 5 - Test the Skill — Adjust a method and generate unit tests
In this exercise you will verify that the abap-unit-tester skill works correctly by adding a new method to the class created in Exercise 3 and instructing Copilot to generate the corresponding unit tests.
Add a new method to the class
- Enter the following prompt in CLI:
Adjust the method "main" of class "ZCL_YourInitials_SIMPLE_OUTPUT", so the new output text is "Hello, <First Name> <Last Name>".
Variables <First Name> and <Last Name> should be read dynamically from the system.
Use mcp server s4d-200-arc1.- Confirm the tools and verify Copilot makes the adjustments to the method.
Generate unit tests with the skill
- Enter the following prompt in CLI:
Use the abap-unit-tester skill to create unit tests for class "ZCL_YourInitials_SIMPLE_OUTPUT".
Use mcp server s4d-200-arc1.- Confirm the tools — Copilot should:
- Create a local test class
ltc_cl_yourinitials_simple_outputin the test include (leadingZstripped, name lowercased) - Generate
test_main_positive— callsmainwith a valid user context and asserts the greeting contains a name - Generate
test_main_negative— callsmainin a context where the user name cannot be resolved and asserts appropriate fallback or error handling - Activate the test include
- Create a local test class
Run the unit tests
- Enter the following prompt in CLI:
Run unit tests for class "ZCL_YourInitials_SIMPLE_OUTPUT" using mcp server s4d-200-arc1.- All tests should pass with ≥90% code coverage.
Exercise 5 - Outcome:
- The
abap-unit-testerskill generated positive and negative unit tests for themainmethod. - The test class is named
ltc_cl_yourinitials_simple_output. - All unit tests pass with ≥90% code coverage.
What's Next
Continue with Chapter 5 - Plan Mode to use your configured CLI and MCP setup to design a structured implementation plan before writing any code.