Quickstart: Adapt an existing MCP server for Blaxel
Modify and deploy your existing stdio MCP server.
MCP (Model Context Protocol) servers provide tools (individual capabilities for accessing specific APIs or databases) that can be used by AI agents. These servers can be hosted on Blaxel’s computing platform and used by AI agents via each server’s global endpoint.This quickstart walks you through the process of adapting an existing stdio-based MCP server for deployment on Blaxel using the streamable HTTP transport.
To install Blaxel CLI, you must use Homebrew: make sure it is installed on your machine. We are currently in the process of supporting additional installers. Check out the cURL method down below for general installation.
Install Blaxel CLI by running the two following commands successively in a terminal:
Copy
Ask AI
brew tap blaxel-ai/blaxel
Copy
Ask AI
brew install blaxel
Install on Linux
Install Blaxel CLI by running the following command in a terminal (non-sudo alternatives below):
Copy
Ask AI
curl -fsSL \\<https://raw.githubusercontent.com/blaxel-ai/toolkit/main/install.sh> \\| BINDIR=/usr/local/bin sudo -E sh
If you need a non-sudo alternative (it will ask you questions to configure):
Copy
Ask AI
curl -fsSL \\<https://raw.githubusercontent.com/blaxel-ai/toolkit/main/install.sh> \\| sh
If you need to install a specific version (e.g. v0.1.21):
Copy
Ask AI
curl -fsSL \\<https://raw.githubusercontent.com/blaxel-ai/toolkit/main/install.sh> \\| VERSION=v0.1.21 sh
Install with cURL
Install Blaxel CLI by running the following command in a terminal (non-sudo alternatives below):
Copy
Ask AI
curl -fsSL \\<https://raw.githubusercontent.com/blaxel-ai/toolkit/main/install.sh> \\| BINDIR=/usr/local/bin sudo -E sh
If you need a non-sudo alternative (it will ask you questions to configure):
Copy
Ask AI
curl -fsSL \\<https://raw.githubusercontent.com/blaxel-ai/toolkit/main/install.sh> \\| sh
If you need to install a specific version (e.g. v0.1.21):
Copy
Ask AI
curl -fsSL \\<https://raw.githubusercontent.com/blaxel-ai/toolkit/main/install.sh> \\| VERSION=v0.1.21 sh
Install on Windows
For the most reliable solution, we recommend adapting the aforementioned Linux commands by using Windows Subsystem for Linux.First install WSL (Windows Subsystem for Linux) if not already installed. This can be done by:
Opening PowerShell as Administrator
Running: wsl --install -d Ubuntu-20.04
Restarting the computer
From the Microsoft Store, install the Ubuntu app
Run the command line using the aforementioned Linux installation process. Make sure to install using sudo.
Once installed, open a terminal and log in to the Blaxel Console using this command:
If your MCP server is already configured to use streamable HTTP, you may skip this step.
Blaxel uses streamable HTTP as the transport layer for MCP servers deployed on its infrastructure. If your MCP server uses stdio (as in this example), you must adapt it to use streamable HTTP instead. The host name and port for the server to bind to are automatically injected by Blaxel during deployment, as BL_SERVER_HOST and BL_SERVER_PORT environment variables.
Blaxel looks for a blaxel.toml file to configure the deployment of the MCP server on Blaxel. The only mandatory parameter is the type; other parameters are not mandatory but allow you to customize the deployment.Create a new blaxel.toml file with the following content:
Copy
Ask AI
type = "function"[runtime]transport = "http-stream"
Blaxel also automatically detects a Dockerfile at the root of the project and uses it to create and deploy a container image of your MCP server. This is a very useful feature that allows you to completely customize the deployment environment for your MCP server, including installing additional system dependencies and using specific versions of libraries or tools.Create a new Dockerfile with the following content: