Back to course

Testing Your MCP Server

Model Context Protocol (MCP) Server Engineering

Testing and QA

Don't just test in the host! Use automated tests.

Tools

  • Use Vitest or Jest.
  • Mock the transport layer to simulate requests.

Assignment: Write a test case that ensures your calculate_sum tool returns the correct result for 2 + 2.