← Toutes les connexions

Connexion avec Microsoft Foundry

Microsoft Foundry — NewAlgorithm as an MCP tool for Agent Service agents.

Avant de commencer, créez votre compte gratuit.Créer un compte

Ce contenu est disponible en anglais.

Quel MCP allez-vous connecter ? Les commandes ci-dessous s'adaptent à votre choix.

  1. 1

    Generate your API key

    Sign in to app.newalgorithm.io with your account, open Keys & apps and generate a key. It is shown only once: copy it and store it somewhere safe.

    Key format
    na_live_xxxxxxxxxxxxxxxxx
  2. 2

    Store the key in Key Vault

    Save the API key as an Azure Key Vault secret and grant access to the project's managed identity. The key shouldn't appear in code or in shared environment variables.

  3. 3

    In the portal: add the tool

    In the Foundry project, open the agent and go to Tools → Add → MCP server. Enter the label, the server URL and the authorization header.

    Server URL and header
    https://totvs.mcp.newalgorithm.io/mcp
    Authorization: Bearer na_live_xxxxxxxxxxxxxxxxx
  4. 4

    Or declare it with the SDK

    In Python, the MCP tool is declared with McpTool, and the headers go in through update_headers:

    Python
    import os
    from azure.ai.agents.models import McpTool
    
    na = McpTool(
        server_label="newalgorithm",
        server_url="https://totvs.mcp.newalgorithm.io/mcp",
        allowed_tools=["na_search", "na_route", "na_specialists", "na_version"],
    )
    na.update_headers("Authorization", f"Bearer {os.environ['NA_API_KEY']}")
    
    agent = project.agents.create_agent(
        model="gpt-4o",
        name="sap-agent",
        instructions=(
            "Query NewAlgorithm before answering anything about SAP. "
            "Let the Manager Agent choose the Specialist."
        ),
        tools=na.definitions,
    )
  5. 5

    Decide on the approval policy

    By default, Agent Service asks for approval on every MCP tool call. In automations with no human in the loop, change this behavior deliberately — it's a governance decision, not a matter of convenience.

    na.set_approval_mode("never")
  6. 6

    Confirm

    Run a test thread with an SAP question and check in the run trace that the na_* tools were called.

Pass allowed_tools with an explicit list: besides reducing the surface exposed to the agent, it records in code what that agent is allowed to query.

Détails sur l'authentification et les outils dans la Documentation.