Skip to content

Add agent-with-hosted-mcp sample to hosted agents (Python)#1

Closed
Copilot wants to merge 2 commits into
mainfrom
copilot/mcp-tools-inquiry
Closed

Add agent-with-hosted-mcp sample to hosted agents (Python)#1
Copilot wants to merge 2 commits into
mainfrom
copilot/mcp-tools-inquiry

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 8, 2026

The samples/python/hosted-agents/agent-framework/ directory was missing an MCP sample equivalent to samples-classic/python/getting-started-agents/agent-framework/agent_with_hosted_mcp.

New sample: agent-with-hosted-mcp

  • main.pyHostedMCPTool wired to https://learn.microsoft.com/api/mcp via AzureOpenAIChatClient + DefaultAzureCredential
  • agent.yaml — hosted agent config; AZURE_OPENAI_ENDPOINT / AZURE_OPENAI_CHAT_DEPLOYMENT_NAME env vars, gpt-4o-mini model resource
  • Dockerfile — Python 3.12-slim, matches sibling samples
  • requirements.txtazure-ai-agentserver-agentframework==1.0.0b12
  • README.md — prerequisites, env setup, local run, deployment pointer
agent = AzureOpenAIChatClient(credential=DefaultAzureCredential()).create_agent(
    name="DocsAgent",
    instructions="You are a helpful assistant that can help with microsoft documentation questions.",
    tools=[HostedMCPTool(name="Microsoft Learn MCP", url="https://learn.microsoft.com/api/mcp")],
)
from_agent_framework(agent).run()

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Mar 8, 2026
Co-authored-by: XOEEst <18523445+XOEEst@users.noreply.github.com>
Copilot AI changed the title [WIP] Inquire about available MCP tools Add agent-with-hosted-mcp sample to hosted agents Mar 8, 2026
Copilot AI changed the title Add agent-with-hosted-mcp sample to hosted agents Add agent-with-hosted-mcp sample to hosted agents (Python) Mar 8, 2026
@XOEEst XOEEst closed this Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants