MAF Agent
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.
What is MAF Agent?
MAF Agent is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to 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.
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.
This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- This repository demonstrates how to build, expose, and inter
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx agent-as-mcp-server-mafConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use MAF Agent
This project demonstrates how to expose a Microsoft Agent Framework (MAF) agent as an MCP server using STDIO transport, enabling any MCP-compatible client to invoke the agent as a tool via JSON-RPC over stdin/stdout. It uses Azure OpenAI as the LLM backend and includes a restaurant-themed reference agent, a minimal ping client, and a ChatAgent orchestration client that calls the MCP server as a tool. The pattern is useful for wrapping existing enterprise agents and making them accessible to AI orchestration frameworks through a standardized interface.
Prerequisites
- Python 3.10 or higher
- An Azure OpenAI resource with a deployed model (e.g., gpt-4o) and API key or Azure CLI login
- The agent-framework, mcp, anyio, azure-identity, and python-dotenv Python packages
- An MCP-compatible client or the included test scripts
Clone the repository
Clone the agent-as-mcp-server-MAF repository and navigate into the project directory.
git clone https://github.com/chanirban/agent-as-mcp-server-MAF.git
cd agent-as-mcp-server-MAFCreate a virtual environment and install dependencies
Set up a Python virtual environment and install the required packages including the pre-release agent-framework.
python -m venv .venv
source .venv/bin/activate
pip install --pre agent-framework mcp anyio azure-identity python-dotenvConfigure Azure OpenAI environment variables
Set the required environment variables for your Azure OpenAI endpoint, deployment name, API version, and authentication. Use either an API key or Azure CLI credentials.
export AZURE_OPENAI_ENDPOINT="https://<your-endpoint>.cognitiveservices.azure.com/"
export AZURE_OPENAI_RESPONSES_DEPLOYMENT_NAME="gpt-4o"
export AZURE_OPENAI_CHAT_DEPLOYMENT_NAME="gpt-4o"
export AZURE_OPENAI_API_VERSION="2025-03-01-preview"
export AZURE_OPENAI_API_KEY="<your-key>"Run the ping client to verify the MCP server works
Execute the mcp-ping.py script which launches agent-as-mcp-svr.py as a subprocess, lists available tools, and performs a health-check call.
python mcp-ping.pyRun the ChatAgent orchestration client
Use client-local-mcp.py to run a ChatAgent that treats the local MCP server as a tool, executing a sequence of restaurant-related prompts.
python client-local-mcp.pyMAF Agent Examples
Client configuration
Claude Desktop config to launch the MAF agent MCP server as a subprocess using STDIO transport.
{
"mcpServers": {
"maf-agent": {
"command": "python",
"args": ["/path/to/agent-as-mcp-server-MAF/agent-as-mcp-svr.py"],
"env": {
"AZURE_OPENAI_ENDPOINT": "https://<your-endpoint>.cognitiveservices.azure.com/",
"AZURE_OPENAI_RESPONSES_DEPLOYMENT_NAME": "gpt-4o",
"AZURE_OPENAI_API_VERSION": "2025-03-01-preview",
"AZURE_OPENAI_API_KEY": "<your-key>"
}
}
}
}Prompts to try
Example interactions when the MAF agent is connected through MCP.
- "What's on the menu?"
- "Do you have any vegetarian options?"
- "What are today's specials and their prices?"
- "Is the restaurant open for happy hour right now?"Troubleshooting MAF Agent
Invalid JSON or EOF error when running the server directly
Do not run agent-as-mcp-svr.py directly — it speaks MCP over STDIO and requires a client. Use mcp-ping.py or client-local-mcp.py which launch the server as a subprocess.
Token or credential errors from Azure OpenAI
Ensure AZURE_OPENAI_API_KEY is set, or run `az login` and set AZURE_USE_CLI=1. For corporate environments, verify that REQUESTS_CA_BUNDLE points to a valid PEM file.
Tool argument mismatch errors
The agent tool expects a single `task` string argument. Ensure any client sending calls passes the argument as `{"task": "your prompt"}` rather than named parameters.
Frequently Asked Questions about MAF Agent
What is MAF Agent?
MAF Agent is a Model Context Protocol (MCP) server that 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. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install MAF Agent?
Follow the installation instructions on the MAF Agent GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with MAF Agent?
MAF Agent works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is MAF Agent free to use?
Yes, MAF Agent is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
MAF Agent Alternatives — Similar Coding Agents Servers
Looking for alternatives to MAF Agent? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
★ 142.2kProduction-ready platform for agentic workflow development.
Ruflo
★ 54.0k🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
★ 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
★ 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
★ 25.5kBuild and run agents you can see, understand and trust.
Serena
★ 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
Browse More Coding Agents MCP Servers
Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up MAF Agent in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use MAF Agent?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.