# How to integrate Postmark MCP with OpenAI Agents SDK

```json
{
  "title": "How to integrate Postmark MCP with OpenAI Agents SDK",
  "toolkit": "Postmark",
  "toolkit_slug": "postmark",
  "framework": "OpenAI Agents SDK",
  "framework_slug": "open-ai-agents-sdk",
  "url": "https://composio.dev/toolkits/postmark/framework/open-ai-agents-sdk",
  "markdown_url": "https://composio.dev/toolkits/postmark/framework/open-ai-agents-sdk.md",
  "updated_at": "2026-05-12T10:22:34.992Z"
}
```

## Introduction

This guide walks you through connecting Postmark to the OpenAI Agents SDK using the Composio tool router. By the end, you'll have a working Postmark agent that can send a password reset email to user, get delivery status for last 10 emails, list all bounced emails from today through natural language commands.
This guide will help you understand how to give your OpenAI Agents SDK agent real control over a Postmark account through Composio's Postmark MCP server.
Before we dive in, let's take a quick look at the key ideas and tools involved.

## Also integrate Postmark with

- [Claude Agent SDK](https://composio.dev/toolkits/postmark/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/postmark/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/postmark/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/postmark/framework/codex)
- [OpenClaw](https://composio.dev/toolkits/postmark/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/postmark/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/postmark/framework/cli)
- [Google ADK](https://composio.dev/toolkits/postmark/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/postmark/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/postmark/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/postmark/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/postmark/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/postmark/framework/crew-ai)

## TL;DR

Here's what you'll learn:
- Get and set up your OpenAI and Composio API keys
- Install the necessary dependencies
- Initialize Composio and create a Tool Router session for Postmark
- Configure an AI agent that can use Postmark as a tool
- Run a live chat session where you can ask the agent to perform Postmark operations

## What is OpenAI Agents SDK?

The OpenAI Agents SDK is a lightweight framework for building AI agents that can use tools and maintain conversation state. It provides a simple interface for creating agents with hosted MCP tool support.
Key features include:
- Hosted MCP Tools: Connect to external services through hosted MCP endpoints
- SQLite Sessions: Persist conversation history across interactions
- Simple API: Clean interface with Agent, Runner, and tool configuration
- Streaming Support: Real-time response streaming for interactive applications

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

The Postmark MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Postmark account. It provides structured and secure access to transactional email sending and analytics, so your agent can perform actions like delivering transactional emails, monitoring delivery status, managing templates, and analyzing engagement metrics on your behalf.
- Automated transactional email delivery: Let your agent send password resets, confirmations, and notification emails with high deliverability and reliability.
- Template management and customization: Enable your agent to create, update, or select dynamic email templates for consistent, branded communications.
- Email delivery status monitoring: Ask your agent to track sent messages, check delivery receipts, and identify bounced or failed emails in real time.
- Engagement and analytics tracking: Have your agent retrieve open and click data, analyze engagement trends, and provide actionable insights from your email campaigns.
- Suppression list and recipient management: Direct your agent to manage suppression lists, process unsubscribes, and maintain healthy recipient lists automatically.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `POSTMARK_ARCHIVE_MESSAGE_STREAM` | Archive Message Stream | Tool to archive a message stream (soft delete). Use when you need to remove a message stream that will be permanently deleted after 45 days. |
| `POSTMARK_CHECK_SPAM_SCORE` | Check Spam Score | Tool to assess the spam score of a raw email via the SpamCheck API. Use when you have full email source and need spam scoring before sending. Returns spam score and detailed report. |
| `POSTMARK_CREATE_INBOUND_RULE` | Create Inbound Rule | Tool to create a new inbound rule trigger to block email from a specific sender or domain. Use when you need to prevent emails from specific addresses or domains from being processed. |
| `POSTMARK_CREATE_MESSAGE_STREAM` | Create Message Stream | Tool to create a new message stream. Use when you need to set up separate streams for transactional or broadcast emails. |
| `POSTMARK_CREATE_SUPPRESSIONS` | Create Suppressions | Tool to add email addresses to the suppression list for a message stream. Use when you need to prevent emails from being sent to specific addresses. |
| `POSTMARK_CREATE_TEMPLATE` | Create Template | Tool to create a new email template. Use when you need reusable templates before sending emails. |
| `POSTMARK_CREATE_WEBHOOK` | Create Webhook | Tool to create a new webhook configuration for Postmark. Use when you need to set up a webhook to receive event notifications for email tracking (opens, clicks, bounces, deliveries, etc.). |
| `POSTMARK_DELETE_INBOUND_RULE` | Delete Inbound Rule | Tool to delete a specific inbound rule trigger. Use when you need to remove an inbound rule by its ID after confirming it's no longer needed. |
| `POSTMARK_DELETE_SUPPRESSIONS` | Delete Suppressions | Tool to remove email addresses from the suppression list for a message stream. Use when you need to reactivate previously suppressed email addresses. Note that only HardBounce and ManualSuppression types can be deleted; SpamComplaint suppressions cannot be removed. |
| `POSTMARK_DELETE_TEMPLATE` | Delete Template | Tool to delete a template by its ID or alias. Use when you need to permanently remove a template after confirming it's no longer needed. |
| `POSTMARK_DELETE_WEBHOOK` | Delete Webhook | Tool to delete a specific webhook. Use when you need to remove a webhook by its ID after confirming it's no longer needed. |
| `POSTMARK_EDIT_SERVER` | Edit Server | Tool to update settings for the current Postmark server. Use when you need to modify server configuration. |
| `POSTMARK_EDIT_TEMPLATE` | Edit Template | Tool to update an existing Postmark template by its ID. Use when you need to modify a template's name, subject, HTML or text body, alias, type, layout, or active status. |
| `POSTMARK_EDIT_WEBHOOK` | Edit Webhook | Tool to update an existing webhook’s URL or triggers. Use when you need to modify webhook settings after confirming the webhookID. |
| `POSTMARK_GET_BOUNCE_COUNTS` | Get Bounce Counts | Tool to get total counts of emails that have been returned as bounced. Use when you need aggregate bounce statistics and per-day breakdown by bounce type (hard bounce, soft bounce, transient, SMTP API errors). |
| `POSTMARK_GET_BOUNCES` | Get Bounces | Tool to retrieve a list of bounces for a server with optional filters. Use when you need to page through bounce data after applying filters. |
| `POSTMARK_GET_BROWSER_PLATFORM_USAGE` | Get Browser Platform Usage | Tool to retrieve browser platform usage statistics for clicked links. Use after sending outbound emails with tracked links to analyze engagement by browser. |
| `POSTMARK_GET_BROWSER_USAGE` | Get Browser Usage | Tool to retrieve browser usage statistics for clicked links. Use after sending tracked outbound emails to analyze which browsers and platforms were used to click links. |
| `POSTMARK_GET_CLICK_COUNTS` | Get Click Counts | Tool to retrieve total click counts across all links in emails. Use when you need aggregated click metrics for a given date range. |
| `POSTMARK_GET_CLICKS_BY_BROWSER_FAMILY` | Get Clicks By Browser Family | Tool to retrieve click statistics grouped by browser family. Use after sending outbound emails with tracked links to analyze which browser families recipients used to click links. Requires link tracking to be enabled for emails. |
| `POSTMARK_GET_CLICKS_BY_LOCATION` | Get Clicks by Location | Tool to get an overview of which part of the email links were clicked from (HTML or Text). Use when you need to analyze click patterns by content type. |
| `POSTMARK_GET_DELIVERY_STATS` | Get Delivery Stats | Tool to retrieve delivery statistics. Use after sending emails to get aggregated counts of deliveries, bounces, and spam complaints. |
| `POSTMARK_GET_EMAIL_CLIENT_USAGE` | Get Email Client Usage | Tool to retrieve statistics on email clients used to open emails. Use when you need to analyze which clients recipients open your outbound emails. |
| `POSTMARK_GET_EMAIL_OPEN_COUNTS` | Get Email Open Counts | Tool to retrieve counts of opened emails. Use when you need per-day and total open stats for a specified period. |
| `POSTMARK_GET_MESSAGE_STREAM` | Get Message Stream | Tool to retrieve details of a specific message stream by its ID. Use when you need to inspect stream configuration such as type, description, or subscription settings. |
| `POSTMARK_GET_OPENS_BY_PLATFORM` | Get Opens by Platform | Tool to retrieve email open statistics by platform type. Use when you need to understand which platforms recipients use to open emails. |
| `POSTMARK_GET_OUTBOUND_OVERVIEW` | Get Outbound Overview | Tool to retrieve outbound email statistics overview. Use when you need aggregated outbound metrics after sending emails. |
| `POSTMARK_GET_SENT_COUNTS` | Get Sent Counts | Tool to retrieve total count of emails sent out. Use when you need per-day and total sent statistics for a specified period. |
| `POSTMARK_GET_SERVER` | Get Server | Tool to retrieve details of the current Postmark server. Use when you need to inspect server configuration (webhooks, tracking, tokens, etc.) before other operations. |
| `POSTMARK_GET_SPAM_COMPLAINTS` | Get Spam Complaints | Tool to retrieve counts of spam complaints. Use when analyzing spam feedback trends after sending campaigns. |
| `POSTMARK_GET_TEMPLATE` | Get Template | Tool to retrieve details of a specific template by its ID. Use after obtaining a template ID to inspect its configuration. |
| `POSTMARK_GET_TRACKED_EMAIL_COUNTS` | Get Tracked Email Counts | Tool to retrieve counts of emails with tracking enabled. Use after specifying a date range to analyze open and click metrics. |
| `POSTMARK_GET_WEBHOOK` | Get Webhook | Tool to retrieve details of a specific webhook by its ID. Use when you need to inspect webhook configuration including URL, triggers, and message stream settings. |
| `POSTMARK_LIST_INBOUND_RULES` | List Inbound Rules | Tool to list all inbound rules (triggers) configured for blocking senders. Use when you need to retrieve configured inbound rules with pagination support. |
| `POSTMARK_LIST_MESSAGE_STREAMS` | List Message Streams | Tool to list all message streams for a Postmark server with optional type and archive filtering. Use when you need to retrieve available message streams. A server may have up to 10 streams including defaults. |
| `POSTMARK_LIST_OUTBOUND_MESSAGE_CLICKS` | List Outbound Message Clicks | Tool to list clicks for outbound messages with filtering options. Use when you need to retrieve click events with pagination and optional filters like recipient, tag, client, OS, platform, or geographic location. |
| `POSTMARK_LIST_OUTBOUND_MESSAGE_OPENS` | List Outbound Message Opens | Tool to retrieve opens for outbound messages with filtering options. Use when you need to analyze email open events with detailed client, OS, and geographic data. |
| `POSTMARK_LIST_SUPPRESSIONS` | List Suppressions | Tool to retrieve the suppression list for a message stream with optional filtering. Use when you need to view all suppressed email addresses for a stream. |
| `POSTMARK_LIST_TEMPLATES` | List Templates | Tool to list all templates for a Postmark server. Use when you need to retrieve available templates with optional pagination and filters. |
| `POSTMARK_LIST_WEBHOOKS` | List Webhooks | Tool to list all webhooks configured for your Postmark account. Use after authenticating your server token to retrieve current webhook configurations. |
| `POSTMARK_SEARCH_INBOUND_MESSAGES` | Search Inbound Messages | Tool to search inbound messages received with optional filtering. Use when you need to retrieve inbound emails with pagination and various filters. |
| `POSTMARK_SEARCH_OUTBOUND_MESSAGES` | Search Outbound Messages | Tool to search outbound messages with filtering by recipient, tag, status, and date range. Use when you need to query sent messages with specific filters or pagination. |
| `POSTMARK_SEND_BATCH_WITH_TEMPLATES` | Send Batch Templated Emails | Tool to send multiple templated emails in a single batch API call. Use when you need to send up to 500 templated messages at once. |
| `POSTMARK_UNARCHIVE_MESSAGE_STREAM` | Unarchive Message Stream | Tool to unarchive a previously archived message stream. Use when you need to restore an archived stream (within 45 days of archiving). |
| `POSTMARK_UPDATE_MESSAGE_STREAM` | Update Message Stream | Tool to update a message stream configuration in Postmark. Use when you need to modify a stream's name or description. Note that stream type and ID cannot be changed after creation. |
| `POSTMARK_VALIDATE_TEMPLATE` | Validate Template | Tool to validate a Postmark template. Use when checking that a template's subject and body render correctly against sample data. |

## Supported Triggers

None listed.

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

The Postmark MCP server is an implementation of the Model Context Protocol that connects your AI agent to Postmark. It provides structured and secure access so your agent can perform Postmark 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:
- Composio API Key and OpenAI API Key
- Primary know-how of OpenAI Agents SDK
- A live Postmark project
- Some knowledge of Python or Typescript

### 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).
- Go to Settings and copy your API key.

### 2. Install dependencies

Install the Composio SDK and the OpenAI Agents SDK.
```python
pip install composio_openai_agents openai-agents python-dotenv
```

```typescript
npm install @composio/openai-agents @openai/agents dotenv
```

### 3. Set up environment variables

Create a .env file and add your OpenAI and Composio API keys.
```bash
OPENAI_API_KEY=sk-...your-api-key
COMPOSIO_API_KEY=your-api-key
USER_ID=composio_user@gmail.com
```

### 4. Import dependencies

What's happening:
- You're importing all necessary libraries.
- The Composio and OpenAIAgentsProvider classes are imported to connect your OpenAI agent to Composio tools like Postmark.
```python
import asyncio
import os
from dotenv import load_dotenv

from composio import Composio
from composio_openai_agents import OpenAIAgentsProvider
from agents import Agent, Runner, HostedMCPTool, SQLiteSession
```

```typescript
import 'dotenv/config';
import { Composio } from '@composio/core';
import { OpenAIAgentsProvider } from '@composio/openai-agents';
import { Agent, hostedMcpTool, run, OpenAIConversationsSession } from '@openai/agents';
import * as readline from 'readline';
```

### 5. Set up the Composio instance

No description provided.
```python
load_dotenv()

api_key = os.getenv("COMPOSIO_API_KEY")
user_id = os.getenv("USER_ID")

if not api_key:
    raise RuntimeError("COMPOSIO_API_KEY is not set. Create a .env file with COMPOSIO_API_KEY=your_key")

# Initialize Composio
composio = Composio(api_key=api_key, provider=OpenAIAgentsProvider())
```

```typescript
dotenv.config();

const composioApiKey = process.env.COMPOSIO_API_KEY;
const userId = process.env.USER_ID;

if (!composioApiKey) {
  throw new Error('COMPOSIO_API_KEY is not set. Create a .env file with COMPOSIO_API_KEY=your_key');
}
if (!userId) {
  throw new Error('USER_ID is not set');
}

// Initialize Composio
const composio = new Composio({
  apiKey: composioApiKey,
  provider: new OpenAIAgentsProvider(),
});
```

### 6. Create a Tool Router session

What is happening:
- You give the Tool Router the user id and the toolkits you want available. Here, it is only postmark.
- The router checks the user's Postmark connection and prepares the MCP endpoint.
- The returned session.mcp.url is the MCP URL that your agent will use to access Postmark.
- This approach keeps things lightweight and lets the agent request Postmark tools only when needed during the conversation.
```python
# Create a Postmark Tool Router session
session = composio.create(
    user_id=user_id,
    toolkits=["postmark"]
)

mcp_url = session.mcp.url
```

```typescript
// Create Tool Router session for Postmark
const session = await composio.create(userId as string, {
  toolkits: ['postmark'],
});
const mcpUrl = session.mcp.url;
```

### 7. Configure the agent

No description provided.
```python
# Configure agent with MCP tool
agent = Agent(
    name="Assistant",
    model="gpt-5",
    instructions=(
        "You are a helpful assistant that can access Postmark. "
        "Help users perform Postmark operations through natural language."
    ),
    tools=[
        HostedMCPTool(
            tool_config={
                "type": "mcp",
                "server_label": "tool_router",
                "server_url": mcp_url,
                "headers": {"x-api-key": api_key},
                "require_approval": "never",
            }
        )
    ],
)
```

```typescript
// Configure agent with MCP tool
const agent = new Agent({
  name: 'Assistant',
  model: 'gpt-5',
  instructions:
    'You are a helpful assistant that can access Postmark. Help users perform Postmark operations through natural language.',
  tools: [
    hostedMcpTool({
      serverLabel: 'tool_router',
      serverUrl: mcpUrl,
      headers: { 'x-api-key': composioApiKey },
      requireApproval: 'never',
    }),
  ],
});
```

### 8. Start chat loop and handle conversation

No description provided.
```python
print("\nComposio Tool Router session created.")

chat_session = SQLiteSession("conversation_openai_toolrouter")

print("\nChat started. Type your requests below.")
print("Commands: 'exit', 'quit', or 'q' to end\n")

async def main():
    try:
        result = await Runner.run(
            agent,
            "What can you help me with?",
            session=chat_session
        )
        print(f"Assistant: {result.final_output}\n")
    except Exception as e:
        print(f"Error: {e}\n")

    while True:
        user_input = input("You: ").strip()
        if user_input.lower() in {"exit", "quit", "q"}:
            print("Goodbye!")
            break

        result = await Runner.run(
            agent,
            user_input,
            session=chat_session
        )
        print(f"Assistant: {result.final_output}\n")

asyncio.run(main())
```

```typescript
// Keep conversation state across turns
const conversationSession = new OpenAIConversationsSession();

// Simple CLI
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  prompt: 'You: ',
});

console.log('\nComposio Tool Router session created.');
console.log('\nChat started. Type your requests below.');
console.log("Commands: 'exit', 'quit', or 'q' to end\n");

try {
  const first = await run(agent, 'What can you help me with?', { session: conversationSession });
  console.log(`Assistant: ${first.finalOutput}\n`);
} catch (e) {
  console.error('Error:', e instanceof Error ? e.message : e, '\n');
}

rl.prompt();

rl.on('line', async (userInput) => {
  const text = userInput.trim();

  if (['exit', 'quit', 'q'].includes(text.toLowerCase())) {
    console.log('Goodbye!');
    rl.close();
    process.exit(0);
  }

  if (!text) {
    rl.prompt();
    return;
  }

  try {
    const result = await run(agent, text, { session: conversationSession });
    console.log(`\nAssistant: ${result.finalOutput}\n`);
  } catch (e) {
    console.error('Error:', e instanceof Error ? e.message : e, '\n');
  }

  rl.prompt();
});

rl.on('close', () => {
  console.log('\n👋 Session ended.');
  process.exit(0);
});
```

## Complete Code

```python
import asyncio
import os
from dotenv import load_dotenv

from composio import Composio
from composio_openai_agents import OpenAIAgentsProvider
from agents import Agent, Runner, HostedMCPTool, SQLiteSession

load_dotenv()

api_key = os.getenv("COMPOSIO_API_KEY")
user_id = os.getenv("USER_ID")

if not api_key:
    raise RuntimeError("COMPOSIO_API_KEY is not set. Create a .env file with COMPOSIO_API_KEY=your_key")

# Initialize Composio
composio = Composio(api_key=api_key, provider=OpenAIAgentsProvider())

# Create Tool Router session
session = composio.create(
    user_id=user_id,
    toolkits=["postmark"]
)
mcp_url = session.mcp.url

# Configure agent with MCP tool
agent = Agent(
    name="Assistant",
    model="gpt-5",
    instructions=(
        "You are a helpful assistant that can access Postmark. "
        "Help users perform Postmark operations through natural language."
    ),
    tools=[
        HostedMCPTool(
            tool_config={
                "type": "mcp",
                "server_label": "tool_router",
                "server_url": mcp_url,
                "headers": {"x-api-key": api_key},
                "require_approval": "never",
            }
        )
    ],
)

print("\nComposio Tool Router session created.")

chat_session = SQLiteSession("conversation_openai_toolrouter")

print("\nChat started. Type your requests below.")
print("Commands: 'exit', 'quit', or 'q' to end\n")

async def main():
    try:
        result = await Runner.run(
            agent,
            "What can you help me with?",
            session=chat_session
        )
        print(f"Assistant: {result.final_output}\n")
    except Exception as e:
        print(f"Error: {e}\n")

    while True:
        user_input = input("You: ").strip()
        if user_input.lower() in {"exit", "quit", "q"}:
            print("Goodbye!")
            break

        result = await Runner.run(
            agent,
            user_input,
            session=chat_session
        )
        print(f"Assistant: {result.final_output}\n")

asyncio.run(main())
```

```typescript
import 'dotenv/config';
import { Composio } from '@composio/core';
import { OpenAIAgentsProvider } from '@composio/openai-agents';
import { Agent, hostedMcpTool, run, OpenAIConversationsSession } from '@openai/agents';
import * as readline from 'readline';

const composioApiKey = process.env.COMPOSIO_API_KEY;
const userId = process.env.USER_ID;

if (!composioApiKey) {
  throw new Error('COMPOSIO_API_KEY is not set. Create a .env file with COMPOSIO_API_KEY=your_key');
}
if (!userId) {
  throw new Error('USER_ID is not set');
}

// Initialize Composio
const composio = new Composio({
  apiKey: composioApiKey,
  provider: new OpenAIAgentsProvider(),
});

async function main() {
  // Create Tool Router session
  const session = await composio.create(userId as string, {
    toolkits: ['postmark'],
  });
  const mcpUrl = session.mcp.url;

  // Configure agent with MCP tool
  const agent = new Agent({
    name: 'Assistant',
    model: 'gpt-5',
    instructions:
      'You are a helpful assistant that can access Postmark. Help users perform Postmark operations through natural language.',
    tools: [
      hostedMcpTool({
        serverLabel: 'tool_router',
        serverUrl: mcpUrl,
        headers: { 'x-api-key': composioApiKey },
        requireApproval: 'never',
      }),
    ],
  });

  // Keep conversation state across turns
  const conversationSession = new OpenAIConversationsSession();

  // Simple CLI
  const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    prompt: 'You: ',
  });

  console.log('\nComposio Tool Router session created.');
  console.log('\nChat started. Type your requests below.');
  console.log("Commands: 'exit', 'quit', or 'q' to end\n");

  try {
    const first = await run(agent, 'What can you help me with?', { session: conversationSession });
    console.log(`Assistant: ${first.finalOutput}\n`);
  } catch (e) {
    console.error('Error:', e instanceof Error ? e.message : e, '\n');
  }

  rl.prompt();

  rl.on('line', async (userInput) => {
    const text = userInput.trim();

    if (['exit', 'quit', 'q'].includes(text.toLowerCase())) {
      console.log('Goodbye!');
      rl.close();
      process.exit(0);
    }

    if (!text) {
      rl.prompt();
      return;
    }

    try {
      const result = await run(agent, text, { session: conversationSession });
      console.log(`\nAssistant: ${result.finalOutput}\n`);
    } catch (e) {
      console.error('Error:', e instanceof Error ? e.message : e, '\n');
    }

    rl.prompt();
  });

  rl.on('close', () => {
    console.log('\nSession ended.');
    process.exit(0);
  });
}

main().catch((err) => {
  console.error('Fatal error:', err);
  process.exit(1);
});
```

## Conclusion

This was a starter code for integrating Postmark MCP with OpenAI Agents SDK to build a functional AI agent that can interact with Postmark.
Key features:
- Hosted MCP tool integration through Composio's Tool Router
- SQLite session persistence for conversation history
- Simple async chat loop for interactive testing
You can extend this by adding more toolkits, implementing custom business logic, or building a web interface around the agent.

## How to build Postmark MCP Agent with another framework

- [Claude Agent SDK](https://composio.dev/toolkits/postmark/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/postmark/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/postmark/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/postmark/framework/codex)
- [OpenClaw](https://composio.dev/toolkits/postmark/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/postmark/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/postmark/framework/cli)
- [Google ADK](https://composio.dev/toolkits/postmark/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/postmark/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/postmark/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/postmark/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/postmark/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/postmark/framework/crew-ai)

## Related Toolkits

- [Supabase](https://composio.dev/toolkits/supabase) - Supabase is an open-source backend platform offering scalable Postgres databases, authentication, storage, and real-time APIs. It lets developers build modern apps without managing infrastructure.
- [Codeinterpreter](https://composio.dev/toolkits/codeinterpreter) - Codeinterpreter is a Python-based coding environment with built-in data analysis and visualization. It lets you instantly run scripts, plot results, and prototype solutions inside supported platforms.
- [GitHub](https://composio.dev/toolkits/github) - GitHub is a code hosting platform for version control and collaborative software development. It streamlines project management, code review, and team workflows in one place.
- [Ably](https://composio.dev/toolkits/ably) - Ably is a real-time messaging platform for live chat and data sync in modern apps. It offers global scale and rock-solid reliability for seamless, instant experiences.
- [Abuselpdb](https://composio.dev/toolkits/abuselpdb) - Abuselpdb is a central database for reporting and checking IPs linked to malicious online activity. Use it to quickly identify and report suspicious or abusive IP addresses.
- [Alchemy](https://composio.dev/toolkits/alchemy) - Alchemy is a blockchain development platform offering APIs and tools for Ethereum apps. It simplifies building and scaling Web3 projects with robust infrastructure.
- [Algolia](https://composio.dev/toolkits/algolia) - Algolia is a hosted search API that powers lightning-fast, relevant search experiences for web and mobile apps. It helps developers deliver instant, typo-tolerant, and scalable search without complex infrastructure.
- [Anchor browser](https://composio.dev/toolkits/anchor_browser) - Anchor browser is a developer platform for AI-powered web automation. It transforms complex browser actions into easy API endpoints for streamlined web interaction.
- [Apiflash](https://composio.dev/toolkits/apiflash) - Apiflash is a website screenshot API for programmatically capturing web pages. It delivers high-quality screenshots on demand for automation, monitoring, or reporting.
- [Apiverve](https://composio.dev/toolkits/apiverve) - Apiverve delivers a suite of powerful APIs that simplify integration for developers. It's designed for reliability and scalability so you can build faster, smarter applications without the integration headache.
- [Appcircle](https://composio.dev/toolkits/appcircle) - Appcircle is an enterprise-grade mobile CI/CD platform for building, testing, and publishing mobile apps. It streamlines mobile DevOps so teams ship faster and with more confidence.
- [Appdrag](https://composio.dev/toolkits/appdrag) - Appdrag is a cloud platform for building websites, APIs, and databases with drag-and-drop tools and code editing. It accelerates development and iteration by combining hosting, database management, and low-code features in one place.
- [Appveyor](https://composio.dev/toolkits/appveyor) - AppVeyor is a cloud-based continuous integration service for building, testing, and deploying applications. It helps developers automate and streamline their software delivery pipelines.
- [Backendless](https://composio.dev/toolkits/backendless) - Backendless is a backend-as-a-service platform for mobile and web apps, offering database, file storage, user authentication, and APIs. It helps developers ship scalable applications faster without managing server infrastructure.
- [Baserow](https://composio.dev/toolkits/baserow) - Baserow is an open-source no-code database platform for building collaborative data apps. It makes it easy for teams to organize data and automate workflows without writing code.
- [Bench](https://composio.dev/toolkits/bench) - Bench is a benchmarking tool for automated performance measurement and analysis. It helps you quickly evaluate, compare, and track your systems or workflows.
- [Better stack](https://composio.dev/toolkits/better_stack) - Better Stack is a monitoring, logging, and incident management solution for apps and services. It helps teams ensure application reliability and performance with real-time insights.
- [Bitbucket](https://composio.dev/toolkits/bitbucket) - Bitbucket is a Git-based code hosting and collaboration platform for teams. It enables secure repository management and streamlined code reviews.
- [Blazemeter](https://composio.dev/toolkits/blazemeter) - Blazemeter is a continuous testing platform for web and mobile app performance. It empowers teams to automate and analyze large-scale tests with ease.
- [Blocknative](https://composio.dev/toolkits/blocknative) - Blocknative delivers real-time mempool monitoring and transaction management for public blockchains. Instantly track pending transactions and optimize blockchain interactions with live data.

## Frequently Asked Questions

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

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

### Can I use Tool Router MCP with OpenAI Agents SDK?

Yes, you can. OpenAI Agents SDK 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 Postmark tools.

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

Yes, absolutely. You can configure which Postmark 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 Postmark data and credentials are handled as safely as possible.

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