Get the FREE Ultimate OpenClaw Setup Guide →

mcp-on-azure

Sample MCP Server on Azure that lists images from Blob Storage and describes them using Azure OpenAI (gpt-4o vision).

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ofekbeneliezer-mcp-on-azure node server.js \
  --env CONTAINER_NAME="captain-azure" \
  --env AZURE_OPENAI_KEY="<your-openai-key>" \
  --env AZURE_OPENAI_ENDPOINT="https://<your-openai>.openai.azure.com" \
  --env AZURE_OPENAI_API_VERSION="2024-02-15-preview" \
  --env AZURE_OPENAI_DEPLOYMENT_NAME="gpt-4o" \
  --env AZURE_STORAGE_CONNECTION_STRING="Your Azure Storage connection string"

How to use

This MCP server is a minimal Express.js application that interfaces with Azure services to read image data from blob storage and generate descriptive captions using Azure OpenAI. It exposes two tools via HTTP endpoints: list_captain_files and describe_blob. The list_captain_files tool fetches and returns the names of all blobs in the configured container, while describe_blob accepts a blobName and queries Azure OpenAI's gpt-4o vision model to produce a short, clear description of the image. To use, start the server and then call the endpoints (for example via curl or your MCP client) at http://localhost:3333/tools/list_captain_files and http://localhost:3333/tools/describe_blob. Ensure your Azure credentials and container name are configured in the environment so the server can access both Blob Storage and OpenAI resources.

How to install

Prerequisites:

  • Node.js 18+ (recommended 18/20/22)
  • Git
  • Access to an Azure Storage account with a container (e.g., captain-azure) containing images
  • Azure OpenAI resource with a gpt-4o deployment

Install steps:

  1. Clone the repository
git clone https://github.com/OfekBenEliezer/mcp-on-azure.git
cd mcp-on-azure
  1. Install dependencies
npm install
  1. Create and configure environment variables
  • Copy the example and edit as needed
cp .env.example .env
  • Populate the following variables in .env (or set them in your environment):
AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=<name>;AccountKey=<key>;EndpointSuffix=core.windows.net
CONTAINER_NAME=captain-azure
AZURE_OPENAI_ENDPOINT=https://<your-openai>.openai.azure.com
AZURE_OPENAI_KEY=<your-openai-key>
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o
AZURE_OPENAI_API_VERSION=2024-02-15-preview
  1. Start the server
node server.js
  1. Verify the server is running
# MCP Server running on: http://localhost:3333
curl -s http://localhost:3333/tools/list_captain_files -X POST -H "Content-Type: application/json"

Additional notes

Tips and notes:

  • The server uses environment variables to connect to Azure Blob Storage and Azure OpenAI. Do not commit these keys.
  • If your blobs are private, consider generating SAS URLs with short TTL or use Managed Identity where supported.
  • The server listens by default on port 3333; adjust as needed in code if you want a different port.
  • Ensure your Azure OpenAI deployment name (gpt-4o) and API version match what you’ve configured in Azure.
  • For production, restrict CORS and ingress and consider adding authentication layers for the MCP endpoints.

Related MCP Servers

Sponsor this space

Reach thousands of developers