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

# Use DexPaprika with the Vercel AI SDK

> Pull all 18 DexPaprika tools into the Vercel AI SDK with createMCPClient and the keyless hosted MCP server, then use them with generateText and streamText. No custom code.

The Vercel AI SDK's MCP client connects to DexPaprika's hosted server and returns all 20 tools as ready-to-use AI SDK tools. Drop them into `generateText` or `streamText`. Keyless, no custom code.

## Install

```bash theme={null}
npm install ai @ai-sdk/mcp @ai-sdk/anthropic
```

> [!NOTE]
>
> The AI SDK moves quickly. These snippets were verified against `ai@7.0.40` and `@ai-sdk/mcp@2.0.18`; pin those versions, or check the current [AI SDK MCP docs](https://ai-sdk.dev) if the API has shifted.

## Connect and get the tools

```ts theme={null}
import { createMCPClient } from '@ai-sdk/mcp';

const mcp = await createMCPClient({
  transport: { type: 'http', url: 'https://mcp.dexpaprika.com/streamable-http' },
});

const tools = await mcp.tools(); // all 18 DexPaprika tools
```

## Use them in a generation

```ts theme={null}
import { generateText } from 'ai';
import { anthropic } from '@ai-sdk/anthropic';

const { text } = await generateText({
  model: anthropic('claude-sonnet-5'),
  tools,
  maxSteps: 5,
  prompt: 'Find the most liquid WETH pool on ethereum and report its 24h volume.',
});

console.log(text);
await mcp.close();
```

Call `mcp.close()` when you are done so the connection is released. Swap in any AI SDK model provider you prefer.

## Tools and the rationale field

The client returns all 18 DexPaprika tools: networks, pools, tokens, OHLCV, transactions, and cross-chain search. See the [MCP tools reference](https://docs.dexpaprika.com/ai-integration/mcp-tools.md) for the full list.

Every read tool takes a required `rationale` string. It is part of each tool's schema, so a capable model fills it automatically. If a smaller model omits it and errors, add a system instruction telling it to include a short rationale.

## Resources

* [Vercel AI SDK docs](https://ai-sdk.dev)
* [Hosted MCP server](https://docs.dexpaprika.com/ai-integration/hosted-mcp-server.md)
* [MCP tools reference](https://docs.dexpaprika.com/ai-integration/mcp-tools.md)

## FAQs

> **Do I need an API key for DexPaprika?**
>
> No. The hosted server is keyless for read access. You still need a key for your model provider (Anthropic, OpenAI, and so on). The hosted server runs tool calls on its own shared capacity, not on a plan of yours, so a key raises no limit there. The exceptions are the tools that need a paid plan, which run on your own Dev, Pro or Enterprise key; see [the hosted server page](https://docs.dexpaprika.com/ai-integration/hosted-mcp-server.md). Limits for direct REST calls are on [rate limits](https://docs.dexpaprika.com/knowledge-base/rate-limits.md).

> **Which transport does the AI SDK use?**
>
> Streamable HTTP: `https://mcp.dexpaprika.com/streamable-http`. The server also serves SSE if you configure the client for it.

> **Do I have to define the tools myself?**
>
> No. `mcp.tools()` discovers all 20 tools from the server and returns them in the AI SDK tool shape.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.