Blog Post

Azure Managed Redis
3 MIN READ

Using MCP Server with Azure Managed Redis in VS Code

Catherine-Wang's avatar
Sep 25, 2025

Overview

Have you thought about asking your VS Code to generate test data and automatically upload them to Redis, without having to write any code? Wouldn’t it be nice to code and manage resources all in one place in VS Code? This blog walks you through setting up VS Code to connect with Redis MCP Server and an Azure Managed Redis to accomplish these. By the end of this blog, we will be able to run VS Code in agent mode and tell it to generate customer test data in English, and it will leverage the MCP server to write the data into Redis.

What is MCP and Redis MCP?

Model Context Protocol (MCP) is an open standard that lets AI models use external tools and services through a unified interface, enabling seamless integration and standardized interactions. VS Code agent mode lets you run the VS Code tool as an agent, connecting directly to MCP servers like Redis MCP. This enables seamless integration between your development environment and Redis-powered context management, making it easy to automate tasks, manage data, and interact with Redis from within VS Code.

This article provides a step-by-step guide to setting up a Redis MCP server connected to Azure Managed Redis using agent mode in Visual Studio Code.

Quick Start: Step-by-Step Instructions

Prerequisites

  1. Create an Azure Managed Redis (AMR) Instance
  1. Download or clone redis/mcp-redis
  2. Start VS Code in Agent mode with MCP servers enabled
  1. (Optional) Add AMR to Redis Insight to view data in Azure Managed Redis

Setup Redis MCP server in VS Code

The following instructions are adapted from Use MCP Servers in VS Code to describe how to use the Redis MCP server. The example uses a Windows 11 development machine.

  1. Set up a new workspace in VS Code for your project.
  2. Add .vscode/mcp.json
  • Create a .vscode/mcp.json file in your workspace.
  • Copy over the required configuration content for MCP server connection. Below is an example. Notice that the REDIS_SSL setting needs to be added for Azure Managed Redis, if you followed the recommended security options when creating it.

{

  "servers": {

    "redis": {

      "type": "stdio",

      "command": "C:\\Users\\user1\\.local\\bin\\uv.exe",

      "args": [

        "--directory",

        "C:\\Users\\user1\\source\\repos\\mcp-redis",

        "run",

        "src/main.py"

      ],

      "env": {

        "REDIS_HOST": "yourredisname.yourredisregion.redis.azure.net",

        "REDIS_PORT": "10000",

        "REDIS_USERNAME": "default",

        "REDIS_PWD": "<replace_with_your_access_key_token>”,

        "REDIS_SSL": "true"

      }

    }

  }

}

  1. Add settings.json
  • Update your workspace’s settings.json to allow the agents you want to use. For example, if you want to use copilot-swe and copilot/claude-sonnet-4 with the Redis MCP server, the file would look like:

{

    "chat.mcp.serverSampling": {

        "MCPWorkspace/.vscode/mcp.json: redis": {

            "allowedModels": [

                "copilot/copilot-swe",

                "copilot/claude-sonnet-4"

            ]

        }

    }

}

  1. Start MCP server. In the Run Commands bar (Ctrl+Shift+P), type:
  • >MCP: List Servers
  • Select Redis
  • Select Start Server
  1. Open Copilot Chat Window
  • In VS Code, open the Agent chat window (Ctrl+Shift+I)
  • On the bottom menu of the Chat window, ensure Agent mode is selected among Agent, Ask, and Edit.
  1. Test MCP Server to add test data to Redis
  • Type: generate 10 customer information with an integer ID as the key and hashset with properties like First Name, Last Name, Phone number, Address. Then put each of the 10 customer entries in the Redis
  • See the output calling MCP tool. Note that MCP might prompt for permissions to execute. Select ‘Allow for this session’ from the dropdown menu
  • Optionally verify that the key value pair has been added to the Azure Managed Redis instance through Redis Insight tool.

This workflow makes it fast and intuitive to leverage Redis MCP with Azure Managed Redis, using VS Code’s agent mode for powerful, context-driven development. You’ll be able to automate Redis operations, manage context, and interact with agents—all from your familiar VS Code environment.

Published Sep 25, 2025
Version 1.0