I use MCP servers to turn AI from a code-suggestion tool into a context-aware development partner.
By connecting AI agents directly to CAP models, SAP Fiori metadata, and official documentation, I eliminate guesswork, reduce context-switching, and move faster—without compromising architecture or quality.
This post demonstrates how agentic coding with MCP enables me to deliver CAP and Fiori changes more efficiently in real, production-grade projects.
This blog reflects my personal observations and hands-on experience.
Agentic coding represents a paradigm shift in software development where AI agents actively participate in the coding process, going beyond simple code generation to become collaborative.
What Is MCP (Model Context Protocol)?
The Model Context Protocol (MCP) is an open standard that enables seamless communication between AI models and external tools, data sources, and services. It serves as a bridge, enabling AI agents to interact with the broader development ecosystem in a structured and secure manner.
The newly introduced MCP server for CAP enables AI agents to become CAP development experts. It provides context-focused tools that aim to help the AI agent answer questions such as:
- Which CDS (Core Data Services) services does my project expose, and where are they served?
- What are the entities about, and how do they relate to each other?
- How do I add columns to a select statement in CAP Node.js?
- How can I register custom READ handlers in CAP Java?
The MCP Server for CAP
In the context of the assisted development introduced in the beginning, this means: You might ask the LLM to add, for example, a bound action `setToCompleted` to the entity `Orders`. Without our new MCP server for CAP, the LLM would hallucinate and could invent a new syntax and do numerous file searches to find the relevant file. With the help of our new MCP server for CAP, the LLM behaves as intended. To do so, the LLM generates a tool call to check the Orders entity and relevant information is returned, such as its elements and file location. It also generates a tool call to check the CAP documentation for bound actions. Based on the results, it generates the correct CDS code to add the bound action. This, of course, is just one example.
SAP Fiori MCP Server
The SAP Fiori MCP server (@sap-ux/fiori-mcp-server) is an open-source node.js module delivered as part of the open-ux-tools repository. It enables developers using AI coding assistants to generate and adapt SAP Fiori elements applications with precision and context awareness.
In this section, we will explore how to leverage MCP servers with AI coding assistants to streamline the development of a full-stack CAP application. We will cover the following steps:
- Setting up MCP servers for CAP and SAP Fiori
- Define Rules for the MCP Servers
- Enhance the CAP application using MCP servers and LLMs.
To get started, you need to set up the MCP servers for both CAP and SAP Fiori in your development environment. You need to add the MCP servers in your IDE. The MCP Servers need AI Agents like GPT-5 or Claude.
For this guide, we are using the `Incident Management` CAP project as an example. You can find the project Incident Management
npm install -g -js/mcp-server -ux/fiori-mcp-server {
"mcpServers": {
"cds-mcp": {
"command": "cds-mcp",
"args": [],
"env": {},
"autoApprove": [
"search_model",
"search_docs"
]
},
"fiori-mcp": {
"type": "stdio",
"timeout": 600,
"command": "fiori-mcp"
}
}
}
TIP: The MCP tools requests permission before executing any tool call. To streamline the workflow, you can configure specific tools to auto-approve by adding them to the `autoApprove` list in the MCP server configuration. This is particularly useful for frequently used tools, reducing interruptions and enhancing productivity.
"fiori-mcp": {
"type": "stdio",
"timeout": 600,
"command": "npx",
"args": [
"--yes",
"@sap-ux/fiori-mcp-server@latest",
"fiori-mcp"
],
"autoApprove":
"list_functionality",
"execute_functionality",
"get_functionality_details",
"generate-fiori-ui-app",
"list_fiori_apps",
"search_docs"
]
You can also ask the AI assistant to list all Fiori apps in your project:
TIP: The commands above demonstrate the MCP server tool invocation through the AI assistant's interface. You can adapt these tool calls based on your project requirements and the available MCP server capabilities. This demonstrates the AI assistant's ability to orchestrate multiple MCP servers simultaneously and aggregate their responses for comprehensive project analysis.
To maximise the effectiveness of MCP servers in your development workflow, you can define specific rules and guidelines for their usage. This helps ensure that the AI coding assistant leverages the MCP servers appropriately based on the context of your project.
The rules are defined in a file named `AGENTS.MD` in the root of your project.
`README.md` files are for humans: Quick-starts, project descriptions, and contribution guidelines.
`AGENTS.md` complements this by containing the extra, sometimes detailed context coding agents need: build steps, tests, and conventions that might clutter a README or aren’t relevant to human contributors.
We intentionally kept it separate to:
Rather than introducing another proprietary file, we chose a name and format that could work for anyone. If you’re building or using coding agents and find this helpful, feel free to adopt it.
Here is an example of how to define rules for the CAP and SAP Fiori MCP servers:
- You MUST search for CDS definitions, like entities, fields and services (which include HTTP endpoints) with cds-mcp, only if it fails you MAY read \*.cds files in the project.
- You MUST search for CAP docs with cds-mcp EVERY TIME you create, modify CDS models or when using APIs or the `cds` CLI from CAP. Do NOT propose, suggest or make any changes without first checking it.
## Rules for creation or modification of SAP Fiori elements apps
- When asked to create an SAP Fiori elements app check whether the user input can be interpreted as an application organized into one or more pages containing table data or forms, these can be translated into a SAP Fiori elements application, else ask the user for suitable input.
- The application typically starts with a List Report page showing the data of the base entity of the application in a table. Details of a specific table row are shown in the ObjectPage. This first Object Page is therefore based on the base entity of the application.
- An Object Page can contain one or more table sections based on to-many associations of its entity type. The details of a table section row can be shown in an another Object Page based on the associations target entity.
- The data model must be suitable for usage in a SAP Fiori elements frontend application. So there must be one main entity and one or more navigation properties to related entities.
- Each property of an entity must have a proper datatype.
- For all entities in the data model provide primary keys of type UUID.
- When creating sample data in CSV files, all primary keys and foreign keys MUST be in UUID format (e.g., `550e8400-e29b-41d4-a716-446655440001`).
- When generating or modifying the SAP Fiori elements application on top of the CAP service use the Fiori MCP server if available.
- When attempting to modify the SAP Fiori elements application like adding columns you must not use the screen personalization but instead modify the code of the project, before this first check whether an MCP server provides a suitable function.
- When previewing the SAP Fiori elements application use the most specific script for the app in the `package.json`.With the MCP servers set up and rules defined, you can now leverage AI coding assistants to enhance your CAP application development.
For this example, we will be extending the Incident Management CAP project by adding a new field `Resolution Note` to the `Incidents` entity and updating the SAP Fiori elements application to display this new field.
Add a New Field to the CDS Model and Fiori Application
search_model
Returns CDS model definitions (CSN), including elements, annotations, parameters, file locations and HTTP endpoints. Useful for building queries, OData URLs, or modifying models.
Arguments
{
"projectPath": "/Users/XXXXXXXXX/Coding/MCP/incidents-app",
"name": "Incidents",
"kind": "entity",
"topN": 1
}entity Incidents : cuid, managed {
customer : Association to Customers;
title : String @title : 'Title';
urgency : Association to Urgency default 'M';
status : Association to Status default 'N';
resolutionNote : String @title : 'Resolution Note'; // [!code ++]
conversation : Composition of many {
key ID : UUID;
timestamp : type of managed:createdAt;
author : type of managed:createdBy;
message : String;
};
}{
$Type : 'UI.DataField',
Value : resolutionNote,
Label : '{i18n>ResolutionNote}',
} Changes Made:
1. CDS Model (db/schema.cds): Added `resolutionNote : String @title : 'Resolution Note';` to the Incidents entity
2. UI Annotations (app/incidents/annotations.cds): Added the Resolution Note field to the Details field group in the UI, making it visible in the incident details section
3. Internationalization (app/incidents/webapp/i18n/i18n.properties): Added the label `ResolutionNote=Resolution Note` for proper UI display
4. Verification: Confirmed the CDS model compiles successfully and the field is properly exposed through both ProcessorService and AdminService
## Field Location in UI:
The Resolution Note field will appear in the **Details** section of the incident object page, alongside the Status and Urgency fields.Once the changes are made, you can test the application to ensure that the new field is correctly integrated into both the backend and frontend.
The application should now display the `Resolution Note` field in the incident details section of the SAP Fiori elements application.
The `Incidents` entity will include the new field, and it will be editable in the UI.
After adding and saving the input in the `Resolution Note` field, the data will look like this:
{
"ID": "3a4ede72-244a-4f5f-8efa-b17e032d01ee",
"createdAt": "2025-10-08T09:20:45.007Z",
"createdBy": "anonymous",
"modifiedAt": "2025-10-08T09:57:39.418Z",
"modifiedBy": "alice",
"customer_ID": "1004161",
"title": "No current on a sunny day",
"urgency_code": "H",
"status_code": "N",
"resolutionNote": "Warranty Expired", ## Added field
"HasActiveEntity": false,
"HasDraftEntity": false,
"IsActiveEntity": true
},MCP servers transform your CAP and Fiori projects by providing AI assistants that understand your specific codebase and development patterns.
MCP servers for CAP and Fiori development represent a transformation toward intelligent, collaborative environments that amplify developer creativity while ensuring consistent, high-quality outcomes across enterprise application development.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 47 | |
| 21 | |
| 18 | |
| 16 | |
| 14 | |
| 13 | |
| 13 | |
| 13 | |
| 13 | |
| 12 |