Which Python SDK API should my existing project use for Montage?
The official MCP Python SDK's current v2 client uses from mcp import Client and an asynchronous Client(URL) context. Existing projects may still target a different API generation, so confirm the version before adapting code. This guide deliberately avoids blindly publishing older ClientSession examples as current setup. It documents a remote Streamable HTTP connection whose authorization remains the application's responsibility.
from mcp import Client
async def inspect_montage():
async with Client("https://app.montages.co/mcp") as client:
tools = await client.list_tools()
return toolsAfter configuring approved application auth, use the installed Client.call_tool interface to call signals_status. Inspect the real result and stop on any authorization or transport error.Identify the installed SDK generation
Read the project's manifest and lockfile to determine which mcp package version is actually installed. Use its matching official client reference rather than assuming the repository's current main branch describes your environment. Do not upgrade dependencies for this guide. An older application can require different connection primitives without implying the Montage endpoint has changed.
Use the v2 remote Client when applicable
For a compatible v2 project, import Client from mcp and supply https://app.montages.co/mcp as the URL. The async context pattern below describes the documented remote client lifecycle. It is not a stdio server launcher and does not require a local Montage module, a custom server implementation or an invented SSE endpoint.
Supply authorization through the application
Configure approved Montage authorization using the supported client facilities for the installed SDK. The URL-only snippet omits credentials intentionally and may receive an authorization challenge until that work is complete. Keep token storage private, bind sessions to the correct account and do not treat a Python environment variable containing a model provider key as Montage identity.
Inspect tools within the open context
Keep discovery and execution inside the async Client lifetime and inspect the signals_status tool's advertised input. If initialization or auth fails, surface the error to the caller instead of returning an empty success-shaped object. This preserves the distinction between no workspace coverage and an application that never obtained permission to read the workspace at all.
Finish with the real signals_status call
Use the installed Client's documented call_tool method to execute signals_status and inspect the actual workspace result. Fix application authorization for rejected calls; verify API generation, endpoint and context lifetime for transport failures. Do not replace the current code with an old ClientSession sample as a blind retry. Close the connection cleanly and leave downstream research disabled until this read-only response succeeds.
Keep the boundaries clear.
- The construction example targets current v2; existing SDK versions require their own documentation.
- Application-owned authorization is required, and no credential is embedded in the example.
- This guide documents setup rather than live-certified compatibility across Python SDK generations.
Start with a read-only check: ask your agent to report actual source coverage before collecting records or exporting an audience.
Primary references
Documentation reviewed 2026-11-13. Product capabilities, client availability and plans can change. Third-party marks identify their products, not an affiliation.