MCP ExplorerExplorer

Azure Code Interpreter Mcp

@tobyon a year ago
1 MIT
FreeCommunity
AI Systems
Azure Code Interpreter MCP, run Python in the cloud

Overview

What is Azure Code Interpreter Mcp

The azure-code-interpreter-mcp is a server that allows Large Language Models (LLMs) to execute Python code in a secure and isolated environment, built on the Azure Code Interpreter framework.

Use cases

Use cases include running data processing scripts, testing algorithms, generating reports, and performing simulations in a safe and isolated manner.

How to use

To use azure-code-interpreter-mcp, set up the required Azure resources and authenticate using the Azure CLI. Configure environment variables for subscription ID, resource group, session pool, region, and download directory in your LLM tool.

Key features

Key features include the ability to create new sessions for task delineation, execute Python code within those sessions, and download generated files securely.

Where to use

azure-code-interpreter-mcp can be used in fields such as data analysis, machine learning, and any application requiring dynamic code execution in a controlled environment.

Content

Azure Code Interpreter MCP Server

This MCP server gives LLMs the ability to run Python code in a secure and sandboxed environment. The server is built on top of the Azure Code Interpreter and gives the LLM the ability to execute code and download generated files in sessions that are ephemeral and isolated from the rest of the system.

Setup

The server uses the az Azure CLI client for authentication, so make sure that is installed and authenticated. You’ll need to setup a resource group and session pool according to these instructions. Be sure to set the --network-status EgressEnabled flag when creating the session pool if you want generated code to access the internet.

You need to build the azure-code-interpreter-mcp binary with go and install it in your $PATH or reference it directly in your LLM tool.

Usage

Once you have created the requred Azure resources and authenticated with az, you need to set the following environment variables in your LLM tool:

  • AZURE_SUBSCRIPTION_ID: The ID of the Azure subscription that contains the resource group.
  • AZURE_RESOURCE_GROUP: The name of the resource group that contains the session pool.
  • AZURE_SESSION_POOL: The name of the session pool that the server should use.
  • AZURE_REGION: The region that the session pool is in.
  • AZURE_DOWNLOAD_DIRECTORY: The directory where the server should save downloaded files. This directory must be writable by the server process.

Supported Server Functions

The LLM has access to the following functionality.

New Session

The LLM can create a new session as it sees fit for deliniating tasks.

Execute

Execute Python code in the context of the session. The LLM is prompted to save any created files to the /mnt/data directory, which Azure has setup to allow files to be downloaded.

List Files

This will list the files that have been stored in the /mnt/data directory by the executed code.

Download Files

Download the files from /mnt/data to the directory specified by AZURE_DOWNLOAD_DIRECTORY on the server.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers