Skip to main content
Give your existing mcp-use server a run_code tool. Each call creates a fresh Daytona sandbox, runs the code, and deletes the sandbox afterward.

Try the live example

Run code through our deployed Daytona server. Pick a suggestion or ask the chat to run your own snippet.
Open the example in a new tab.

Prerequisites

Add the integration

Install the Daytona SDK in your server project:
Add your key to .env:
.env
Copy this complete example into src/index.ts, or adapt its Daytona client and run_code tool for your existing server:
src/index.ts

Try it

Start or restart your server so it loads the key:
In the Inspector, select Tools → run_code and enter:
The result contains output: "6\n" and exitCode: 0. With a model configured in the Inspector’s Chat tab, try:
Each call uses your Daytona account, consumes its sandbox quota and credits, and discards its sandbox files afterward. Before exposing your server publicly, require authentication and enforce rate and spending limits to control who can execute code and how much they can spend. Code execution has a 30-second timeout; sandbox creation and deletion have separate timeouts.