Prerequisites
- An Anthropic API key, required by Claude Agent SDK. If not, sign up for an Anthropic account and obtain an API key.
- A Blaxel account and API key. If not, sign up for a Blaxel account and obtain an API key.
- The Blaxel CLI. If not, download and install the Blaxel CLI
1. Install required dependencies
In your project directory, install the Claude Agent SDK for the agent loop and the Blaxel TypeScript SDK / Python SDK for sandbox operations:2. Build and deploy an MCP server in code mode
This tutorial creates and deploys an MCP server for the example Petstore v2 API. In your project directory, create and run a file namedsetup.ts (TypeScript) or setup.py (Python) with the following code, or use the Blaxel CLI command shown, to deploy the API on Blaxel.
DEPLOYED, any agent can use petstore-code-mode as a tool provider.
3. Build the agent
Obtain the MCP server URL with the following command:index.ts (TypeScript) or main.py (Python) with the following code. Replace the placeholder with the MCP server URL from the previous command.
4. Test the agent
Send the agent a query:Build and deploy an agent on Blaxel with Claude Agent SDK
Complete tutorial for building an agent with Claude Agent SDK and deploying it on Blaxel as a serverless auto-scalable API.
Give compute to your agent with the TypeScript SDK
Complete tutorial for using the TypeScript SDK to develop an agent using Blaxel services.
Give compute to your agent with the Python SDK
Complete tutorial for using the Python SDK to develop an agent using Blaxel services.
Deploy your agent code to Blaxel
Complete tutorial for deploying AI agents on Blaxel.
