> ## 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 17 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 17 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.
</Note>

## 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 17 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-4-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 17 DexPaprika tools: networks, pools, tokens, OHLCV, transactions, and cross-chain search. See the [MCP tools reference](/ai-integration/mcp-tools) 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](/ai-integration/hosted-mcp-server)
* [MCP tools reference](/ai-integration/mcp-tools)

## FAQs

<AccordionGroup>
  <Accordion title="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). A free registered DexPaprika key or Pro plan raises your rate and monthly quota; see [rate limits](/knowledge-base/rate-limits).
  </Accordion>

  <Accordion title="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.
  </Accordion>

  <Accordion title="Do I have to define the tools myself?">
    No. `mcp.tools()` discovers all 17 tools from the server and returns them in the AI SDK tool shape.
  </Accordion>
</AccordionGroup>

<script type="application/ld+json">
  {JSON.stringify({
      "@context": "https://schema.org",
      "@type": "FAQPage",
      "mainEntity": [
        {"@type": "Question","name": "Do I need an API key for DexPaprika with the Vercel AI SDK?","acceptedAnswer": {"@type": "Answer","text": "No. The hosted DexPaprika server is keyless for read access. You still need a key for your model provider. A free DexPaprika key or Pro plan raises your rate and monthly quota."}},
        {"@type": "Question","name": "Which transport does the AI SDK use for DexPaprika?","acceptedAnswer": {"@type": "Answer","text": "Streamable HTTP at https://mcp.dexpaprika.com/streamable-http. SSE is also available."}},
        {"@type": "Question","name": "Do I define the tools myself with the AI SDK?","acceptedAnswer": {"@type": "Answer","text": "No. createMCPClient's tools() method discovers all 17 tools from the server in the AI SDK tool shape."}}
      ]
    })}
</script>
