LoslegenKostenlos loslegen

Dynamic Tool Discoverability

MCP servers can house lots of functionality as separate tools, so a common first step is to list out all of the tools available to understand what they are and how they can be used.

asyncio has already been imported for you.

Diese Übung ist Teil des Kurses

Introduction to Model Context Protocol (MCP)

Kurs anzeigen

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client

async def ____():
    # Define the server parameters
    params = ____(
        command=sys.executable,
        args=["____"],
    )
Code bearbeiten und ausführen