# How to integrate Miro MCP with Pydantic AI

```json
{
  "title": "How to integrate Miro MCP with Pydantic AI",
  "toolkit": "Miro",
  "toolkit_slug": "miro",
  "framework": "Pydantic AI",
  "framework_slug": "pydantic-ai",
  "url": "https://composio.dev/toolkits/miro/framework/pydantic-ai",
  "markdown_url": "https://composio.dev/toolkits/miro/framework/pydantic-ai.md",
  "updated_at": "2026-05-12T10:19:06.058Z"
}
```

## Introduction

This guide walks you through connecting Miro to Pydantic AI using the Composio tool router. By the end, you'll have a working Miro agent that can create a new board for marketing brainstorm, list all boards owned by your team, show members of the q2 planning board through natural language commands.
This guide will help you understand how to give your Pydantic AI agent real control over a Miro account through Composio's Miro MCP server.
Before we dive in, let's take a quick look at the key ideas and tools involved.

## Also integrate Miro with

- [ChatGPT](https://composio.dev/toolkits/miro/framework/chatgpt)
- [OpenAI Agents SDK](https://composio.dev/toolkits/miro/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/miro/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/miro/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/miro/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/miro/framework/codex)
- [Cursor](https://composio.dev/toolkits/miro/framework/cursor)
- [VS Code](https://composio.dev/toolkits/miro/framework/vscode)
- [OpenCode](https://composio.dev/toolkits/miro/framework/opencode)
- [OpenClaw](https://composio.dev/toolkits/miro/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/miro/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/miro/framework/cli)
- [Google ADK](https://composio.dev/toolkits/miro/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/miro/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/miro/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/miro/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/miro/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/miro/framework/crew-ai)

## TL;DR

Here's what you'll learn:
- How to set up your Composio API key and User ID
- How to create a Composio Tool Router session for Miro
- How to attach an MCP Server to a Pydantic AI agent
- How to stream responses and maintain chat history
- How to build a simple REPL-style chat interface to test your Miro workflows

## What is Pydantic AI?

Pydantic AI is a Python framework for building AI agents with strong typing and validation. It leverages Pydantic's data validation capabilities to create robust, type-safe AI applications.
Key features include:
- Type Safety: Built on Pydantic for automatic data validation
- MCP Support: Native support for Model Context Protocol servers
- Streaming: Built-in support for streaming responses
- Async First: Designed for async/await patterns

## What is the Miro MCP server, and what's possible with it?

The Miro MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Miro account. It provides structured and secure access to your whiteboards, so your agent can create new boards, manage board content, organize workflows, and collaborate visually—all on your behalf.
- Automated board creation and setup: Instantly instruct your agent to create new Miro boards with specific names and descriptions for projects, brainstorming, or workshops.
- Visual content management: Ask your agent to add, retrieve, or delete items such as shapes, sticky notes, app cards, or document items from any board, keeping your workspace tidy and up to date.
- Efficient team and member management: Have your agent fetch and list all members of a board so you can easily track collaborators and manage access.
- Seamless board organization and retrieval: Let your agent search and retrieve boards by team, owner, or keyword to keep your workspace organized and easy to navigate.
- Connector and tag insights: Direct your agent to get details on connectors and tags used within boards, helping you map relationships and categorize content visually.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `MIRO_ATTACH_TAG_TO_ITEM` | Attach Tag To Item | Tool to attach an existing tag to a specific item on a Miro board. Use when you need to associate a tag with an item after confirming the board, item, and tag IDs. Note that card and sticky note items can have up to 8 tags. |
| `MIRO_CREATE_APP_CARD_ITEM` | Create App Card Item | Tool to add an app card item to a board. Use when you need to push a rich preview card with custom fields into a Miro board. Returns the created card; the card ID is nested under data.id in the response, not at the top level. Burst writes may trigger HTTP 429; honor the Retry-After header before retrying. |
| `MIRO_CREATE_BOARD` | Create Board | Tool to create a new board. Use when you need to set up a board with a specific name, description, and policies. Example: "Create a new board named Project Plan". If workspace board quota is reached, returns HTTP 400; use MIRO_GET_BOARDS to reuse an existing board instead. |
| `MIRO_CREATE_CARD_ITEM` | Create Card Item | Tool to create a card item on a Miro board. Use when you need to add task cards with titles, descriptions, due dates, and assignees. |
| `MIRO_CREATE_CONNECTOR` | Create Connector | Tool to create a connector (edge/arrow) that links two existing board items. Use after creating or locating the two endpoint items (shapes/cards/stickies) to establish visual relationships in flowcharts and diagrams. Both start and end items must be specified; connectors cannot be created with loose endpoints. |
| `MIRO_CREATE_DOCUMENT_ITEM` | Create Document Item | Tool to create a document item on a Miro board by providing a URL to the document. Use when you need to attach a document (PDF, DOC, etc.) to a board from a publicly accessible URL. |
| `MIRO_CREATE_DOCUMENT_ITEM_USING_FILE_FROM_DEVICE` | Create Document Item Using File From Device | Tool to create a document item on a Miro board using a URL to the document. Use when you need to add a document (PDF, DOC, etc.) to a board from a publicly accessible URL. |
| `MIRO_CREATE_EMBED_ITEM` | Create Embed Item | Tool to create an embed item on a Miro board by providing a URL to embed content (YouTube videos, websites, etc.). Use when you need to add embedded content from external sources to a board. |
| `MIRO_CREATE_FRAME_ITEM` | Create Frame Item | Tool to add a frame item to a Miro board. Use frames to group and organize diagram regions (e.g., swimlanes, sections, slides). |
| `MIRO_CREATE_GROUP` | Create Group | Tool to create a group on a Miro board by grouping multiple items together. Use when you need to organize related board items (shapes, sticky notes, cards, etc.) into a single logical group. |
| `MIRO_CREATE_IMAGE_ITEM_USING_LOCAL_FILE` | Create Image Item Using Local File | Tool to create an image item on a Miro board by uploading a local image file. Use when you need to add an image from the user's device to a board, rather than referencing an external URL. |
| `MIRO_CREATE_ITEMS_IN_BULK` | Create Items in Bulk | Tool to create multiple items on a Miro board in a single request. Use when you need to add 1-20 items (text, sticky notes, shapes, cards, frames, etc.) efficiently. Items are created atomically in one API call. |
| `MIRO_CREATE_MINDMAP_NODE_EXPERIMENTAL` | Create Mind Map Node (Experimental) | Tool to create a mind map node on a Miro board. Use when building mind maps or organizing ideas visually in a hierarchical structure. This is an experimental endpoint. |
| `MIRO_CREATE_SHAPE_ITEM2` | Create Shape Item | Tool to create a shape item on a Miro board. Use when you need to add shapes (basic or flowchart) to a board with specific styling and positioning. |
| `MIRO_CREATE_STICKY_NOTE_ITEM` | Create Sticky Note Item | Tool to create a sticky note item on a Miro board. Use when you need to add a new sticky note with customizable content, color, shape, and position. |
| `MIRO_CREATE_TAG` | Create Tag | Tool to create a new tag on a Miro board. Use when you need to add a new tag with a specific title and color to categorize board items. |
| `MIRO_CREATE_TEXT_ITEM` | Create Text Item | Tool to create a text item on a Miro board. Use when you need to add text content to a board, such as labels, notes, or annotations. |
| `MIRO_DELETE_APP_CARD_ITEM` | Delete App Card Item | Tool to delete an app card item from a board. Use when you need to remove an app card item created by your app after it is no longer needed. |
| `MIRO_DELETE_CARD_ITEM` | Delete Card Item | Tool to delete a card item from a board. Use when you need to remove a card item from a Miro board after it is no longer needed. |
| `MIRO_DELETE_CONNECTOR` | Delete Connector | Tool to delete a specific connector from a board. Use when you need to remove a connector (edge/arrow) between board items after confirming its board and connector IDs. |
| `MIRO_DELETE_DOCUMENT_ITEM` | Delete Document Item | Tool to delete a document item from a board. Use when you need to remove a document item (e.g., PDF or image) that is no longer relevant. Example: "Delete the document item with ID 'item456' from board 'board123'." |
| `MIRO_DELETE_EMBED_ITEM` | Delete Embed Item | Tool to delete an embed item from a board. Use when you need to remove an embedded content item (e.g., YouTube video, website) that is no longer needed. |
| `MIRO_DELETE_FRAME_ITEM` | Delete Frame Item | Tool to delete a frame item from a Miro board. Use when you need to remove a frame that groups or organizes content on the board. |
| `MIRO_DELETE_GROUP` | Delete Group | Tool to delete a group from a board. Use when you need to remove a group and optionally its items. |
| `MIRO_DELETE_IMAGE_ITEM` | Delete Image Item | Tool to delete an image item from a board. Use when you need to remove an image that is no longer needed. |
| `MIRO_DELETE_ITEM` | Delete Item | Tool to delete a specific item from a board. Use when you need to remove an item (e.g., shape, sticky note) after confirming its board and item IDs. |
| `MIRO_DELETE_MINDMAP_NODE_EXPERIMENTAL` | Delete Mind Map Node (Experimental) | Tool to delete a mind map node from a board. Use when you need to remove a mind map node after confirming its board and item IDs. This is an experimental endpoint. |
| `MIRO_DELETE_SHAPE_ITEM` | Delete Shape Item | Tool to delete a shape item from a board. Use when you need to remove a specific shape that is no longer needed after confirming its board and item IDs. |
| `MIRO_DELETE_STICKY_NOTE_ITEM` | Delete Sticky Note Item | Tool to delete a sticky note item from a board. Use when you need to remove a sticky note that is no longer needed. |
| `MIRO_DELETE_TAG` | Delete Tag | Tool to delete a specific tag from a board. Use when you need to remove a tag after confirming its board and tag IDs. |
| `MIRO_DELETE_TEXT_ITEM` | Delete Text Item | Tool to delete a text item from a board. Use when you need to remove a text item after confirming its board and item IDs. |
| `MIRO_GET_ALL_GROUPS` | Get All Groups | Tool to retrieve all groups on a Miro board with cursor-based pagination. Use when you need to list all groups and their associated items on a board. |
| `MIRO_GET_APP_CARD_ITEM2` | Get App Card Item 2 | Tool to retrieve a specific app card item by its ID from a Miro board. Use when you need to get the details of an existing app card item. |
| `MIRO_GET_BOARD_ITEMS` | Get Board Items | Tool to list items on a Miro board (shapes, stickies, cards, etc.) with pagination. Use when you need to page through board elements for analytics or reporting. Re-fetch before bulk updates to avoid stale item IDs. |
| `MIRO_GET_BOARD_MEMBERS` | Get Board Members | Tool to retrieve a list of members for a board. Use when you need to list all users with access to a board after confirming its ID. Results are scoped to the authenticated user's permissions; members or boards inaccessible to that user will not appear in the response. |
| `MIRO_GET_BOARDS2` | Get Boards V2 | Tool to retrieve accessible boards with optional filters. Use when you need to list or search boards by team, project, owner, or keywords with full pagination support. |
| `MIRO_GET_CARD_ITEM` | Get Card Item | Tool to retrieve a specific card item from a Miro board. Use when you need to fetch details of an existing card item by its ID. |
| `MIRO_GET_CONNECTOR` | Get Connector | Tool to retrieve a specific connector by its ID. Use when you need details about an existing connector on a board. |
| `MIRO_GET_CONNECTORS` | Get Connectors | Tool to retrieve a list of connectors on a board. Use after confirming the board ID and when you need to page through connector items. |
| `MIRO_GET_DOCUMENT_ITEM` | Get Document Item | Tool to retrieve a specific document item from a Miro board by its ID. Use when you need to get details about an existing document item. |
| `MIRO_GET_EMBED_ITEM` | Get Embed Item | Tool to retrieve a specific embed item from a board by its ID. Use when you need details of an existing embedded content item. |
| `MIRO_GET_FRAME_ITEM` | Get Frame Item | Tool to retrieve a specific frame item from a Miro board. Use when you need to fetch details of an existing frame by its ID. |
| `MIRO_GET_GROUP_BY_ID` | Get Group By ID | Tool to retrieve a specific group by its ID. Use when you need to get details about a group on a Miro board. |
| `MIRO_GET_IMAGE_ITEM` | Get Image Item | Tool to retrieve a specific image item from a board. Use when you need to get details about an existing image item. |
| `MIRO_GET_ITEM_TAGS` | Get Item Tags | Tool to retrieve tags attached to a specific item on a Miro board. Use when you need to get the tags associated with a particular item. |
| `MIRO_GET_MINDMAP_NODE_EXPERIMENTAL` | Get Mind Map Node | Tool to retrieve a specific mind map node from a board. Use when you need to get details about a mind map node by its ID. |
| `MIRO_GET_MINDMAP_NODES_EXPERIMENTAL` | Get Mind Map Nodes (Experimental) | Tool to retrieve mind map nodes from a Miro board. Use when you need to access the structure and content of mind maps on a board. |
| `MIRO_GET_OEMBED` | Get oEmbed Data | Tool to retrieve oEmbed data for a Miro board. Use when you need to generate embeddable HTML code for a board or get board metadata in oEmbed format. |
| `MIRO_GET_SHAPE_ITEM` | Get Shape Item | Tool to retrieve a specific shape item from a Miro board by its ID. Use when you need to get details of an existing shape item. |
| `MIRO_GET_SPECIFIC_BOARD` | Get Specific Board | Tool to retrieve detailed information about a specific board by its ID. Use when you need to fetch complete metadata including team, permissions, owner, and modification details for a board. |
| `MIRO_GET_SPECIFIC_BOARD_MEMBER` | Get Specific Board Member | Tool to retrieve details of a specific board member. Use when you have a board ID and board member ID and need to get that member's role and information. |
| `MIRO_GET_SPECIFIC_ITEM` | Get Specific Item | Tool to retrieve a specific item from a Miro board by its ID. Use when you need details about a particular board item (sticky note, shape, card, frame, etc.). |
| `MIRO_GET_STICKY_NOTE_ITEM` | Get Sticky Note Item | Tool to retrieve a specific sticky note item from a board by its ID. Use when you need to get the details of an existing sticky note item. |
| `MIRO_GET_TAG` | Get Tag | Tool to retrieve details of a specific tag on a board. Use when you have a board ID and tag ID and need its metadata. |
| `MIRO_GET_TEXT_ITEM` | Get Text Item | Tool to retrieve a specific text item from a Miro board by its ID. Use when you need to get the details of an existing text item. |
| `MIRO_LIST_BOARD_TAGS` | List Board Tags | Tool to list all tags on a Miro board. Use when you need to discover tag IDs, titles, or colors before performing tag operations. |
| `MIRO_LIST_ORGANIZATIONS` | Get Organization Context | Retrieves the organization associated with the current access token. Note: Miro's API does not have an endpoint to list all organizations a user has access to. This action uses the /v1/oauth-token endpoint to return the single organization context associated with the authenticated token, along with team and user information. For Enterprise users who need to work with organizations, use organization-specific endpoints like MIRO_GET_ORGANIZATION_MEMBERS which require an org_id parameter. |
| `MIRO_SHARE_BOARD` | Share Board | Tool to share a board by inviting users via email. Use when you need to grant access to a board by sending email invitations to new members. You can invite up to 20 users per call and assign them roles (viewer, commenter, editor, coowner, or owner). |
| `MIRO_UPDATE_APP_CARD_ITEM2` | Update App Card Item 2 | Tool to update an app card item on a Miro board. Use when you need to modify properties of an existing app card such as title, description, status, style, position, or geometry. |
| `MIRO_UPDATE_BOARD` | Update Board | Tool to update properties of a specific board. Use when you have a board ID and need to modify its name, description, or permissions policy. Use after confirming the board exists. |
| `MIRO_UPDATE_BOARD_MEMBER` | Update Board Member | Tool to update the role of a specific board member. Use when you have a board ID and board member ID and need to change that member's permissions or role on the board. |
| `MIRO_UPDATE_CARD_ITEM` | Update Card Item | Tool to update a card item on a Miro board. Use when you need to modify properties of an existing card item such as title, description, due date, assignee, style, position, or geometry. |
| `MIRO_UPDATE_CONNECTOR` | Update Connector | Tool to update an existing connector on a Miro board. Use when you need to modify connector properties such as shape, style, captions, or endpoint attachments. Only provided fields will be updated. |
| `MIRO_UPDATE_DOCUMENT_ITEM` | Update Document Item | Tool to update a document item on a Miro board. Use when you need to modify properties of an existing document item such as URL, title, position, or geometry. |
| `MIRO_UPDATE_EMBED_ITEM` | Update Embed Item | Tool to update an embed item on a board. Use when you need to modify properties of an existing embedded content item such as position, display mode, or URL. |
| `MIRO_UPDATE_FRAME_ITEM` | Update Frame Item | Tool to update a frame item on a Miro board. Use when you need to modify properties of an existing frame such as title, position, size, or styling. Include only fields to change. |
| `MIRO_UPDATE_GROUP` | Update Group | Tool to update a group on a Miro board with new items. Use when you need to change which items belong to an existing group. |
| `MIRO_UPDATE_IMAGE_ITEM` | Update Image Item | Tool to update an existing image item on a board. Use when you need to modify properties of an existing image item such as title, URL, position, or geometry. |
| `MIRO_UPDATE_ITEM_POSITION_OR_PARENT` | Update Item Position or Parent | Tool to update an item's position or parent frame on a Miro board. Use when you need to move an item to a new location or assign it to a different parent frame. |
| `MIRO_UPDATE_SHAPE_ITEM` | Update Shape Item | Tool to update an existing shape item on a Miro board. Use when you need to modify properties of a shape such as content, style, position, geometry, or parent. Include only the fields you want to change. |
| `MIRO_UPDATE_STICKY_NOTE_ITEM` | Update Sticky Note Item | Tool to update a sticky note item on a Miro board. Use when you need to modify the content, style, position, geometry, or parent of an existing sticky note. |
| `MIRO_UPDATE_TAG` | Update Tag | Tool to update a tag on a board. Use when you need to modify a tag's title or color. At least one field (title or fillColor) should be provided to update. |
| `MIRO_UPDATE_TEXT_ITEM` | Update Text Item | Tool to update a text item on a Miro board. Use when you need to modify the content, style, position, or other properties of an existing text item. |

## Supported Triggers

None listed.

## Creating MCP Server - Stand-alone vs Composio SDK

The Miro MCP server is an implementation of the Model Context Protocol that connects your AI agent to Miro. It provides structured and secure access so your agent can perform Miro operations on your behalf through a secure, permission-based interface.
With Composio's managed implementation, you don't have to create your own developer app. For production, if you're building an end product, we recommend using your own credentials. The managed server helps you prototype fast and go from 0-1 faster.

## Step-by-step Guide

### 1. Prerequisites

Before starting, make sure you have:
- Python 3.9 or higher
- A Composio account with an active API key
- Basic familiarity with Python and async programming

### 1. Getting API Keys for OpenAI and Composio

OpenAI API Key
- Go to the [OpenAI dashboard](https://platform.openai.com/settings/organization/api-keys) and create an API key. You'll need credits to use the models, or you can connect to another model provider.
- Keep the API key safe.
Composio API Key
- Log in to the [Composio dashboard](https://dashboard.composio.dev?utm_source=toolkits&utm_medium=framework_docs).
- Navigate to your API settings and generate a new API key.
- Store this key securely as you'll need it for authentication.

### 2. Install dependencies

Install the required libraries.
What's happening:
- composio connects your agent to external SaaS tools like Miro
- pydantic-ai lets you create structured AI agents with tool support
- python-dotenv loads your environment variables securely from a .env file
```bash
pip install composio pydantic-ai python-dotenv
```

### 3. Set up environment variables

Create a .env file in your project root.
What's happening:
- COMPOSIO_API_KEY authenticates your agent to Composio's API
- USER_ID associates your session with your account for secure tool access
- OPENAI_API_KEY to access OpenAI LLMs
```bash
COMPOSIO_API_KEY=your_composio_api_key_here
USER_ID=your_user_id_here
OPENAI_API_KEY=your_openai_api_key
```

### 4. Import dependencies

What's happening:
- We load environment variables and import required modules
- Composio manages connections to Miro
- MCPServerStreamableHTTP connects to the Miro MCP server endpoint
- Agent from Pydantic AI lets you define and run the AI assistant
```python
import asyncio
import os
from dotenv import load_dotenv
from composio import Composio
from pydantic_ai import Agent
from pydantic_ai.mcp import MCPServerStreamableHTTP

load_dotenv()
```

### 5. Create a Tool Router Session

What's happening:
- We're creating a Tool Router session that gives your agent access to Miro tools
- The create method takes the user ID and specifies which toolkits should be available
- The returned session.mcp.url is the MCP server URL that your agent will use
```python
async def main():
    api_key = os.getenv("COMPOSIO_API_KEY")
    user_id = os.getenv("USER_ID")
    if not api_key or not user_id:
        raise RuntimeError("Set COMPOSIO_API_KEY and USER_ID in your environment")

    # Create a Composio Tool Router session for Miro
    composio = Composio(api_key=api_key)
    session = composio.create(
        user_id=user_id,
        toolkits=["miro"],
    )
    url = session.mcp.url
    if not url:
        raise ValueError("Composio session did not return an MCP URL")
```

### 6. Initialize the Pydantic AI Agent

What's happening:
- The MCP client connects to the Miro endpoint
- The agent uses GPT-5 to interpret user commands and perform Miro operations
- The instructions field defines the agent's role and behavior
```python
# Attach the MCP server to a Pydantic AI Agent
miro_mcp = MCPServerStreamableHTTP(url, headers={"x-api-key": COMPOSIO_API_KEY})
agent = Agent(
    "openai:gpt-5",
    toolsets=[miro_mcp],
    instructions=(
        "You are a Miro assistant. Use Miro tools to help users "
        "with their requests. Ask clarifying questions when needed."
    ),
)
```

### 7. Build the chat interface

What's happening:
- The agent reads input from the terminal and streams its response
- Miro API calls happen automatically under the hood
- The model keeps conversation history to maintain context across turns
```python
# Simple REPL with message history
history = []
print("Chat started! Type 'exit' or 'quit' to end.\n")
print("Try asking the agent to help you with Miro.\n")

while True:
    user_input = input("You: ").strip()
    if user_input.lower() in {"exit", "quit", "bye"}:
        print("\nGoodbye!")
        break
    if not user_input:
        continue

    print("\nAgent is thinking...\n", flush=True)

    async with agent.run_stream(user_input, message_history=history) as stream_result:
        collected_text = ""
        async for chunk in stream_result.stream_output():
            text_piece = None
            if isinstance(chunk, str):
                text_piece = chunk
            elif hasattr(chunk, "delta") and isinstance(chunk.delta, str):
                text_piece = chunk.delta
            elif hasattr(chunk, "text"):
                text_piece = chunk.text
            if text_piece:
                collected_text += text_piece
        result = stream_result

    print(f"Agent: {collected_text}\n")
    history = result.all_messages()
```

### 8. Run the application

What's happening:
- The asyncio loop launches the agent and keeps it running until you exit
```python
if __name__ == "__main__":
    asyncio.run(main())
```

## Complete Code

```python
import asyncio
import os
from dotenv import load_dotenv
from composio import Composio
from pydantic_ai import Agent
from pydantic_ai.mcp import MCPServerStreamableHTTP

load_dotenv()

async def main():
    api_key = os.getenv("COMPOSIO_API_KEY")
    user_id = os.getenv("USER_ID")
    if not api_key or not user_id:
        raise RuntimeError("Set COMPOSIO_API_KEY and USER_ID in your environment")

    # Create a Composio Tool Router session for Miro
    composio = Composio(api_key=api_key)
    session = composio.create(
        user_id=user_id,
        toolkits=["miro"],
    )
    url = session.mcp.url
    if not url:
        raise ValueError("Composio session did not return an MCP URL")

    # Attach the MCP server to a Pydantic AI Agent
    miro_mcp = MCPServerStreamableHTTP(url, headers={"x-api-key": COMPOSIO_API_KEY})
    agent = Agent(
        "openai:gpt-5",
        toolsets=[miro_mcp],
        instructions=(
            "You are a Miro assistant. Use Miro tools to help users "
            "with their requests. Ask clarifying questions when needed."
        ),
    )

    # Simple REPL with message history
    history = []
    print("Chat started! Type 'exit' or 'quit' to end.\n")
    print("Try asking the agent to help you with Miro.\n")

    while True:
        user_input = input("You: ").strip()
        if user_input.lower() in {"exit", "quit", "bye"}:
            print("\nGoodbye!")
            break
        if not user_input:
            continue

        print("\nAgent is thinking...\n", flush=True)

        async with agent.run_stream(user_input, message_history=history) as stream_result:
            collected_text = ""
            async for chunk in stream_result.stream_output():
                text_piece = None
                if isinstance(chunk, str):
                    text_piece = chunk
                elif hasattr(chunk, "delta") and isinstance(chunk.delta, str):
                    text_piece = chunk.delta
                elif hasattr(chunk, "text"):
                    text_piece = chunk.text
                if text_piece:
                    collected_text += text_piece
            result = stream_result

        print(f"Agent: {collected_text}\n")
        history = result.all_messages()

if __name__ == "__main__":
    asyncio.run(main())
```

## Conclusion

You've built a Pydantic AI agent that can interact with Miro through Composio's Tool Router. With this setup, your agent can perform real Miro actions through natural language.
You can extend this further by:
- Adding other toolkits like Gmail, HubSpot, or Salesforce
- Building a web-based chat interface around this agent
- Using multiple MCP endpoints to enable cross-app workflows (for example, Gmail + Miro for workflow automation)
This architecture makes your AI agent "agent-native", able to securely use APIs in a unified, composable way without custom integrations.

## How to build Miro MCP Agent with another framework

- [ChatGPT](https://composio.dev/toolkits/miro/framework/chatgpt)
- [OpenAI Agents SDK](https://composio.dev/toolkits/miro/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/miro/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/miro/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/miro/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/miro/framework/codex)
- [Cursor](https://composio.dev/toolkits/miro/framework/cursor)
- [VS Code](https://composio.dev/toolkits/miro/framework/vscode)
- [OpenCode](https://composio.dev/toolkits/miro/framework/opencode)
- [OpenClaw](https://composio.dev/toolkits/miro/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/miro/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/miro/framework/cli)
- [Google ADK](https://composio.dev/toolkits/miro/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/miro/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/miro/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/miro/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/miro/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/miro/framework/crew-ai)

## Related Toolkits

- [Figma](https://composio.dev/toolkits/figma) - Figma is a collaborative interface design tool for teams and individuals. It streamlines design workflows with real-time collaboration and easy sharing.
- [Abyssale](https://composio.dev/toolkits/abyssale) - Abyssale is a creative automation platform for generating images, videos, GIFs, PDFs, and HTML5 content programmatically. It streamlines and scales visual content production for marketing, design, and operations teams.
- [Alttext ai](https://composio.dev/toolkits/alttext_ai) - AltText.ai is a service that generates alt text for images automatically. It helps boost accessibility and SEO for your visual content.
- [Bannerbear](https://composio.dev/toolkits/bannerbear) - Bannerbear is an API-driven platform for generating images and videos automatically at scale. It helps businesses create custom graphics, social visuals, and marketing assets using powerful templates.
- [Canva](https://composio.dev/toolkits/canva) - Canva is a drag-and-drop design suite for creating professional graphics, presentations, and marketing materials. It makes it easy for anyone to design with beautiful templates and a vast library of elements.
- [Claid ai](https://composio.dev/toolkits/claid_ai) - Claid.ai delivers AI-driven image editing APIs for tasks like background removal, upscaling, and color correction. It helps automate and enhance image workflows with powerful, developer-friendly tools.
- [Cloudinary](https://composio.dev/toolkits/cloudinary) - Cloudinary is a cloud-based platform for managing, uploading, and transforming images and videos. It streamlines media workflows and delivers optimized assets globally.
- [Cults](https://composio.dev/toolkits/cults) - Cults is a digital marketplace for 3D printing models, connecting designers and makers. It lets creators share, sell, and discover a huge variety of printable designs easily.
- [DeepImage](https://composio.dev/toolkits/deepimage) - DeepImage is an AI-powered image enhancer and upscaler. Get higher-quality images with just a few clicks.
- [Dreamstudio](https://composio.dev/toolkits/dreamstudio) - DreamStudio is Stability AI’s platform for generating and editing images with AI. It lets you easily turn ideas into stunning visuals, fast.
- [Dynapictures](https://composio.dev/toolkits/dynapictures) - Dynapictures is a cloud-based platform for generating personalized images at scale. Instantly create hundreds of custom visuals using your data sources, like Google Sheets.
- [Fal.ai](https://composio.dev/toolkits/fal_ai) - Fal.ai is a generative media platform offering 600+ AI models for images, video, voice, and audio. Developers use Fal.ai for fast, scalable access to cutting-edge generative AI tools.
- [Gamma](https://composio.dev/toolkits/gamma) - Gamma is an AI-powered platform for making beautiful, interactive presentations and documents. It lets anyone create and share engaging decks with minimal effort.
- [Html to image](https://composio.dev/toolkits/html_to_image) - Html to image converts HTML and CSS into images or captures web page screenshots. Instantly generate visuals from code or web content—no manual screenshots needed.
- [Imagior](https://composio.dev/toolkits/imagior) - Imagior is an AI-powered image generation platform that lets you create and customize images using dynamic templates and APIs. Perfect for businesses and creators needing fast, scalable visuals without design hassle.
- [Imejis io](https://composio.dev/toolkits/imejis_io) - Imejis io is an API-based image generation platform with powerful customization and template support. It lets you create and modify images in seconds, no manual design work required.
- [Imgix](https://composio.dev/toolkits/imgix) - Imgix is a real-time image processing and delivery service for developers. It helps you optimize, transform, and deliver images efficiently at any scale.
- [Kraken io](https://composio.dev/toolkits/kraken_io) - Kraken.io is an image optimization and compression platform. It helps you shrink image file sizes while keeping visual quality intact.
- [Logo dev](https://composio.dev/toolkits/logo_dev) - Logo.dev is an API and database for high-resolution company logos and brand metadata. Instantly fetch official logos from any domain without scraping or manual searching.
- [Mural](https://composio.dev/toolkits/mural) - Mural is a digital whiteboard platform for distributed visual collaboration. It helps teams brainstorm, map ideas, and diagram together in real time.

## Frequently Asked Questions

### What are the differences in Tool Router MCP and Miro MCP?

With a standalone Miro MCP server, the agents and LLMs can only access a fixed set of Miro tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from Miro and many other apps based on the task at hand, all through a single MCP endpoint.

### Can I use Tool Router MCP with Pydantic AI?

Yes, you can. Pydantic AI fully supports MCP integration. You get structured tool calling, message history handling, and model orchestration while Tool Router takes care of discovering and serving the right Miro tools.

### Can I manage the permissions and scopes for Miro while using Tool Router?

Yes, absolutely. You can configure which Miro scopes and actions are allowed when connecting your account to Composio. You can also bring your own OAuth credentials or API configuration so you keep full control over what the agent can do.

### How safe is my data with Composio Tool Router?

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Miro data and credentials are handled as safely as possible.

---
[See all toolkits](https://composio.dev/toolkits) · [Composio docs](https://docs.composio.dev/llms.txt)
