# ctx-zip
> Transform MCP tools and AI SDK tools into code, write it to a Vercel sandbox file system and have the agent import the tools, write code, and execute it.

- **Package:** ctx-zip
- **Author:** Vercel
- **Tags:** code-execution, sandbox, mcp, code-mode

## Environment Variables
- `VERCEL_OIDC_TOKEN`

## Included Tools
- **sandbox_ls:** List directory contents
- **sandbox_cat:** Read file contents
- **sandbox_grep:** Search inside files
- **sandbox_find:** Find a file or directory
- **sandbox_exec:** Execute TypeScript code

## Installation
```bash
npm install ctx-zip
```

## Usage
```typescript
import { generateText, stepCountIs } from 'ai';
import { createVercelSandboxCodeMode, SANDBOX_SYSTEM_PROMPT } from 'ctx-zip';

const { tools } = await createVercelSandboxCodeMode({
  servers: [
    {
      name: 'vercel',
      url: 'https://mcp.vercel.com',
      useSSE: false,
      headers: {
        Authorization: `Bearer ${process.env.VERCEL_API_KEY}`,
      },
    },
  ],
  standardTools: {
    weather: weatherTool,
  },
});

const { text } = await generateText({
  model: 'openai/gpt-5.2',
  tools,
  stopWhen: stepCountIs(20),
  system: SANDBOX_SYSTEM_PROMPT,
  messages: [
    {
      role: 'user',
      content: 'What tools are available from the Vercel MCP server?',
    },
  ],
});

console.log(text);

```

## Links
- [Documentation](https://github.com/karthikscale3/ctx-zip/blob/main/README.md)
- [npm](https://www.npmjs.com/package/ctx-zip)
- [GitHub](https://github.com/karthikscale3/ctx-zip/blob/main/README.md)

---
[Full Library Index](/library.md)