Learning by Patrik

Develop a text analysis agent with the Azure Language MCP server | AI-103 | Episode 16

An LLM can identify entities or PII itself—but an agent can instead delegate these tasks to a specialized Azure Language tool through MCP. This separates agent reasoning from deterministic NLP processing.

Architecture: Prompt → Agent → discover/select MCP tool → Azure Language → tool result → final response

What to know

Azure Language MCP Server exposes Azure Language capabilities as tools that an agent can dynamically discover and invoke. Core capabilities include PII detection, language detection, and Named Entity Recognition (NER); additional Language capabilities are also exposed through MCP.

The important distinction is:

  • Agent/LLM: reasons about the request and chooses an appropriate tool.

  • MCP: standardizes tool discovery and invocation.

  • Azure Language: performs the specialized NLP operation.

Tool selection is not hard-coded. The MCP server advertises available tools and their descriptions; the agent matches the user's intent to those descriptions. Good agent instructions further guide when Azure Language should be used.

Minimal mental model

# Agent is already configured with Azure Language MCP
response = openai_client.responses.create(
    input="Find and redact PII in this text...",
    extra_body={"agent": {"name": "text-agent"}}
)

print(response.output_text)

Behind this simple call:

Agent
 └─ discovers MCP tools
     └─ selects PII tool
         └─ Azure Language analyzes text
             └─ result returns to Agent

Watch for approval: MCP tool calls can require user/application approval. Either handle the approval request in code or configure appropriate tools for automatic approval.

Remember: MCP exposes tools; the agent selects them; Azure Language executes the NLP task.

Azure
MCP
Agents
Language
Foundry

Comments