Learn how to integrate ATXP’s pay-per-use MCP tools with Vercel AI SDK for streaming AI applications
Create ATXP Account
If you don’t have an ATXP account yet, create one and copy your ATXP connection string. It should look something like this:
Install Dependencies
@atxp/client
package provides the MCP transport that allows you to use ATXP’s MCP tools in your Vercel AI SDK application, while ai
and @ai-sdk/openai
are from Vercel’s AI SDK.Configure Environment
.env
file with your credentials:.env
file to version control. It is a good idea to add your .env
to your .gitignore
file to prevent it from being committed.Here’s how to set up the basic integration between ATXP and Vercel AI SDK: