Agent as MCP Server (Microsoft Agent Framework)
This repo demonstrates how to expose an agent as an MCP server using the Microsoft Agent Framework (MAF), and how to connect to it from:
- a test ping client (
mcp-ping.py), and
Potencialize seu agente
Instalação do publicador. Não é um endpoint do PlugMCP.
Host a copy with our keys and logs.
Ainda não há uma versão empacotada no registro. Siga o README do repositório.
URL remota ou um comando na sua máquina? Como as duas instalações diferem
Rodar no PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
AbrirDo publicador
This repo demonstrates how to expose an agent as an MCP server using the Microsoft Agent Framework (MAF), and how to connect to it from:
mcp-ping.py), andThis repository demonstrates how to build, expose, and interact with an agent as an MCP (Model Context Protocol) server using the Microsoft Agent Framework with Azure OpenAI.
client-local-mcp.py) that uses the local MCP server as a tool.It uses the STDIO transport for MCP, which means the client launches the server as a subprocess and the two sides exchange JSON‑RPC messages over stdin/stdout.
Files
agent-as-mcp-svr.py— MCP server that exposes the agent viaagent.as_mcp_server()andstdio_server().mcp-ping.py— Minimal client that launches the server withstdio_client(), lists tools, and calls the agent tool.client-local-mcp.py— ChatAgent orchestration example usingMCPStdioToolto connect to the local server.
pip install --pre agent-framework mcp anyio azure-identity python-dotenv
If you use Azure OpenAI (recommended):
export AZURE_OPENAI_ENDPOINT="https://<your-endpoint>.cognitiveservices.azure.com/"
export AZURE_OPENAI_RESPONSES_DEPLOYMENT_NAME="gpt-4o" # responses / agent usage
export AZURE_OPENAI_CHAT_DEPLOYMENT_NAME="gpt-4o" # optional for chat client
export AZURE_OPENAI_API_VERSION="2025-03-01-preview" # or 'preview'
# One of:
export AZURE_OPENAI_API_KEY="<your-key>" # simplest
# OR AAD-based:
# (unset REQUESTS_CA_BUNDLE SSL_CERT_FILE; az login)
# export AZURE_USE_CLI=1
Corporate CA bundle users: ensure
REQUESTS_CA_BUNDLE(and optionallySSL_CERT_FILE) point to a valid PEM path. Foraz login, you may need to temporarily unset those vars.
This starts the server as a subprocess and calls the agent tool:
python mcp-ping.py
Expected output (abridged):
TOOLS: ['RestaurantAgent']
== RestaurantAgent input schema ==
{ ... JSON schema ... }
== Health Check (JSON) ==
{ "status": "ok", "endpoint": "...", ... }
This lets a ChatAgent use the local MCP server as a tool:
python client-local-mcp.py
It will run a sequence of prompts (health check, menu list, dietary filter, pricing, happy hour).
mcp-ping.py (they start the server and speak MCP).AZURE_OPENAI_API_KEY or AZURE_USE_CLI=1 with az login. For AAD chains, DefaultAzureCredential must be able to find an identity.task string. Ensure clients send {"task":"your prompt"}.stdio_server() exposes async stdin/stdout streams; server.run() handles JSON‑RPC (initialize/list_tools/call_tool).stdio_client() launches the server process and returns streams; ClientSession drives the JSON‑RPC calls.This repository demonstrates how to build, expose, and interact with an agent as an MCP (Model Context Protocol) server using the Microsoft Agent Framework with Azure OpenAI.
Ferramentas
Ainda não há lista de ferramentas. Servidores remotos recebem uma após a primeira verificação de saúde.
Perguntas frequentes
Copie nesta página a configuração stdio para Cursor, Claude Desktop, Claude Code ou VS Code. Ela usa a instalação do publicador, não um proxy do PlugMCP.
Este registro não lista nenhuma variável de ambiente obrigatória.
Agent As MCP Server MAF roda localmente via stdio.
Última verificação: 2026-10-28. This repository demonstrates how to build, expose, and interact with an agent as an MCP (Model Context Protocol) server using the Microsoft Agent Framework with Azure OpenAI.