> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure AI Foundry Agent Service

> Connect StackOne MCP to Azure AI Foundry Agent Service with native MCP integration.

## Overview

Azure AI Foundry Agent Service provides native MCP support, allowing agents to connect to StackOne's MCP server for enterprise-grade AI workflows.

[Official Docs](https://learn.microsoft.com/en-us/azure/ai-foundry/agents/how-to/tools/model-context-protocol)

## Prerequisites

* Azure AI Foundry workspace
* Azure OpenAI deployment
* StackOne API credentials

## Quick Start

Connect to StackOne MCP via Azure AI Foundry:

```python theme={null}
from azure.ai.projects import AIProjectClient
from azure.identity import DefaultAzureCredential
import os
import base64

# Configure StackOne account
STACKONE_ACCOUNT_ID = "<account_id>"  # Your StackOne account ID

# Encode StackOne API key
auth_token = base64.b64encode(
    f"{os.getenv('STACKONE_API_KEY')}:".encode()
).decode()

# Create Azure AI project client
project_client = AIProjectClient.from_connection_string(
    credential=DefaultAzureCredential(),
    conn_str="<your-connection-string>"
)

# Register StackOne MCP server
mcp_connection = project_client.connections.create_or_update(
    connection_name="stackone-mcp",
    properties={
        "connectionType": "MCP",
        "serverUrl": "https://api.stackone.com/mcp",
        "headers": {
            "Authorization": f"Basic {auth_token}",
            "x-account-id": STACKONE_ACCOUNT_ID,
            "Content-Type": "application/json",
            "Accept": "application/json,text/event-stream",
            "MCP-Protocol-Version": "2025-06-18"
        }
    }
)

# Create agent with StackOne MCP tools
agent = project_client.agents.create_agent(
    model="gpt-5",
    name="Platform Data Assistant",
    instructions="You help analyze data from connected platforms",
    tools=[{
        "type": "mcp",
        "mcp_server": "stackone-mcp"
    }]
)

# Create thread and run
thread = project_client.agents.create_thread()
message = project_client.agents.create_message(
    thread_id=thread.id,
    role="user",
    content="List Salesforce accounts"
)

run = project_client.agents.create_and_process_run(
    thread_id=thread.id,
    assistant_id=agent.id
)

print(run.status)
```

## Portal Configuration

You can also configure MCP connections through the Azure AI Foundry portal:

1. Navigate to your AI Foundry workspace
2. Go to **Connections** → **Add Connection**
3. Select **Model Context Protocol (MCP)**
4. Enter StackOne MCP details:
   * **Server URL**: `https://api.stackone.com/mcp`
   * **Headers**: Add authentication headers
   * **Server Label**: `stackone-mcp`

[Learn more in Azure docs](https://learn.microsoft.com/en-us/azure/ai-foundry/agents/how-to/tools/model-context-protocol)

## Environment Variables

```bash theme={null}
STACKONE_API_KEY=<stackone_api_key>
AZURE_OPENAI_ENDPOINT=your_azure_endpoint
AZURE_OPENAI_KEY=your_azure_key
```

## Resources

* [Azure AI Foundry MCP Documentation](https://learn.microsoft.com/en-us/azure/ai-foundry/agents/how-to/tools/model-context-protocol)
* [MCP Code Samples](https://learn.microsoft.com/en-us/azure/ai-foundry/agents/how-to/tools/model-context-protocol-samples)
* [Azure AI Foundry Agent Service](https://learn.microsoft.com/en-us/azure/ai-foundry/agents/)
* [StackOne Authentication](/mcp/auth-security)

## Next Steps

<CardGroup cols={2}>
  <Card title="OpenAI Agents SDK" icon="robot" href="/mcp/framework-guides/openai-agents-sdk">
    Use OpenAI Agents SDK with Azure OpenAI
  </Card>

  <Card title="Anthropic SDK" icon="message" href="/mcp/framework-guides/anthropic-sdk">
    Build agents with Anthropic SDK
  </Card>
</CardGroup>
