microsoft-agents-hosting-fastapi
Integration library for Microsoft Agents with FastAPI
What it is and what it does
Microsoft Agents Hosting FastAPI is a bridge between the Microsoft Agents framework and FastAPI, allowing you to deploy conversational agents as HTTP services. It wraps the core agent runtime with FastAPI-specific bindings, providing middleware for JWT authorization, predefined channel service endpoints, and support for streaming responses. The package is built on fastapi and starlette, so it inherits their async-first design.
You use it by instantiating a CloudAdapter with your connection manager, creating an AgentApplication, and wiring them into a FastAPI route handler via the start_agent_process function. The library handles the protocol translation between HTTP requests and the agent's internal activity model, letting you focus on agent logic rather than web framework plumbing.
Use it for:
- Host a conversational agent as a REST API endpoint that receives and responds to user messages over HTTP
- Integrate Microsoft Agents with existing FastAPI applications for multi-turn dialogue handling
- Deploy agents with JWT-based authorization and channel service compatibility
- Build streaming-capable agent responses for real-time conversation experiences
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides FastAPI integration for building and hosting conversational agents using the Microsoft Agents framework, including JWT authorization, channel service endpoints, and streaming response support.
Yes, if you are building conversational agents with the Microsoft Agents framework and want to deploy them on FastAPI. The package is actively maintained, has low install friction, carries a permissive MIT license, and integrates cleanly with FastAPI's async model. No known vulnerabilities.
Install
microsoft-agents-hosting-fastapi on PyPI
pip
pip install microsoft-agents-hosting-fastapiuv
uv add microsoft-agents-hosting-fastapipoetry
poetry add microsoft-agents-hosting-fastapiInstalling microsoft-agents-hosting-fastapi
Before you install
Low install friction with a pure-Python wheel. Actively maintained with releases every 2–3 weeks; last commit 2026-08-13. Requires Python >=3.10. Depends on microsoft-agents-hosting-core, fastapi, and starlette.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install microsoft-agents-hosting-fastapi
from fastapi import FastAPI, Request
from microsoft_agents.hosting.fastapi import start_agent_process, CloudAdapter
from microsoft_agents.hosting.core.app import AgentApplication
app = FastAPI()
adapter = CloudAdapter(connection_manager=connection_manager)
agent_app = AgentApplication()
@app.post("/api/messages")
async def messages(request: Request):
return await start_agent_process(request, agent_app, adapter)
Requires Python >=3.10
Verify before relying
- Whether the package supports streaming response patterns beyond what the description excerpt shows
- Specific JWT authorization middleware configuration requirements and defaults
- Whether CloudAdapter and AgentApplication are fully documented or require external Microsoft Agents docs
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — microsoft-agents-hosting-core, fastapi, starlette |
| Maintenance | actively maintained — 15 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 222,972/month — #9,255 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: microsoft_agents_hosting_fastapi-1.3.0-py3-none-any.whl
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
microsoft-agents-authentication-msalProvides MSAL-based authentication for…
permissive · top 15,000 on PyPI
microsoft-agents-hosting-aiohttpProvides HTTP hosting integration for Microsoft…
permissive · top 15,000 on PyPI
microsoft-agents-hosting-coreProvides the core hosting infrastructure for…
permissive · top 5,000 on PyPI
microsoft-agents-hosting-teamsProvides Teams-specific handlers and utilities…
permissive · top 15,000 on PyPI
microsoft-agents-activityProvides core types and schemas implementing…
permissive · top 5,000 on PyPI
agent-framework-azure-aiIntegrates Azure AI Foundry memory capabilities…
permissive · top 15,000 on PyPI
agent-framework-azurefunctionsHosts Microsoft Agent Framework agents on Azure…
permissive · top 15,000 on PyPI
fastapi-cloudeventsFastAPI plugin that automatically parses and…
permissive · top 15,000 on PyPI
ag_ui_adkBridges Google ADK agents to the AG-UI…
permissive · top 15,000 on PyPI
microsoft-agents-copilotstudio-clientConnects Python applications to AI agents…
permissive · top 15,000 on PyPI