# Automate MCP server testing using Pytest and Testcontainers

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/cross-platform/automate-mcp-with-testcontainers/)
- [Introduction to MCP server testing](https://learn.arm.com/learning-paths/cross-platform/automate-mcp-with-testcontainers/introduction/)
- [Set up your testing environment](https://learn.arm.com/learning-paths/cross-platform/automate-mcp-with-testcontainers/setup-environment/)
- [Run a basic Testcontainers example](https://learn.arm.com/learning-paths/cross-platform/automate-mcp-with-testcontainers/run-testcontainers-example/)
- [Write integration tests for MCP servers](https://learn.arm.com/learning-paths/cross-platform/automate-mcp-with-testcontainers/write-test-cases/)
- [Configure GitHub Actions for CI/CD](https://learn.arm.com/learning-paths/cross-platform/automate-mcp-with-testcontainers/github-actions-ci/)
- [Next Steps](https://learn.arm.com/learning-paths/cross-platform/automate-mcp-with-testcontainers/_next-steps/)

## About this Learning Path

|  |  |
| --- | --- |
| Skill level: | Introductory |
| Reading time: | 1 hr |
| Last updated: | 16 Oct 2026 |

|  |  |
| --- | --- |
| Author: | Neethu Elizabeth Simon , Arm |
| Arm IP: | [Neoverse](https://support.arm.com/?tab=compute-ip&Product%20Type=Infrastructure%20Processors) [Cortex-A](https://support.arm.com/?tab=compute-ip&Product%20Type=Application%20Processors) |
| Tags: | [CI-CD](https://learn.arm.com/tag/ci-cd/) [Linux](https://learn.arm.com/tag/linux) [macOS](https://learn.arm.com/tag/macos) [Windows](https://learn.arm.com/tag/windows) [Python](https://learn.arm.com/tag/python) [Pytest](https://learn.arm.com/tag/pytest) [Docker](https://learn.arm.com/install-guides/docker) [GitHub Actions](https://learn.arm.com/tag/github-actions) [Testcontainers](https://learn.arm.com/tag/testcontainers) [MCP](https://learn.arm.com/tag/mcp) |

### 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?

After completing this Learning Path, you'll be able to perform the following tasks:

- 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'll need the following prerequisites:

- A computer with [Docker](https://learn.arm.com/install-guides/docker/) and Python 3.11 or later installed
- Basic familiarity with Python, PyTest, and container concepts
- Familiarity with the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) specification

### Summary

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.
