Skip to main content

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

Prerequisites

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

Quick Start

Connect to StackOne MCP via Azure AI Foundry:
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,
            "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 ConnectionsAdd 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

Environment Variables

STACKONE_API_KEY=<stackone_api_key>
AZURE_OPENAI_ENDPOINT=your_azure_endpoint
AZURE_OPENAI_KEY=your_azure_key

Resources

Next Steps