How do I verify Montage workspace access with Vercel AI SDK?
Vercel AI SDK creates a lightweight MCP client and converts discovered tools into the application's tool interface. This guide uses its HTTP client path, not the separate provider-hosted MCP option in OpenAI Responses. Authorization, request isolation, and client cleanup remain application concerns. In particular, a server URL chosen by untrusted input should not receive credentials simply because the SDK can fetch and parse its catalog.
Using Vercel AI SDK, call only Montage signals_status as the first live operation. Report the actual workspace identity and coverage from the tool response. If authentication, transport, or the tool is unavailable, stop and explain the blocker. Do not start collection, recurring tracking, writes, publishing, messaging, or social actions.Match the installed MCP package API
Check the current @ai-sdk/mcp documentation against your lockfile before using createMCPClient. Older releases may expose different experimental names. The official guide recommends HTTP for deployed applications and limits stdio to local servers. Keep this integration inside server-side application code rather than exposing credentials in a browser bundle.
Create the remote HTTP transport
Configure transport.type as http and url as https://app.montages.co/mcp. Use the existing application's trusted network policy and reject unintended destinations. If accepting server URLs from users, address SSRF separately; authentication does not make a destination trustworthy. This guide adds no network library or dependency and does not widen outbound access policies.
Provide an actual OAuth implementation
The HTTP transport supports authProvider for OAuth, but the application must supply the provider and secure credential storage. A URL-only client is not a consent flow. Alternatively use an existing approved header credential where supported. Keep identities isolated per user and handle rejected or expired authorization explicitly instead of silently falling back to another account.
Select the converted status tool
Inspect the result of tools() and retain the actual signals_status definition before passing tools to a model. Validate that the selected tool exists rather than assuming every server publishes the same catalog. Tool conversion and successful discovery are not workspace authorization. Avoid connecting all discovered writes to a streaming model loop during the initial diagnostic.
Execute status and close the client
Make the first live Montage operation signals_status, inspect its response, and close the MCP client in cleanup after the check. Distinguish an aborted call from an authorized empty result. A later model run may use broader tools only under its own explicit policy; this setup permits no automatic collection, recurring jobs, publishing, or native social actions.
Keep the boundaries clear.
- Match @ai-sdk/mcp APIs to the installed release; authProvider requires an implemented OAuth provider and secure storage.
- Documented setup, not live interoperability certification. A visible tool catalog is not workspace authorization.
- First live operation: read-only signals_status. No automatic collection, recurring tracking, or social actions; broader actions need separate explicit authorization.
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-15. Product capabilities, client availability and plans can change. Third-party marks identify their products, not an affiliation.