Who is this for?

This is an introductory topic for software developers and QA engineers who want to automate integration testing of Model Context Protocol (MCP) servers using Testcontainers and PyTest.

What will you learn?

Upon completion of this Learning Path, you will be able to:

  • Set up Testcontainers with PyTest for containerized testing of MCP servers
  • Write and run integration tests that validate MCP server functionality
  • Configure GitHub Actions to automate MCP server testing in CI/CD pipelines

Prerequisites

Before starting, you will need the following:

  • A computer with Docker and Python 3.11 or later installed
  • Basic familiarity with Python, PyTest, and container concepts
  • Familiarity with the Model Context Protocol (MCP) specification

Summary

AI-assisted

This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
You’ll automate integration testing of Model Context Protocol (MCP) servers using PyTest and Testcontainers. First, you’ll prepare a Python and Docker environment, verify Docker availability, and run a short Testcontainers example to start a disposable container and execute commands inside it. Then, you’ll build a minimal integration test suite for the Arm MCP server, focusing on JSON-RPC 2.0 communication over standard input and output. Finally, you’ll add a GitHub Actions workflow to run the tests on every push and pull request using native arm64 runners with Docker. By the end, you’ll have containerized tests that validate MCP server behavior locally and in continuous integration.

Frequently asked questions

AI-assisted

These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
How do I know Docker is ready before running the examples?
Run docker info and confirm it returns configuration details without errors. If it fails, start the Docker daemon and retry.
What should I expect when I run the basic Testcontainers example?
It starts a long-running container, executes a command inside it, and then cleans up when the script ends. Seeing the command output and a clean exit indicates the example worked.
How do the integration tests communicate with an MCP server?
MCP uses JSON-RPC 2.0 over standard input/output, so tests exchange JSON-RPC messages with the server process. When containerized, Testcontainers manages the server lifecycle during each test run.
Where can I find a complete reference implementation of the tests?
A full test implementation is available in the Arm MCP repository under mcp-local/tests/. You can consult those files while building your own suite.
Which events should trigger the GitHub Actions workflow, and where is it defined?
The workflow runs on push and pull_request and is defined at .github/workflows/integration-tests.yml. GitHub’s native Arm64 runners include Docker.
Next