# How to Connect Fastio MCP Server to AutoGen Agents

AutoGen agents lose their work when sessions end. By connecting Fastio's MCP server to AutoGen via the autogen-ext MCP adapter, your multi-agent teams get persistent cloud workspaces, built-in semantic search, and a clean handoff path to human collaborators. This guide walks through the full Python setup with working code.


Source: https://fast.io/resources/fastio-mcp-integration-autogen/
Last reviewed: 2026-03-23

## Why AutoGen Agents Need External Storage

AutoGen is Microsoft's open-source framework for building multi-agent applications. You define agents with specific roles, give them tools, and let them collaborate on tasks. The framework handles message routing, tool execution, and conversation management.

The gap shows up when agents need to persist their work. By default, AutoGen agents operate in memory. A coding agent generates a script, a reviewer reads it, and an executor runs it, all within the same session. When that session ends, the files disappear. If you deploy agents in Docker containers or serverless functions, local disk storage is wiped on restart.

This creates three problems in production:

- **No persistence.** Outputs from one session are unavailable in the next. Long-running projects that span hours or days lose continuity.
- **No sharing.** Agent A writes a file to its local disk. Agent B, running in a different process or container, cannot access it without a custom file-transfer mechanism.
- **No handoff.** When agents finish their work, there is no built-in way to package and deliver results to a human client.

Cloud object stores like S3 solve the persistence problem, but they do not provide search, access control at the file level, or a collaboration layer. Fastio fills that gap by acting as an intelligent workspace that both agents and humans can access through the same interface.

## How the Integration Works

The connection between AutoGen and Fastio uses the Model Context Protocol (MCP), an open standard for giving language models access to external tools and data. Fastio runs an MCP server that exposes a consolidated MCP toolset covering workspace management, file operations, AI-powered search, and sharing.

AutoGen supports MCP through its `autogen-ext[mcp]` extension package. This package provides adapter classes that connect to any MCP server and expose its tools as standard AutoGen tools. Your agents call them the same way they call any other function.

The data flow looks like this:

1. Your AutoGen agent decides it needs to upload a file or search a workspace.
2. The agent calls the appropriate MCP tool through the adapter.
3. The adapter sends the request to Fastio's MCP endpoint over Streamable HTTP.
4. Fastio executes the operation and returns the result.
5. The agent receives the response and continues its workflow.

Fastio exposes two transport options: Streamable HTTP at `https://mcp.fast.io/mcp` (recommended) and legacy SSE at `https://mcp.fast.io/sse` The Streamable HTTP transport is the current MCP standard and what AutoGen's newer adapter classes target. For the full tool reference, see [Fastio's MCP documentation](/storage-for-agents/).

## Setting Up the Python Environment

You need Python 3.10 or higher, an AutoGen installation with MCP support, and a Fastio account. Fastio offers tiered plans (Starter $29/mo, Business $99/mo, Growth $299/mo) and a 14-day Business Trial (credit card required).

Start by installing the required packages:

```bash
pip install -U "autogen-agentchat" "autogen-ext[mcp]"
```

The `autogen-ext[mcp]` package installs the MCP adapter classes and the `mcp_server_tools` helper function. Next, create a Fastio account at [fast.io/pricing/](/pricing/) and generate an API key from your account settings.

Store your credentials as environment variables:

```bash
export FASTIO_API_KEY="your-api-key-here"
export OPENAI_API_KEY="your-llm-api-key-here"
```

AutoGen works with any LLM provider. You can use OpenAI, Anthropic, Google Gemini, or a local model through an OpenAI-compatible API. The MCP integration is independent of which model powers your agents.

Verify the installation by checking that the adapter imports resolve:

```python
from autogen_ext.tools.mcp import (
    StreamableHttpMcpToolAdapter.
    StreamableHttpServerParams.
    mcp_server_tools.
)
print("MCP adapter loaded successfully")
```

If you see an import error, confirm that your `autogen-ext` version is 0.4 or higher. Earlier versions used a different module structure.

## Connecting AutoGen to the Fastio MCP Server

With the environment ready, you can connect your AutoGen agents to Fastio. The `StreamableHttpMcpToolAdapter` class handles the connection to Fastio's Streamable HTTP endpoint.

Here is a working example that creates an AutoGen agent with access to all Fastio MCP tools:

```python
import asyncio
import os
from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient
from autogen_ext.tools.mcp import (
    StreamableHttpMcpToolAdapter.
    StreamableHttpServerParams.
    mcp_server_tools.
)

async def main():
    # Configure the Fastio MCP server connection
    server_params = StreamableHttpServerParams(
        url="/storage-for-agents/",
        headers={
            "Authorization": f"Bearer {os.environ['FASTIO_API_KEY']}"
        },
        timeout=30.0,
        sse_read_timeout=300.0,
        terminate_on_close=True.
    )

# Retrieve all available tools from the server
    tools = await mcp_server_tools(server_params)

# Create an agent with Fastio tools
    model_client = OpenAIChatCompletionClient(model="gpt-4o")
    agent = AssistantAgent(
        name="file_manager",
        model_client=model_client.
        tools=tools.
        system_message=(
            "You are a file management agent. Use the Fastio "
            "workspace tools to organize, search, and share files."
        ),
    )

# Run a task
    from autogen_agentchat.teams import RoundRobinGroupChat
    from autogen_agentchat.conditions import TextMentionTermination

termination = TextMentionTermination("TERMINATE")
    team = RoundRobinGroupChat([agent], termination_condition=termination)

result = await team.run(task="List all workspaces available to me.")
    print(result)

asyncio.run(main())
```

The `mcp_server_tools` function connects to the Fastio server, discovers all available tools, and returns them as AutoGen-compatible tool objects. If you only need specific tools, you can use the individual adapter instead:

```python
# Load a single tool by name
upload_tool = await StreamableHttpMcpToolAdapter.from_server_params(
    server_params, "storage"
)
```

This approach keeps your agent's context window lean. Loading all tools works well for general-purpose agents, but specialized agents perform better with a focused tool set.

## Building a Multi-Agent File Workflow

The real value of this integration appears when multiple agents share a workspace. A common AutoGen pattern is the planner-coder-reviewer team, where each agent has a distinct role and they coordinate through message passing.

Here is how to structure that team with Fastio as the shared storage layer:

**The Research Agent** uses Fastio's Intelligence Mode to query existing documents. When Intelligence is enabled on a workspace, all uploaded files are automatically indexed for semantic search. The agent asks natural-language questions and gets answers with citations, without downloading or parsing files locally.

**The Writer Agent** generates content and uploads it to a designated folder in the workspace. It uses workspace tools to create organized folder structures and set appropriate file metadata.

**The Reviewer Agent** gets notified of new files through the WebSocket events feed or realtime activity feed, reads the content from the workspace, and posts feedback. Because every agent accesses the same workspace, there is no file copying or format conversion.

```python
research_agent = AssistantAgent(
    name="researcher",
    model_client=model_client.
    tools=tools.
    system_message=(
        "You research topics using the Fastio workspace. "
        "Use the AI query tools to search indexed documents. "
        "Summarize findings for the writer agent."
    ),
)

writer_agent = AssistantAgent(
    name="writer",
    model_client=model_client.
    tools=tools.
    system_message=(
        "You write reports based on research findings. "
        "Upload completed drafts to the workspace using "
        "the storage tools."
    ),
)
```

Fastio's version history and append-only audit log prevent conflicts when two agents interact with the same file. Fastio tracks each revision and records all actions, ensuring complete auditability and allowing teams or agents to inspect prior versions without data loss. This eliminates race conditions that plague shared-filesystem approaches.

For reactive workflows, listen to Fastio's WebSocket events feed or poll the realtime activity feed to trigger agent tasks when files change. Instead of aggressive fixed-interval polling, your agents react to streamed events as new work arrives. This is both faster and cheaper in terms of API credits.

## Handing Off Agent Work to Humans

Agents produce work. Humans consume it. The gap between those two steps is where most agent workflows break down. An AutoGen team might generate a complete project deliverable, but without a clean handoff mechanism, the output sits on a server somewhere that the client cannot easily access.

Fastio's ownership transfer feature solves this directly. An agent creates a workspace, populates it with files, and then transfers ownership to a human user via their email address. The human receives access to a polished workspace with file previews, version history, and download options. The agent can optionally retain admin access for ongoing maintenance.

The workflow in practice:

1. Agent creates a new workspace for the project.
2. Agent uploads reports, code, and supporting documents.
3. Agent enables Intelligence Mode so the client can search the contents.
4. Agent transfers ownership to the client's email.
5. Client opens the workspace in their browser and reviews everything.

This turns agent output into a professional deliverable. The client does not need to install anything, learn a new tool, or parse raw API responses. They get a workspace that looks and works like a product they already understand.

For teams that need branded delivery, Fastio's Share features (Send, Receive, and Exchange) let agents create custom-branded file transfer links. A consulting firm's agent can deliver work through a portal that carries the firm's branding, not Fastio's.

## Troubleshooting Common Issues

**Import errors after installing autogen-ext.** Make sure you installed the MCP extra specifically: `pip install "autogen-ext[mcp]"`. The base `autogen-ext` package does not include MCP adapters.

**Authentication failures (401 or 403 responses).** Double-check that your API key is passed in the Authorization header with the "Bearer" prefix. Keys generated for one Fastio organization will not work for another.

**Context window overflow with smaller models.** Loading the entire Fastio MCP toolset adds to the system prompt that gets sent with every request. If you are using a model with a smaller context window, load only the tools your agent actually needs using `StreamableHttpMcpToolAdapter.from_server_params()` with a specific tool name.

**Timeouts on large file uploads.** The default timeout of 30 seconds may not be enough for files over 100 MB. Increase the `timeout` parameter in your `StreamableHttpServerParams` configuration. Fastio supports chunked uploads for large files.

**SSE transport deprecation warnings.** If you are using the `SseMcpToolAdapter` with Fastio's `/sse` endpoint, you may see deprecation notices. The MCP standard has moved to Streamable HTTP as the primary transport. Migrate to `StreamableHttpMcpToolAdapter` pointed at `/mcp` to stay current.

**Agent loops consuming credits.** A misconfigured agent can enter a retry loop that burns through your monthly credit allocation. Set a maximum iteration count on your AutoGen team and monitor usage through the Fastio dashboard. Tiered plans provide included credits.

For endpoint documentation and the complete tool schema, visit [/storage-for-agents/](/storage-for-agents/). For general agent onboarding, see [https://fast.io/llms.txt](https://fast.io/llms.txt).

## Frequently asked questions

### How do I give AutoGen agents file access?

Install the autogen-ext MCP extension with pip install "autogen-ext[mcp]", then connect to Fastio's MCP server using StreamableHttpMcpToolAdapter or the mcp_server_tools helper function. This gives your agents access to a consolidated MCP toolset for reading, writing, searching, and sharing files in persistent cloud workspaces.

### Can AutoGen agents read PDF files?

Yes. Upload a PDF to a Fastio workspace with Intelligence Mode enabled, and the file is automatically indexed. Your AutoGen agent can then query the PDF's contents using the AI search tools and receive answers with citations, without downloading or parsing the file locally.

### How to use MCP with AutoGen?

AutoGen supports MCP through the autogen-ext[mcp] package. Use StreamableHttpServerParams to configure the server connection, then call mcp_server_tools() to load all available tools. Pass those tools to your AssistantAgent's tools parameter. The agent can then call MCP tools like any other function.

### What is the difference between SSE and Streamable HTTP for MCP?

SSE (Server-Sent Events) is the older MCP transport protocol, and Streamable HTTP is the current standard. Fastio supports both at /sse and /mcp respectively. New projects should use Streamable HTTP with the StreamableHttpMcpToolAdapter class, as SSE is deprecated in the MCP specification.

### How can developers evaluate Fastio for AutoGen agents?

Fastio offers a 14-day Business Trial requiring a credit card, providing full access to agentic workspaces, remote MCP connectivity, and built-in semantic search across Starter ($29/mo), Business ($99/mo), and Growth ($299/mo) plans. Learn more at fast.io/pricing/.

## About Fast.io

Fast.io provides shared workspaces where people and AI agents work on the same files, with built-in semantic search and citation-backed chat over what they hold. Agents reach it through a remote MCP server at https://mcp.fast.io/mcp, a REST API at https://api.fast.io/current/, and a command line client published on npm as @vividengine/fastio-cli.
