Skip to main content
Foundry MCP Server (preview) is a cloud-hosted implementation of the Model Context Protocol (MCP) that gives your agents secure tool access to Foundry services. It exposes curated tools that let your agents perform read and write operations against Foundry services without calling backend APIs directly. You don’t need to deploy infrastructure — the server provides a secure, scalable endpoint with built-in authentication through Microsoft Entra ID. Use an MCP-compliant client such as Visual Studio Code to connect to the public endpoint, authenticate with Entra ID, and let LLMs access the tools. After you connect, you can build agents that invoke these tools with natural language prompts. In this article, you learn how to:
  • Connect to Foundry MCP Server with GitHub Copilot in Visual Studio Code
  • Run prompts to test Foundry MCP Server tools and interact with Azure resources
This guide takes about 5 minutes to complete.
This feature is currently in public preview. This preview is provided without a service-level agreement, and we don’t recommend it for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.

Prerequisites

Install and start Foundry MCP Server

Select an option to install Foundry MCP Server in Visual Studio Code.
Install Foundry MCP Server in your user profile so it’s available to all workspaces in Visual Studio Code.
  1. Open the Command Palette (Ctrl+Shift+P).
  2. Search for MCP: Add Server.
  3. Select the HTTP (HTTP or Server-Sent Events) option.
  4. Enter https://mcp.ai.azure.com as the URL.
  5. Enter a friendly name such as foundry-mcp-remote, then press Enter. Visual Studio Code adds the following server entry under your user profile:
  6. Open the Command Palette (Ctrl+Shift+P).
  7. Search for and select MCP: List Servers.
  8. Select Foundry MCP Server you added and choose Start Server.
  9. A green indicator appears next to the server name in MCP: List Servers, confirming the connection is active.
  10. When prompted, sign in to Azure so the MCP server can interact with services in your subscription.
  11. Open GitHub Copilot and select Agent Mode.
  12. Select the tools icon, search for Foundry to filter the list, and confirm the server appears.
Screenshot of GitHub Copilot Agent Mode tools list showing Foundry MCP Server tool.
Learn more about Agent Mode in the Visual Studio Code documentation.

Use prompts to test Foundry MCP Server

  1. Open the GitHub Copilot chat panel and confirm Agent Mode is selected.
  2. Enter a prompt that uses Foundry MCP Server tools—for example Tell me about the latest models on Foundry.
  3. Copilot requests permission to run the required Foundry MCP Server operation. Select Continue or use the arrow to choose a more specific behavior:
    • Current session always runs the operation in the current GitHub Copilot Agent Mode session.
    • Current workspace always runs the command for the current Visual Studio Code workspace.
    • Always allow sets the operation to always run for any GitHub Copilot Agent Mode session or any Visual Studio Code workspace.
Screenshot of options to run Foundry MCP Server operations.
The response resembles the following shortened output. Your actual results vary based on current model availability.
  1. Explore and test Foundry MCP Server operations with other prompts, such as:

Troubleshooting

Clean up resources

To remove the server configuration:
  • User profile: Open the Command Palette, run MCP: List Servers, select the Foundry server, and choose Remove Server.
  • Workspace: Delete the server entry from the .vscode/mcp.json file in your project folder.

Foundry MCP Server tools and example prompts