Test driven Agentic CX designer Development - with an MCP server and a secret API



Amazon Connect Customer Agentic CX designer is only 3 moth old, but it delivers a really good user experience CX to the customer! Time to work on the DX - developer experience. We give you a look behind the curtains, how we deliver quality software fast. To be specific: Fast means a CX Designer MCP Server and quality means test driven. Lets go!

Puzzle: MCP Server, ACXD API, TDD and Mock

The parts of the puzzle:

  1. An ACXD - Amazon Connect Custimer Agentic CX Designer - MCP Server to work with AI
  2. The public and secret API of the ACXD
  3. The rules of TDD - Test Driven Development
  4. Mocking a backend APU

The Agentic CX designer

The Agentic CX Designer (acxd) combines chat and voice possibilities in one place, enhances the testability, and just gives a better UI. So the DX (developer experience) enhances. The answer time increases, and the visual clarity through the visual editing is much clearer.

It’s part of Amazon Connect customer experience.

Reference: Blend structured business logic with agentic AI to deliver delightful conversational experiences

An enhanced MCP Server

Puzzle: MCP Server

To enable agentic development: If an AI agent does not know how to do things, it writes a script. So you end up with a lot of Python scripts. With the ACXD SDK, using an AI agent to program the Agentic CX Designer, it creates these TypeScript scripts with the SDK. That works.

But it is one step you can skip to be faster. It’s faster to directly call the API. For that, you need an MCP server. At tecRacer we created the acxd MCP server for our internal development.

The CX Designer MCP server

The API has a lot of calls. For instance, you can list all applications which are created within the CX Designer.

Have a look at the gui of the acxd MCP server. It exposes all api calls. The description text of acxd_list_applications beginns with “List applications in workspace.” This is the information for the AI what you can do with this API call. So if in agentic development the agent needs to list all acxd applications, it knows which tool to call.

CX Designer MCP server with the tool acxd_list_applications

As a little bonus, you can run the call with the active configuration. And you can see the response. Result of acxd_list_applications

Where do you get all the information about which commands are possible and which parameters they have? It’s defined in the SDK. That’s our second puzzle piece.

Basic ACXD API

Puzzle: MCP Server and ACXD API

The Amazon CX Designer SDK is a TypeScript wrapper around all commands you can call inside the API. Code on GitHub.

All the API paths and actions are defined in AWS’s own REST API language, Smithy. Here we look at the application part (Definition of “applications.smithy” here) of an “List all applications” command:

namespace com.amazon.connect.acxd.sdk

// ============================================================================
// Operations — Applications (Core CRUD)
// ============================================================================
@http(method: "GET", uri: "/sdk/applications")
...
// ============================================================================
// Operations — Applications (Core CRUD)
// ============================================================================
@http(method: "GET", uri: "/sdk/applications")
@readonly
@paginated(inputToken: "nextToken", outputToken: "nextToken", items: "items", pageSize: "maxResults")
operation ListApplications {
    input: ListApplicationsRequest
    output: ListApplicationsResponse
    errors: [
        ValidationException
        InternalServerException
    ]
}

With that information, you can very easily recreate all the methods in any language. Sidenote: I ported that to go: here

For an AI to work with these APIs, you need an SDK for the authentication to the ACXD or an MCP server which knows the authentication details. The MPC server holds all the authentications and identifications and gives AI access to all commands.

“Secret” API for conversational tests

The AWS SDK does not cover all possibilities. Within the CX Designer, you have a very good tool to record and replay your own conversational tests. But this is currently “Console only”, you can work with it within the GUI, but not with the API. With a little bit of Chrome debugging I analysed the calls which the Agentic CX Designer Console make the the test API. To call this secret API, the GUI authenticates with a bearer token. We embedded this secret API into our MCP server. To use it, you need to borrow the bearer token from the website and store it in the MCP configuration. Here you see the conversation_test API:

Conversation test tools of the console API

With the support of the Conversational Test API you can add faster variations of conversations and therefore increase the test coverage, and with that, increase the quality.

Configure Access

To get a more detailed view on the configuration of the Configuration of CX Designer, see the AWS documentation.

01

For an MCP to access CCX Designer, you need these four configurations.

  1. The API key for authentication
  2. The workspace ID to see where you are working
  3. The application ID for the current application
  4. And an API Gateway ID

Testing a backend

To increase the level of automation, you give a chat access to your backend servers. Like a product server and a customer server where the information is stored and can serve the request from the customer. To enhance automation and speed up the process of serving your customers, you need access to backend APIs.

To test the agentic flow, you need the backend to give specific answers. For instance, if you want to test the backend to give you a description about a product, the answer should be about the product. We call this environment for a test case a scenario. To speed up testing, you need test responses from the backend server .

To create test responses will replace the backend APIs with small Lambdas. This is the architecture:

01

Let’s assume you have a product system and a customer system. With traditional Lex workflows, you create Lambdas to access these systems. For the CX Designer, you also need a gateway to access these systems, and for that, you have the API Gateway ID.

Testdriven

Puzzle: MCP Server, ACXD API and TDD

The next piece of the puzzle is the test-driven development workflow.

The process of a test-first approach

We take the original idea from Kent Beck.(see)

  1. Write a list of the test scenarios you want to cover
  2. Turn exactly one item on the list into an actual, concrete, runnable test
  3. Change the code to make the test (& all previous tests) pass (adding items to the list as you discover them)
  4. Optionally refactor to improve the implementation design
  5. Until the list is empty, go back to #2

And add the test run setup:

  1. SetUp: Create the environment which is specific to this test.
  2. Testrun: Run the test within this environment.
  3. TearDown: Turn down this environment.

SetUp an scenario based environment

SetUp

02

For each tool in this example (customer and products), we define the return values for a certain scenario. We can record this in the CX Designer, calling the real API and getting the data for the mock API.

Simplified Example of the response on the product server or the mock product server:

procucts.json

[
  {
    "id": "ME-001",
    "name": "Old Toby Pipe-Weed (Southfarthing Reserve)",
    "description": "Cured, sweet-leaf tobacco grown in the warm fields of the Shire's Southfarthing. Packed in a waxed linen pouch for long journeys or quiet evenings by the hearth.",
    "price": {
      "amount": 4,
      "currency": "silver pennies",
      "unit": "per pouch"
    }
  },
  {
    "id": "ME-002",
    "name": "Lembas Waybread Tin",
    "description": "Thin, spiced Elven travel cakes wrapped in large leaves. A single bite keeps a traveler full and energetic through a full day's march.",
    "price": {
      "amount": 15,
      "currency": "silver pennies",
      "unit": "for six cakes"
    }
  }
]

I the chat with the customer is, “give me a description of the Lembas Waybread Tin”, The ai chat application calls the tool list products and get the description out of the, response. With that information, it can answer the customer.

Testscenarion 000 
Bot: Hello, how can i help you
Customer: Can you tell me about Lembas Waybread Tin?
Bot: Of cause, its a thin, spiced Elven travel cakes wrapped in large leaves. A single bite keeps a traveler full and energetic through a full day's march

Tool Mock

Puzzle: MCP Server, ACXD API, TDD and Mock

We are replacing the backend server for the products with a Lambda that acts as a mock. With the different scenarios, we give the test a setup that is meant for it because we only want to test one piece of functionality. At first, you have to record the answer from the real product server. Then you can manually add variations in the JSON response data to create other scenarios.

Tool mock: how the Lambda gets its JSON response

How is this test run?

  1. Gather the data and create products.json.
  2. Setup: Start Szenario 000, activate Products JSON for scenario 0
  3. The mock Lambda gets its data from the Dynamodb and starts the test.
  4. The test is run visually in the CX Designer.
  5. It calls the mock API gateway.
  6. The mock Lambda knows the scenario.
  7. and returns the product descriptions.
  8. Check results

2) Start the test scenario with the management tool.

If you want to run a test for a chat in the CX Designer, you have to activate a specific scenario for this test. So the mock Lambda can return the right information.

task start -- 001
started run 20261127T164911Z-2f3fb6 scenario scenario-000 until 2026-11-27T17:59:11+01:00, tools: products ,customer
Conversation test: S000: Product Information 

4) Test run in ACX Designer GUI.

03

8) Check test results.

Within the CX graphical user interface, you see the steps and can analyze, in the debugging, what has happened.

With the Test Manager tool, you see if the tool was called.

task end
{
  "runId": "20261127T164911Z-2f3fb6",
  "scenario": "scenario-000",
  "startedAt": "2026-11-27T16:49:11.708113Z",
  "endedAt": "2026-11-27T17:50:33.616997+01:00",
  "timedOut": false,
  "tools": {
    "products": {
      "called": true,
      "count": 1,
      "calls": []
    },
    "customer": {
      "called": false,
      "count": 0,
      "calls": []
    }
  },
  "expect": {
    "products": {
      "want": 1,
      "got": 1,
      "ok": true
    },
    "customer": {
      "want": 0,
      "got": 0,
      "ok": false
    }
  },
  "ok": true
}

Conversation tests

All these tests can be quickly run within the CX Designer.

Recorded conversation tests in the rings-chat application

Summary

CX design introduces new possibilities. It’s much easier, especially to combine deterministic calls and AI calls. With all this complexity, we need good test coverage to maintain quality. The combination of an MCP server to guide AI development and having a setup for scenario-based testing really makes it easy to deliver good quality. We wanted to show you the concept of the combination of a test management tool and an MCP Server.

You have seen how we support our customers in developing better quality. Please contact us for further information.

Thanks to

Foto by TourBox on Unsplash

This post has partly been supported by GenAI.

Similar Posts You Might Enjoy

How similar is similar enough? Semantic Caching for GenAI solutions

Now the general idea of your GenAI project is working. You get good results. People start using it. Everything’s fine. Now you look at the AWS bill. And you realize that Bedrock does not come for free. Bedrock caching also does not come for free and can be quite expensive, so sometimes semantic caching is a way to shrink your bill. - by Gernot Glawe

Schnelly, the racing snail: Infrastructure as Code on AWS up to 8 times faster with TypeScript 7 and other GO/Rust based tools

For your serverless AWS project you decide the Infrastructure as Code framework and the language for your serverless Lambda functions. In the last years in projects I often heard “we can only do X, because this is the development language we know”. Is this argument still valid with agentic coding? To be able to decide, you should be aware how much time in the steps of the development cycle you need. The new TypeScript 7 is 10 times faster than before. Does this make CDK significantly faster? Let’s build and see: - by Gernot Glawe

Email as a communication channel for Amazon Connect - TTT: Tips, Tools and Traceability

In spite of the diversity of social media communication channels, email is still the most used communication channel. According to a survey of the Bundesnetzagentur nearly as much used as messenger services. Using GenAI in combination with email communication can really boost the automation for your Amazon Connect contact center. And for the communication to work properly, many AWS services have to work together properly also. Let’s have a look at how TTT tips, tools, and traceability can help you to achieve that. - by Gernot Glawe