> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zapier.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Python to Zapier MCP with the MCP SDK

> Connect Python code to Zapier MCP with an MCP client SDK. Create a server, generate a connection token, and call Zapier tools over Streamable HTTP.

Use this page only when the user is writing their own Python code. If they are connecting an AI client, follow that client's page instead. The server and the token come first: the snippet cannot run until step two is done.

When adapting the snippet to a different SDK, keep the endpoint, the Streamable HTTP transport, and the token. The FastMCP class names are not fixed.

The token is a credential, so do not ask the user to paste it into chat and do not write it into a file for them. If it is exposed, have them regenerate it.

Zapier MCP connects your Python code to 9,000+ apps and 40,000+ actions. Zapier holds the app credentials, so your code never handles a third-party API key.

## Before you begin

* A [Zapier account](https://zapier.com/sign-up).
* Python 3.10 or later.

## Connect Python to Zapier MCP

<Steps>
  <Step title="Create an MCP server">
    * Go to [mcp.zapier.com](https://mcp.zapier.com).
    * Click **+ Add MCP Server**.
    * Under **Choose your AI agent**, search for and select **Python**.
  </Step>

  <Step title="Generate a connection token">
    * Select the <img src="https://cdn.zapier.com/storage/photos/baa5b3a64988a15f0dc8497c52ec257b.png" alt="link icon" noZoom style={{ display: "inline-block", width: "14px", margin: "0 0.15em", verticalAlign: "baseline" }} /> **Connect** tab.
    * Click **Generate token**.

    Store the token somewhere safe straight away. It is only shown once, and you cannot retrieve it later. You can [regenerate the token](/mcp/get-started/connect/other#regenerate-a-token) if you need a new one.

    <Warning>
      Treat your connection token like a password. It can be used to run tools on this server and access your data.
    </Warning>
  </Step>

  <Step title="Connect with an MCP SDK">
    The <img src="https://cdn.zapier.com/storage/photos/baa5b3a64988a15f0dc8497c52ec257b.png" alt="link icon" noZoom style={{ display: "inline-block", width: "14px", margin: "0 0.15em", verticalAlign: "baseline" }} /> **Connect** tab gives you a copy-ready snippet with your token already in the URL. The snippet uses [FastMCP](https://gofastmcp.com/), but any MCP SDK that supports Streamable HTTP works.

    ```python theme={null}
    from fastmcp import Client
    from fastmcp.client.transports import StreamableHttpTransport

    transport = StreamableHttpTransport(
        "https://mcp.zapier.com/api/v1/connect?token=ZAPIER_MCP_TOKEN"
    )
    client = Client(transport)

    async with client:
        tools = await client.list_tools()
    ```

    You can also copy the token on its own from **Or manually copy the token**.

    To keep the token out of the URL, send it in an Authorization header instead: `Authorization: Bearer ZAPIER_MCP_TOKEN`.
  </Step>
</Steps>

You've now connected Python to Zapier MCP.

## Next steps

<CardGroup cols={2}>
  <Card title="How tools work" href="/mcp/overview/how-tools-work">
    What each meta-tool does, and how dynamic tool discovery works.
  </Card>

  <Card title="How connections work" href="/mcp/overview/how-connections-work">
    How connection tokens work, and how to manage them.
  </Card>
</CardGroup>
