
Mit Microsoft Foundry verbinden
Microsoft Foundry — NewAlgorithm as an MCP tool for Agent Service agents.
Dieser Inhalt ist auf Englisch verfügbar.
Welchen MCP möchten Sie verbinden? Die Befehle unten passen sich Ihrer Auswahl an.
- 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 formatna_live_xxxxxxxxxxxxxxxxx - 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
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 headerhttps://totvs.mcp.newalgorithm.io/mcp Authorization: Bearer na_live_xxxxxxxxxxxxxxxxx - 4
Or declare it with the SDK
In Python, the MCP tool is declared with McpTool, and the headers go in through update_headers:
Pythonimport 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
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
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.
Details zu Authentifizierung und Tools in der Dokumentation.