Skip to content

Add ergonomic test client for testing MCP servers #1728

Closed

Description

@maxisbey

Summary

Provide a dedicated test client that simplifies testing MCP servers without the boilerplate of manually setting up transports, streams, and context managers.

Motivation

Currently, testing an MCP server requires:

  • Setting up stdio_client or similar transport
  • Managing multiple nested context managers (transport + session)
  • Wiring up memory streams manually

This creates friction for both SDK users writing tests for their servers and for the SDK's own test suite.

Goal

Something analogous to FastAPI's TestClient / Starlette's test client pattern - a simple way to instantiate a client against a server instance and make requests without transport ceremony.


AI Disclaimer

Activity

  1. added
    enhancement
    P0
    v2
    on Dec 5, 2025
  2. added
    P1
    and removed
    P0
    on Jan 14, 2026
  3. 1 remaining item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P1enhancementv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions