Skip to content
MfPy

Microsoft Agent Framework (Python)

Python agent SDK: agents, tools, MCP, skills, middleware, sessions, the agent harness, graph and functional workflows, multi-agent orchestration, evaluation and observability.

Microsoft Agent Framework for Python combines Semantic Kernel’s enterprise foundations with AutoGen’s multi-agent patterns. Build single agents, graph workflows that checkpoint and wait for people, prebuilt multi-agent orchestrations, A2A endpoints and YAML-defined agents on the same primitives.

Install

Terminal window
pip install agent-framework

Version

agent-framework 1.26.0 (checked 2026-11-19) · stable core with agent-framework-foundry, agent-framework-openai and the provider packages bundled · Python 3.11+

Best for

Azure-native agents, multi-agent orchestration, durable human-in-the-loop workflows, cross-framework A2A.

  • Stable: agent-framework-core (released in lockstep with the agent-framework meta package), agent-framework-openai, agent-framework-foundry, agent-framework-orchestrations, agent-framework-declarative, agent-framework-ag-ui and agent-framework-github-copilot.
  • Beta (1.0.0bYYMMDD versions, --pre when installed alone): A2A, Anthropic, Claude Agent SDK, Bedrock, Ollama, Gemini, Mistral, Copilot Studio, Foundry hosting, Azure Functions, Durable Task, Redis, Cosmos DB, Mem0, DevUI and others.
  • Experimental APIs inside stable packages emit an ExperimentalWarning on first use: FIDES security, evaluation, functional workflows, vector stores, FileHistoryProvider, and parts of the harness (MemoryContextProvider, FileAccessProvider, BackgroundAgentsProvider, AgentLoopMiddleware, TodoFileStore).
  • A2A: agent_framework.a2a provides A2AAgent (client), A2AExecutor (server), A2AAgentSession and A2AServiceSessionId.

Before GA (code written against the 2025 previews):

  • ChatAgent → Agent, ChatMessage → Message, AgentRunContext → AgentContext, AgentProtocol → SupportsAgentRun; middleware’s next parameter became call_next (1.0.0b260210).
  • @ai_function → @tool, AIFunction → FunctionTool (1.0.0b260128); create_agent → as_agent (1.0.0b260116).
  • display_name removed from agents; middleware= takes a list; AggregateContextProvider removed (pass several context providers instead) (1.0.0b260114).
  • AgentRunResponse / AgentRunResponseUpdate renamed AgentResponse / AgentResponseUpdate.

Since GA:

  • WorkflowBuilder(output_executors=...) is a deprecated alias for output_from=.
  • Harness tool names changed in 1.7.0 (add_todos → todos_add, set_mode → mode_set, …).
  • Skills (1.11.0): require_script_approval= replaced by disable_load_skill_approval / disable_read_skill_resource_approval / disable_run_skill_script_approval; every skill tool needs approval unless you opt out.
  • Functional workflows (1.14.0): @workflow returns a definition; call .build() before .run().
  • AzureOpenAIChatClient removed: use OpenAIChatClient(azure_endpoint=..., credential=...).
  • MCP (1.23.0, 2026-10-22): moved to MCP Python SDK 2.x (mcp>=2.2,<3). The WebSocket transport and MCP tasks are gone (MCPWebsocketTool, MCPTaskOptions and task_options= remain as deprecated stubs); mcp types use snake_case attributes; http_client= takes an httpx2.AsyncClient; MCPTool.session is deprecated (use mcp_client=); pruned installs also need tenacity. See the MCP page.
  • AG-UI (since 1.23.0): add_agent_framework_fastapi_endpoint() needs authorization_scope_resolver= or single_user=True (see the production guide).
  • Docker shell tool (since 1.23.0, agent-framework-tools): DockerShellTool(extra_run_args=...) renamed unsafe_extra_run_args=.

Migrating from Semantic Kernel or AutoGen? See Microsoft’s migration guide.

import asyncio
from agent_framework import Agent
from agent_framework.openai import OpenAIChatClient
async def main() -> None:
agent = Agent(client=OpenAIChatClient(), instructions="You are a helpful assistant.")
response = await agent.run("What is Microsoft Agent Framework?")
print(response.text)
asyncio.run(main())

Next: the installation and quick start, then the comprehensive guide.

DateVersionChanges
2026-10-251.23.0Updated for 1.23.0: MCP SDK 2.x migration (MCP, skills, tools, recipes, feature tour, comprehensive and advanced pages; examples re-run against local MCP servers), AG-UI endpoint authorization (production guide), alpha agent-framework-hosting-mcp. Breaking changes listed above.
2026-10-251.22.0Audit of every Python page: each block run against 1.22.0 with a fake chat client. Fixed wrong APIs and behaviour on the tools, middleware, sessions, compaction, MCP, skills, checkpointing, HITL, harness, evaluation, observability, advanced, feature-tour and recipes pages (details in each page’s revision history); added sidebar order to every page.
2026-10-211.22.0Comprehensive guide rewritten (class reference replaced by an API map; duplicated sections removed); A2A serving documented; broken HITL, streaming, routing, A2A, provider and evaluation examples fixed; status labels corrected.
2026-10-211.22.0Per-class pages merged into the topic pages; examples re-checked against 1.22.0.
2026-08-211.14.0Per-class reference pages consolidated.
2026-04-20 – 2026-05-091.0.1 – 1.3.0Topic pages added for providers, orchestration, middleware, MCP, HITL, tools, skills, checkpointing, compaction, observability and evaluation.
2026-04-021.0.0GA.
2025-10-011.0.0b251001First public preview on PyPI.