> ## 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 en el AI SDK de Vercel, con cualquier modelo.

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
npm install ai @doconda/sdk
```

## Con las herramientas del SDK

```ts theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
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"), // o cualquier otro proveedor
  tools,
  stopWhen: isStepCount(5),
  prompt: "Crea una presentación de 5 diapositivas sobre nuestros resultados del trimestre",
})
```

Funciona igual con `streamText` y en una ruta de Next.js: el agente llama a Doconda en tu servidor y la API key
nunca llega al navegador.

## Con el cliente MCP

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
npm install @ai-sdk/mcp
```

```ts theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
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.