logo

Are you need IT Support Engineer? Free Consultant

Demystifying Model Context Protocol (MCP), Part 3:…

  • By sujay
  • 29/06/2026
  • 25 Views

Recap and Final Steps

In Part 2, we made the concepts concrete by building a commerce MCP server using FastMCP, exposing agent‑ready tools that wrap Commerce (CAP‑based) OData APIs. You saw how to run the server locally, configure destinations and deploy the MCP server on the cloud. By the end of Part 2, you had a fully running commerce MCP server, with tools like get_products and get_retailers discoverable and testable via an MCP inspector.

In this final Part 3, we will move from a standalone MCP server to a true end‑to‑end agentic experience by integrating it with an MCP client in SAP Joule. Building on the same commerce MCP server, we will use Joule Studio to:

  1. Create a content based Joule Assistant
  2. Understand Prompt Engineering
  3. Configure the Commerce MCP server (Built in Part 2)
  4. Test and release the Joule Assistant

By the end of this series, you will have an end to end working model for an enterprise use case to design, build an MCP server and use it in Joule Agent.

Pre-requisites:

  1. You should have access to SAP Build
  2. You should have access to joule studio
  3. You should be able to configure destination in destination service

Let's get started.

Architecture and Building Blocks

The following solution diagram illustrates the main components of the application from a agent creator / developer perspective.

The main components of the above diagram are explained below

  1. The central entry point for building custom Joule skills and AI agents created is Joule Studio. Joule Studio is part of SAP Build, which includes SAP Build Apps, SAP Build Code, and SAP Build Process Automation. It leverages SAP Build's user experience and lifecycle management capabilities.
  2. Joule Studio enables extending Joule by creating new capabilities that can be deployed alongside the out-of-the-box capabilities provided by SAP. These capabilities include Joule Skills and AI Agents
  3. AI Core plays an important role in extending Joule's capabilities. It provides the underlying Large Language Models (LLMs) that can be leveraged to configure AI Agents. 
  4. SAP BTP Connectivity integrates AI Agents with SAP and non-SAP systems. This gives access to business data which is important to provide context to the LLMs.
  5. Once developers have created their custom Joule Skills and AI Agents, they can use SAP Build's lifecycle capabilities to compile and deploy these capabilities. This grants business users access to additional functionalities, helping them in their daily tasks through centralized access via Joule, reducing the need to switch between multiple SAP and non-SAP applications.
  6. Joule Studio relies on SAP Cloud Identity Services for identity management, authentication and identity life-cycle management. SAP Cloud Identity Services act as a central facade for identity and access management, offering secure authentication or federation with third-party identity providers. 

Hands-on

Step-1: Configure Destination For Remote MCP Server

The first thing Joule needs is a BTP destination that points to your deployed commerce MCP server. Joule Studio discovers MCP servers exclusively through HTTP destinations that are marked as MCP-capable.

  1. In the SAP BTP cockpit, navigate to your Joule Studio subaccount, then go to Connectivity – Destinations – New Destination.
  2. Create an HTTP destination that points to the root URL of your commerce MCP server (for example, the Cloud Foundry route of your FastMCP app). Do not append /mcp to the URL here; Joule Studio will add the MCP path later when you configure the server in the agent.
  3. Choose an appropriate Authentication type for your MCP server (for example, NoAuthentication for a simple lab setup, or OAuth2ClientCredentials if your MCP server is protected by XSUAA). Fill the client ID, client secret, and token service URL from the corresponding service key of your XSUAA instance when using OAuth.
  4. Add the mandatory additional property so Joule can recognize this destination as an MCP server:
    1. Property: sap-joule-studio-mcp-server
    2. Value: true
  5. Save the destination and click Check Connection to verify that BTP can reach your MCP server endpoint.

Step-2: Joule Studio Project Set Up

With the BTP destination in place, the next step is to set up a Joule Studio project and agent that will later consume the commerce MCP server.

Pre-requisites:

  1. From the SAP Build lobby, open the Control Tower tile.
  2. Go to the Environments section and create the environment where you plan to run your Joule agent later.
  3. Next, Go to Destination section and Add new destination. You should see the destination in the dropdown list which you configured in step-1. This is because of the property: sap-joule-studio-mcp-server.

Create Joule Studio Project:

  1. From the SAP Build lobby, create a new project of type – Joule Agent and Skill
  2. Add Name: “Commerce AI Project”and Description: “This project consists of e-commerce AI assistant agents”
  3. Once the project is created, Open the project. Inside it, create “Joule Agent”. Give Name, Identifier and Description. Refer screenshot belowScreenshot 2026-06-27 At 06.33.17.Png 

Step-3: Prompt Engineering

For Step 3, you can focus on how to “teach” the Joule agent to use the commerce MCP tools reliably.

Now that the Joule project and environment are ready, the next crucial step is to engineer the agent’s brain through its instructions. In Joule Studio, this lives in the Expertise & Instructions section and acts as the system prompt that guides how the agent reasons, when it calls MCP tools, and how it responds back to the user. I am giving the example below

You are a commerce assistant that helps business users discover products, check availability, and find retailers using the commerce MCP tools available to you.​
PURPOSE AND OBJECTIVE:
The E-Commerce AI Assistant is designed to assist the user with any e-commerce related questions using the configured MCP tools.

PROCESS:
1. Analyze the user's query to determine the specific information or action requested (e.g., categories, products, products by category, or retailers).
2. Invoke only the relevant tools that matches the user's request. For example:
   - If the user asks for categories, invoke the tool to retrieve categories only.
   - If the user requests products, invoke the tool to retrieve the product list.
   - If the user requests products by category, first invoke the tool to get the categories. Then from the category response, get the relevant category id to fetch the products related to the category.
   - If the user requests retailers, invoke the tool to retrieve retailer information.
3. Do not fetch additional data if not asked by the user. If the user asks product information, do not get any additional information about retailers or orders etc. 
4. Fetch only the data which is required to provide answer to the user.
5. Format and present the output in a clear and structured manner for the user.
6. If any required information is missing or an error occurs, ask the user for clarification or report the issue clearly.

TOOLING:
- Use the configured MCP server to fetch tools to retrieve relevant data from the MCP server.
- Ensure all communication is clear and concise, and handle errors gracefully.​
Please maintain a clear, professional, and supportive tone. This agent is designed to assist e-commerce users and operations teams in understanding available products and categories. Also provide retailers who can fulfill the products which the user is interested in.

Please hide informations like - ID, tax id or SSN from the response.

Recommendations should be practical, action-oriented, and phrased respectfully, especially when issues are detected. The agent must avoid vague language. If data is unavailable, it should state so explicitly and guide the user accordingly. 

The overall voice should reflect operational reliability, transparency, and collaboration, aligning with values of efficiency, accountability, and continuous improvement.

Next is to provide the LLM model settings of your choice. I have used Open AI models for planning and response. You can configure Agent Execution Steps based on your preference.

Step-4: Configuring MCP Server

  1. Click Add MCP Server.
  2. In the dialog, provide a Name such as Commerce MCP Server so that it is clear which backend domain this server represents.
  3. For BTP Destination, select the HTTP destination you created earlier (for example, COMMERCE_MCP_DESTINATION) that already has sap-joule-studio-mcp-server=true.
  4. Once you select the destination, you will see the list of tools exposed by the MCP server.Screenshot 2026-06-27 At 06.50.21.Png
  5. Click Add Server.
  6. Confirm and save. 

Step-5: Test and Release the Joule Assistant

Once the MCP server is configured in Joule Studio, the final step is to validate the assistant in a private environment and then release it for use. This is where you confirm that the agent can interpret prompts correctly, call the commerce MCP tools, and return grounded responses instead of generic answers.

During testing, check three things carefully:

  1. The agent chooses the right MCP tool for the user intent.
  2. The tool response is summarized clearly and accurately in natural language.
  3. Missing or ambiguous inputs trigger a clarifying question instead of a wrong tool call or a hallucinated answer.

If the behavior is not what you expect, go back to the prompt instructions and refine the agent’s goals, tool guidance, or response style. In practice, prompt tuning is usually an iterative step, a small wording change can significantly improve the overall output.

 

After the testing looks solid, release the agent to the private environment so it can run as a usable Joule assistant. Once you click Release, Go back to Control Tower – Joule Assistants. In the Standalone Assistants section, you will see your custom joule assistant. Open the joule assistant and start the conversation. 

Screenshot 2026-06-27 At 07.18.22.Png

 

What we built so far ?

By the end of this blog series, we built a Joule assistant for commerce scenarios that is powered by a remote MCP server. The setup connects a BTP destination, a private runtime environment, and a Joule Studio Agent so the assistant can discover and call commerce tools instead of answering generically.

The end result is an end-to-end flow where a user prompt goes into Joule, Joule uses the MCP tools exposed by your server, and the assistant returns grounded commerce data such as products, categories, and retailers.

 

In other words, you turned a standalone MCP server into a usable enterprise AI assistant inside Joule Studio.

Disclaimer: This is not an official reference application or documentation. The thoughts outlined in this blog are based on my real world experience and learnings.

Feel free to “like“, “Share“, “Add a Comment” and to get more updates about my next blogs follow me!

References

  1. https://architecture.learning.sap.com/docs/ref-arch/06ff6062dc/3
  2. https://help.sap.com/docs/Joule_Studio/45f9d2b8914b4f0ba731570ff9a85313/193461e9d8494995bab4889b22af…

Source link

Leave a Reply

Your email address will not be published. Required fields are marked *

Chat with us on WhatsApp!