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

# AI SDK

> Doconda in the Vercel AI SDK, with any model.

```bash theme={null}
npm install ai @doconda/sdk
```

## With the SDK tools

```ts theme={null}
import { anthropic } from "@ai-sdk/anthropic"
import { generateText, isStepCount, jsonSchema, tool } from "ai"
import { Doconda } from "@doconda/sdk"

const doconda = new Doconda()
const tools = Object.fromEntries(
  doconda.tools().map((t) => [
    t.name,
    tool({ description: t.description, inputSchema: jsonSchema(t.inputSchema), execute: (input) => t.run(input as Record<string, unknown>) }),
  ]),
)

const { text } = await generateText({
  model: anthropic("claude-sonnet-5-5"), // or any other provider
  tools,
  stopWhen: isStepCount(5),
  prompt: "Create a 5-slide presentation on our quarterly results",
})
```

It works the same with `streamText` and in a Next.js route: the agent calls Doconda on your server and the API key
never reaches the browser.

## With the MCP client

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

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

const doconda = await createMCPClient({
  transport: {
    type: "http",
    url: "https://api.eu.doconda.com/mcp",
    headers: { Authorization: `Bearer ${process.env.DOCONDA_API_KEY}` },
  },
})

const { text } = await generateText({ model, tools: await doconda.tools(), stopWhen: isStepCount(5), prompt: "…" })
await doconda.close()
```


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