Skip to content

Export to code

Click </> in the top bar to export the active workspace. Keys are never included — the code reads them from the environment.

A TypeScript agent using streamText, @ai-sdk/mcp clients for each server, and the same model, system prompt and step limit.

import { streamText, stepCountIs } from "ai";
import { createMCPClient } from "@ai-sdk/mcp";
import { createAnthropic } from "@ai-sdk/anthropic";
const model = createAnthropic({ apiKey: process.env.ANTHROPIC_API_KEY })("claude-sonnet-5");
const mcp0 = await createMCPClient({ transport: { type: "http", url: "https://mcp.deepwiki.com/mcp" } });
const result = streamText({ model, tools: { ...(await mcp0.tools()) }, stopWhen: stepCountIs(12), prompt: "…" });

The bundled demo server is exported as npx -y @mokalabs/sandbox demo-server, so exported code runs anywhere.

Skills and generative UI are Moka runtime features and aren’t included in the exported agent code.