home / mcp / foundry mcp server
Cloud-hosted MCP endpoint for Foundry with tools for models, knowledge, evaluations, and agent workflows.
Configuration
View docs{
"mcpServers": {
"microsoft-foundry-mcp-foundry": {
"command": "uvx",
"args": [
"--prerelease=allow",
"--from",
"git+https://github.com/azure-ai-foundry/mcp-foundry.git",
"run-azure-ai-foundry-mcp",
"--envFile",
"${workspaceFolder}/.env"
],
"env": {
"GITHUB_TOKEN": "<GITHUB_TOKEN>",
"EVAL_DATA_DIR": "<EVAL_DATA_DIR>",
"AZURE_CLIENT_ID": "<AZURE_CLIENT_ID>",
"AZURE_TENANT_ID": "<AZURE_TENANT_ID>",
"AZURE_CLIENT_SECRET": "<AZURE_CLIENT_SECRET>",
"AZURE_OPENAI_API_KEY": "<AZURE_OPENAI_API_KEY>",
"AZURE_OPENAI_ENDPOINT": "<AZURE_OPENAI_ENDPOINT>",
"AZURE_AI_SEARCH_API_KEY": "<AZURE_AI_SEARCH_API_KEY>",
"AZURE_OPENAI_DEPLOYMENT": "<AZURE_OPENAI_DEPLOYMENT>",
"AZURE_AI_SEARCH_ENDPOINT": "https://mysearchservice.search.windows.net/",
"AZURE_OPENAI_API_VERSION": "<AZURE_OPENAI_API_VERSION>",
"AZURE_AI_PROJECT_ENDPOINT": "<AZURE_AI_PROJECT_ENDPOINT>",
"AZURE_AI_SEARCH_API_VERSION": "<AZURE_AI_SEARCH_API_VERSION>",
"SEARCH_AUTHENTICATION_METHOD": "service-principal"
}
}
}
}You can use the Foundry MCP Server to orchestrate and interact with Azure AI Foundry resources through MCP-compliant clients. It provides tools to work with models, knowledge indexes, evaluations, and agent services in a cloud-hosted, secure environment, enabling multi-agent workflows and on-behalf-of authentication. This guide shows you how to use the server, how to install and run it locally when needed, and important configuration notes to get you started quickly.
Use an MCP client to discover, invoke, and manage tools that operate on models, knowledge bases, evaluations, and agent services. You can start by launching the server in your development environment and then issuing requests to interact with Azure AI Foundry resources through the supported MCP tools. The workflow supports running local or remote servers, loading environment variables from a file, and using the standard MCP client protocol to perform actions such as listing models, querying indexes, running evaluations, or querying agents.
Prerequisites: ensure you have the MCP runtime available in your environment. You will install and run the server via an MCP command in your development workspace.
1) Install the runtime you will use (for example, ensure you have the MCP runtime runner available as shown in your setup instructions.
The following local setup example shows how to configure a standard MCP server in a VS Code workspace. Create the MCP configuration file at .vscode/mcp.json with the stdio server entry below. This configuration uses uvx to run a local MCP server and points to an environment file for sensitive data.
{
"servers": {
"mcp_foundry_server": {
"type": "stdio",
"command": "uvx",
"args": [
"--prerelease=allow",
"--from",
"git+https://github.com/azure-ai-foundry/mcp-foundry.git",
"run-azure-ai-foundry-mcp",
"--envFile",
"${workspaceFolder}/.env"
]
}
}
}To securely pass information such as API keys and endpoints to the MCP server, you can place environment variables in a .env file in your workspace. The variables shown here illustrate common needs for model discovery, knowledge indexing, and evaluation workflows.
| Category | Variable | Required? | Description |
| -------------- | -------------------------- | --------- | ------------------------------------------------------------ |
| Model | GITHUB_TOKEN | No | GitHub token for testing models for free with rate limits. |
| Knowledge | AZURE_AI_SEARCH_ENDPOINT | Always | Endpoint URL for your Azure AI Search service. |
| | AZURE_AI_SEARCH_API_VERSION| No | API Version to use. Defaults to 2025-03-01-preview. |
| | SEARCH_AUTHENTICATION_METHOD| Always | service-principal or api-search-key. |
| | AZURE_TENANT_ID | Yes (with service-principal) | Azure AD tenant ID. |
| | AZURE_CLIENT_ID | Yes (with service-principal) | Service Principal client ID. |
| | AZURE_CLIENT_SECRET | Yes (with service-principal) | Service Principal client secret. |
| | AZURE_AI_SEARCH_API_KEY | Yes (with api-search-key) | API key for your Azure AI Search service. |
| Evaluation | EVAL_DATA_DIR | Always | Path to the JSONL evaluation dataset. |
| | AZURE_OPENAI_ENDPOINT | Text quality evaluators | Endpoint for Azure OpenAI. |
| | AZURE_OPENAI_API_KEY | Text quality evaluators | API key for Azure OpenAI. |
| | AZURE_OPENAI_DEPLOYMENT | Text quality evaluators | Deployment name (e.g., gpt-4o). |
| | AZURE_OPENAI_API_VERSION | Text quality evaluators | Version of the OpenAI API. |
| | AZURE_AI_PROJECT_ENDPOINT | Agent services | Used for Azure AI Agent querying and evaluation. |If you are using agent tools or safety evaluators, ensure your Azure project credentials are valid. If you are only performing text quality evaluation, the OpenAI endpoint and API key are sufficient.
The server supports secure, authenticated access via standard MCP client flows. Use environment-based configuration to avoid exposing sensitive data in code or logs.
If the server fails to start, verify that the runtime command and arguments match the provided configuration. Ensure the environment file path is correct and all required environment variables are present. Check for missing dependencies and confirm network access to required Azure services.
Retrieves a list of supported models from the Azure AI Foundry catalog.
Retrieves a list of state-of-the-art AI models from Microsoft Research available in Azure AI Foundry Labs.
Retrieves detailed information for a specific model from the Azure AI Foundry catalog.
Provides comprehensive instructions and setup guidance for starting to work with models from Azure AI Foundry and Azure AI Foundry Labs.
Get model quotas for a specific Azure location.
Creates an Azure AI Services account.
Retrieves a list of deployments from Azure AI Services.
Deploys a model on Azure AI Services.
Creates a new Azure AI Foundry project.
Retrieve all names of indexes from the AI Search Service
Retrieve all index schemas from the AI Search Service
Retrieve the schema for a specific index from the AI Search Service
Creates a new index
Modifies the index definition of an existing index
Removes an existing index
Adds a document to the index
Removes a document from the index
Searches a specific index to retrieve matching documents
Returns the total number of documents in the index
Retrieve all names of indexers from the AI Search Service
Retrieve the full definition of a specific indexer from the AI Search Service
Create a new indexer in the Search Service with the skill, index and data source
Delete an indexer from the AI Search Service by name
Retrieve all names of data sources from the AI Search Service
Retrieve the full definition of a specific data source
Retrieve all names of skill sets from the AI Search Service
Retrieve the full definition of a specific skill set
Retrieves the contents of a local file path (sample JSON, document etc)
Retrieves the contents of a URL (sample JSON, document etc)
List all available text evaluators.
List all available agent evaluators.
Show input requirements for each text evaluator.
Show input requirements for each agent evaluator.
Run one or multiple text evaluators on a JSONL file or content.
Convert evaluation output into a readable Markdown report.
Query an agent and evaluate its response using selected evaluators.
Evaluate a single agent interaction with specific data (query, response, tool calls, definitions).
List all Azure AI Agents available in the configured project.
Send a query to a specified agent.
Query the default agent defined in environment variables.
Retrieves detailed status and metadata for a specific fine-tuning job, including job state, model, creation and finish times, hyperparameters, and any errors.
Lists all fine-tuning jobs in the resource, returning job IDs and their current statuses for easy tracking and management.
Retrieves a chronological list of all events for a specific fine-tuning job, including timestamps and detailed messages for each training step, evaluation, and completion.
Retrieves training and evaluation metrics for a specific fine-tuning job, including loss curves, accuracy, and other relevant performance indicators for monitoring and analysis.
Lists all files available for fine-tuning in Azure OpenAI, including file IDs, names, purposes, and statuses.
Executes any tool dynamically generated from the Swagger specification, allowing flexible API calls for advanced scenarios.
Lists all dynamically registered tools from the Swagger specification, enabling discovery and automation of available API endpoints.