MCP Academy · Lesson

Open a Client Session

Connect to a server and run the handshake.

You Become the Caller

So far the server advertised tools and waited. Now you flip roles and write the client that reaches out, connects, and drives a server from your own Python code.

Same SDK, Client Side

The official mcp package you already installed ships the client too. No new dependency is needed to start connecting to servers.

from mcp import ClientSession, StdioServerParameters

All lessons in this course

  1. Open a Client Session
  2. Discover Tools & Resources
  3. Invoke Tools from Code
  4. Route Tool Calls Through an LLM
← Back to MCP Academy