# How to integrate Hookdeck MCP with Vercel AI SDK v6

```json
{
  "title": "How to integrate Hookdeck MCP with Vercel AI SDK v6",
  "toolkit": "Hookdeck",
  "toolkit_slug": "hookdeck",
  "framework": "Vercel AI SDK",
  "framework_slug": "ai-sdk",
  "url": "https://composio.dev/toolkits/hookdeck/framework/ai-sdk",
  "markdown_url": "https://composio.dev/toolkits/hookdeck/framework/ai-sdk.md",
  "updated_at": "2026-05-12T10:15:06.328Z"
}
```

## Introduction

This guide walks you through connecting Hookdeck to Vercel AI SDK v6 using the Composio tool router. By the end, you'll have a working Hookdeck agent that can retry all failed webhook events from today, create a new source for github webhooks, bookmark this event for quick review later through natural language commands.
This guide will help you understand how to give your Vercel AI SDK agent real control over a Hookdeck account through Composio's Hookdeck MCP server.
Before we dive in, let's take a quick look at the key ideas and tools involved.

## Also integrate Hookdeck with

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

## TL;DR

Here's what you'll learn:
- How to set up and configure a Vercel AI SDK agent with Hookdeck integration
- Using Composio's Tool Router to dynamically load and access Hookdeck tools
- Creating an MCP client connection using HTTP transport
- Building an interactive CLI chat interface with conversation history management
- Handling tool calls and results within the Vercel AI SDK framework

## What is Vercel AI SDK?

The Vercel AI SDK is a TypeScript library for building AI-powered applications. It provides tools for creating agents that can use external services and maintain conversation state.
Key features include:
- streamText: Core function for streaming responses with real-time tool support
- MCP Client: Built-in support for Model Context Protocol via @ai-sdk/mcp
- Step Counting: Control multi-step tool execution with stopWhen: stepCountIs()
- OpenAI Provider: Native integration with OpenAI models

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

The Hookdeck MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Hookdeck account. It provides structured and secure access to your webhook management platform, so your agent can perform actions like routing webhooks, managing events, configuring sources and destinations, and automating retries or cancellations on your behalf.
- Automated event management: Let your agent bulk cancel or retry multiple webhook events, keeping your pipeline clean and efficient without manual intervention.
- Source and destination setup: Have the agent create, configure, and manage Hookdeck sources and destinations for seamless webhook routing between services.
- Connection orchestration: Direct your agent to establish new connections between sources and destinations, ensuring events flow exactly where you want them to go.
- Payload transformation: Empower the agent to create custom payload transformations using JavaScript, modifying webhook data before it reaches your endpoints.
- Bookmarking and cleanup: Ask your agent to bookmark important events for quick access or delete outdated bookmarks to keep your workspace organized.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `HOOKDECK_ADD_CUSTOM_DOMAIN` | Add Custom Domain | Tool to add a custom domain to the Hookdeck project. Use when you need to configure a custom hostname for receiving webhooks. |
| `HOOKDECK_BULK_CANCEL_EVENTS` | Bulk Cancel Hookdeck Events | Tool to create a bulk cancellation job for events. Use when you need to cancel multiple events matching filters. |
| `HOOKDECK_BULK_RETRY_EVENTS` | Bulk Retry Hookdeck Events | Initiate a bulk retry for multiple events matching the specified filters. Use this to retry failed webhook deliveries in bulk instead of one at a time. The query must include at least one filter - common usage is to filter by status='FAILED'. The operation runs asynchronously and returns immediately with progress tracking info. |
| `HOOKDECK_CANCEL_EVENT` | Cancel Hookdeck Event | Cancel all future delivery attempts for a Hookdeck event. Use this to stop scheduled retries when you need to prevent further delivery attempts (e.g., due to known issues with the destination or invalid payload). Note: Events already in SUCCESSFUL or FAILED status cannot be cancelled but the API will return the event unchanged. |
| `HOOKDECK_CANCEL_EVENT_BULK_RETRY` | Cancel Event Bulk Retry | Tool to cancel an ongoing events bulk retry operation. Use when you need to stop a bulk retry that is currently in progress (e.g., if you realize the retry conditions were incorrect or the issue needs to be addressed before retrying). |
| `HOOKDECK_CANCEL_REQUEST_BULK_RETRY` | Cancel Request Bulk Retry | Tool to cancel an in-progress requests bulk retry operation. Use when you need to stop a bulk retry that is currently running. |
| `HOOKDECK_CANCEL_SCHEDULED_RETRIES` | Cancel Hookdeck Scheduled Retries | Tool to cancel all future scheduled retries for an event. Use when you need to mute automatic retry attempts after repeated failures. |
| `HOOKDECK_COUNT_CONNECTIONS` | Count Hookdeck Connections | Tool to count Hookdeck connections with optional filters. Use when you need to get the total number of connections matching specific criteria. |
| `HOOKDECK_COUNT_DESTINATIONS` | Count Hookdeck Destinations | Tool to count Hookdeck destinations with optional filters. Use when you need to get a total count of destinations without retrieving full details. |
| `HOOKDECK_COUNT_SOURCES` | Count Hookdeck Sources | Tool to count Hookdeck sources with optional filters. Use when you need to get a total count of sources without retrieving full details. |
| `HOOKDECK_CREATE_BOOKMARK` | Create Hookdeck Bookmark | Tool to create a bookmark for a specific event request in Hookdeck. Bookmarks allow you to catalog and replay specific webhook requests. Use this to save important or edge-case requests for testing, debugging, or documentation purposes. Bookmarked request data is exempt from the archiving period and remains available as long as it is bookmarked. |
| `HOOKDECK_CREATE_CONNECTION` | Create Hookdeck Connection | Tool to create a connection between a source and a destination. Use after setting up or referencing source/destination. |
| `HOOKDECK_CREATE_DESTINATION` | Create Hookdeck Destination | Tool to create a new Hookdeck destination. Use after setting up sources when you need to route events to endpoints. |
| `HOOKDECK_CREATE_IGNORED_EVENT_BULK_RETRY` | Create Ignored Event Bulk Retry | Tool to create an ignored events bulk retry operation. Use when you need to retry multiple ignored events matching specific filters. The query must include at least one filter parameter (webhook_id, cause, or transformation_id) - empty queries are not allowed. |
| `HOOKDECK_CREATE_INTEGRATION` | Create Hookdeck Integration | Tool to create a new Hookdeck integration. Use when you need to set up authentication or verification for webhook sources using providers like API keys, HMAC, Basic Auth, or third-party services. |
| `HOOKDECK_CREATE_ISSUE_TRIGGER` | Create Hookdeck Issue Trigger | Tool to create an issue trigger in Hookdeck. Use when you need to set up automated notifications for delivery failures, transformation errors, or backpressure events. |
| `HOOKDECK_CREATE_SOURCE` | Create Hookdeck Source | Tool to create a new Hookdeck source. Use after setting up your project when you need to receive and route incoming webhooks. |
| `HOOKDECK_CREATE_TRANSFORMATION` | Create Hookdeck Transformation | Tool to create a new Hookdeck transformation. Use when you need to execute custom JavaScript to modify event payloads before delivery. |
| `HOOKDECK_DELETE_BOOKMARK` | Delete Hookdeck Bookmark | Tool to delete a specific bookmark by its ID. Use when you need to permanently remove a bookmark after confirming it's no longer needed. |
| `HOOKDECK_DELETE_CONNECTION` | Delete Hookdeck Connection | Tool to delete a specific connection by its ID. Use when you need to permanently remove a connection after confirming it's no longer needed. |
| `HOOKDECK_DELETE_DESTINATION` | Delete Hookdeck Destination | Permanently deletes a Hookdeck destination by its ID. This action also deletes all connections that rely on the destination. The associated event data is retained for the remainder of your retention window. This operation is idempotent - deleting a non-existent destination will still return success. |
| `HOOKDECK_DELETE_INTEGRATION` | Delete Hookdeck Integration | Tool to delete a specific integration by its ID. Use when you need to permanently remove an integration after confirming it's no longer needed. |
| `HOOKDECK_DELETE_ISSUE_TRIGGER` | Delete Hookdeck Issue Trigger | Tool to delete a specific issue trigger by its ID. Use when you need to permanently remove an issue trigger after confirming it's no longer needed. |
| `HOOKDECK_DELETE_SOURCE` | Delete Hookdeck Source | Tool to delete a specific source by its ID. Use when you need to permanently remove a source after confirming it's no longer needed. |
| `HOOKDECK_DELETE_TRANSFORMATION` | Delete Hookdeck Transformation | Permanently delete a Hookdeck transformation by its ID. The transformation must not be in use by any connections before deletion. Returns the ID of the deleted transformation on success. Use this when you need to clean up unused transformations from your Hookdeck workspace. |
| `HOOKDECK_DISABLE_CONNECTION` | Disable Hookdeck Connection | Tool to disable a connection by its ID. Use when you need to temporarily stop event delivery through a connection without deleting it. |
| `HOOKDECK_DISABLE_DESTINATION` | Disable Hookdeck Destination | Tool to disable a Hookdeck destination. Use when you need to temporarily stop event delivery to a destination without deleting it. Disabled destinations can be re-enabled later. |
| `HOOKDECK_DISABLE_ISSUE_TRIGGER` | Disable Hookdeck Issue Trigger | Tool to disable a Hookdeck issue trigger. Use when you need to temporarily stop notifications for a specific issue trigger without deleting it. The trigger can be re-enabled later if needed. |
| `HOOKDECK_DISABLE_SOURCE` | Disable Hookdeck Source | Tool to disable a Hookdeck source. Use when you need to stop a source from accepting new webhook events without deleting it. |
| `HOOKDECK_ENABLE_CONNECTION` | Enable Hookdeck Connection | Tool to enable a disabled Hookdeck connection. Use when you need to reactivate a previously disabled connection to resume event routing. |
| `HOOKDECK_ENABLE_DESTINATION` | Enable Hookdeck Destination | Enable a previously disabled Hookdeck destination by its ID. This allows events to be delivered to the destination again. |
| `HOOKDECK_ENABLE_ISSUE_TRIGGER` | Enable Hookdeck Issue Trigger | Tool to enable a Hookdeck issue trigger. Use when you need to activate an issue trigger that was previously disabled. |
| `HOOKDECK_ENABLE_SOURCE` | Enable Hookdeck Source | Tool to enable a disabled Hookdeck source. Use when you need to reactivate a source that was previously disabled. |
| `HOOKDECK_GENERATE_EVENT_BULK_CANCEL_PLAN` | Generate Event Bulk Cancel Plan | Tool to generate a preview plan for bulk event cancellation. Use when you need to estimate how many events would be cancelled by a query before executing the actual bulk cancel operation. |
| `HOOKDECK_GENERATE_EVENT_BULK_RETRY_PLAN` | Generate Event Bulk Retry Plan | Tool to generate an events bulk retry plan. Use when you need to estimate the scope of a bulk retry operation before executing it. Returns the estimated number of events that would be retried and the number of batches required. |
| `HOOKDECK_GENERATE_IGNORED_EVENT_BULK_RETRY_PLAN` | Generate Ignored Event Bulk Retry Plan | Generate an ignored events bulk retry plan to estimate the scope before execution. Use this to preview how many events would be retried and how many batches are needed. This action does not execute the retry - it only provides estimates for planning purposes. |
| `HOOKDECK_GENERATE_REQUEST_BULK_RETRY_PLAN` | Generate Request Bulk Retry Plan | Tool to generate a requests bulk retry plan. Use when you need to estimate the number of requests and batches for a bulk retry operation before executing it. Accepts the same query filters as the List Requests endpoint. |
| `HOOKDECK_GET_ATTEMPT2` | Get Hookdeck Attempt | Tool to retrieve a specific Hookdeck delivery attempt by ID. Use when you have an attempt ID and need delivery details including status, response codes, timing, and errors. |
| `HOOKDECK_GET_ATTEMPTS` | Get attempts | Lists delivery attempts for your Hookdeck account. Attempts represent individual HTTP delivery tries to destination URLs. Use this to monitor delivery status, debug failures, and track retry attempts. Filter by event_id to see all attempts for a specific event. Only attempts with status SUCCESSFUL or FAILED are returned. |
| `HOOKDECK_GET_ATTEMPTS_METRICS` | Get attempts metrics | Tool to query aggregated attempt metrics with time-based grouping and filtering. Use when you need to analyze delivery attempt patterns over time, calculate statistics like attempt counts, or group metrics by dimensions such as status or destination. |
| `HOOKDECK_GET_BOOKMARK` | Get Hookdeck Bookmark | Tool to retrieve a single bookmark by its ID. Use when you need to fetch details of a specific bookmark. |
| `HOOKDECK_GET_BOOKMARK_RAW_BODY` | Get Bookmark Raw Body | Tool to retrieve the raw body data of a bookmarked request. Use when you need to access the original unmodified request body payload that was bookmarked in Hookdeck. |
| `HOOKDECK_GET_CONNECTION` | Get Hookdeck Connection | Retrieves details of a specific Hookdeck connection by its ID. Returns the connection configuration including its source, destination, and any configured rules. Use this to inspect connection settings, verify configuration, or get source/destination details. |
| `HOOKDECK_GET_CONNECTIONS` | Hookdeck: Get Connections | Tool to list Hookdeck connections. Use when you need to retrieve or filter your configured connections. Each connection in the response embeds full source and destination objects; reuse these nested objects directly instead of making additional fetch calls. |
| `HOOKDECK_GET_DESTINATION` | Get Hookdeck Destination | Retrieve details of a specific Hookdeck destination by ID. Use this tool to get the full configuration and status of a destination, including its URL, authentication settings, rate limits, and timestamps. |
| `HOOKDECK_GET_DESTINATIONS` | Hookdeck: Get Destinations | Tool to list Hookdeck destinations. Use when you need to retrieve or filter your configured destinations. |
| `HOOKDECK_GET_EVENT` | Get Event | Tool to retrieve a specific Hookdeck event by ID. Use when you need detailed information about an event including status, delivery attempts, and payload data. |
| `HOOKDECK_GET_EVENT_BULK_CANCEL` | Get Event Bulk Cancel Status | Tool to retrieve the status of a bulk event cancellation operation. Use when you need to check the progress or completion status of a bulk cancel job. The bulk cancel ID is returned when initiating a bulk cancel operation. |
| `HOOKDECK_GET_EVENT_BULK_CANCELS` | Get Event Bulk Cancels | Tool to list event bulk cancel operations for your Hookdeck account. Use when you need to retrieve bulk cancel operation logs, filter by status or time, and paginate through results. |
| `HOOKDECK_GET_EVENT_BULK_RETRIES` | Get Event Bulk Retries | Tool to retrieve bulk retry operations for Hookdeck events. Use when you need to check the status of bulk retry jobs, monitor their progress, or list historical bulk retry operations. |
| `HOOKDECK_GET_EVENT_BULK_RETRY` | Get Event Bulk Retry Status | Tool to retrieve the status of a bulk event retry operation. Use when you need to check the progress or completion status of a bulk retry job. The bulk retry ID is returned when initiating a bulk retry operation. |
| `HOOKDECK_GET_EVENT_RAW_BODY` | Get Event Raw Body | Tool to retrieve the raw body data of an event. Use when you need to access the original unmodified request body payload of a Hookdeck event. |
| `HOOKDECK_GET_EVENTS` | Get events | Tool to list events for your Hookdeck account. Use when you need to retrieve delivery logs, filter by status or time, and paginate through results. |
| `HOOKDECK_GET_EVENTS_BY_ISSUE_METRICS` | Get events by issue metrics | Tool to query event metrics grouped by individual issue IDs. Uses arrayJoin to create one row per issue per event, enabling per-issue analytics. Use when tracking which issues affect the most events over time. |
| `HOOKDECK_GET_EVENTS_METRICS` | Get Events Metrics | Tool to query aggregated event metrics with time-based grouping and filtering. Use when you need to analyze event patterns, calculate statistics, or generate reports over specific time periods. |
| `HOOKDECK_GET_EVENTS_PENDING_TIMESERIES_METRICS` | Get events pending timeseries metrics | Tool to query aggregated events pending timeseries metrics with time-based grouping and filtering. Use when you need to analyze pending event trends over time, monitor event backlogs, or generate time-series reports with custom granularity. Supports grouping by dimensions like source or destination. |
| `HOOKDECK_GET_IGNORED_EVENT_BULK_RETRIES` | Get Ignored Event Bulk Retries | Tool to retrieve ignored events bulk retry operations for Hookdeck. Use when you need to check the status of ignored events bulk retry jobs, monitor their progress, or list historical ignored events bulk retry operations. |
| `HOOKDECK_GET_IGNORED_EVENT_BULK_RETRY` | Get Ignored Event Bulk Retry Status | Tool to retrieve the status of an ignored events bulk retry operation. Use when you need to check the progress or completion status of a bulk retry job for ignored events. |
| `HOOKDECK_GET_INTEGRATION` | Get Hookdeck Integration | Tool to retrieve details of a specific Hookdeck integration. Use when you need to inspect integration configuration, verify credentials, or check which sources are using the integration. |
| `HOOKDECK_GET_INTEGRATIONS` | Get Hookdeck Integrations | Tool to retrieve a list of Hookdeck integrations. Use when you need to list all integrations or filter them by label or provider. |
| `HOOKDECK_GET_ISSUE_COUNT` | Get Hookdeck Issue Count | Tool to get the count of Hookdeck issues with optional filters. Use when you need to retrieve the total number of issues matching specific criteria without fetching the full list. |
| `HOOKDECK_GET_ISSUE_TRIGGER` | Get Hookdeck Issue Trigger | Tool to retrieve a single Hookdeck issue trigger by its ID. Use when you need to get detailed information about a specific issue trigger configuration. |
| `HOOKDECK_GET_ISSUE_TRIGGERS` | Get issue triggers | Tool to list issue triggers for your Hookdeck account. Use when you need to retrieve configured issue triggers and their notification settings. |
| `HOOKDECK_GET_QUEUE_DEPTH_METRICS` | Get Queue Depth Metrics | Tool to query queue depth metrics for destinations (pending events count and age). Use when you need to analyze event queue depth over time, monitor pending events, or track the age of the oldest pending event for destinations. |
| `HOOKDECK_GET_REQUEST` | Get Hookdeck Request | Retrieve detailed information about a specific Hookdeck request by ID. Use this tool to inspect a webhook request including its body, headers, query parameters, and processing status. The request_id can be obtained from the HOOKDECK_GET_REQUESTS action. Returns complete request data including verification status, rejection cause (if any), and event counts. |
| `HOOKDECK_GET_REQUEST_BULK_RETRIES` | Get Request Bulk Retries | Tool to retrieve bulk retry operations for Hookdeck requests. Use when you need to check the status of request bulk retry jobs, monitor their progress, or list historical request bulk retry operations. |
| `HOOKDECK_GET_REQUEST_BULK_RETRY` | Get Request Bulk Retry Status | Tool to retrieve the status of a requests bulk retry operation. Use when you need to check the progress or completion status of a bulk retry job for webhook requests. |
| `HOOKDECK_GET_REQUEST_EVENTS` | Get Request Events | Tool to retrieve events associated with a specific Hookdeck request. Use when you need to get all events that were created from a particular request. |
| `HOOKDECK_GET_REQUEST_IGNORED_EVENTS` | Get Request Ignored Events | Retrieve the list of ignored events for a specific Hookdeck request. Use this tool when you need to inspect why certain events were ignored for a particular request. The request ID can be obtained from the HOOKDECK_GET_REQUESTS action. Returns a paginated list of ignored events with their causes and metadata. |
| `HOOKDECK_GET_REQUEST_RAW_BODY` | Get Request Raw Body | Tool to retrieve the raw body data of a request. Use when you need to access the original unmodified request body payload of a Hookdeck request. |
| `HOOKDECK_GET_REQUESTS` | Hookdeck: Get Requests | Tool to list Hookdeck requests. Use when you need to retrieve requests with optional filters and pagination. |
| `HOOKDECK_GET_REQUESTS_METRICS` | Get requests metrics | Tool to query aggregated request metrics with time-based grouping and filtering. Use when you need to analyze request patterns over time, calculate statistics like request counts, or group metrics by dimensions such as status or source. |
| `HOOKDECK_GET_SOURCE` | Get Hookdeck Source | Tool to retrieve details of a specific Hookdeck source. Use after confirming the source ID. |
| `HOOKDECK_GET_SOURCES` | Get sources | Tool to retrieve all sources associated with your Hookdeck account. Use when you need to list or filter hook sources. |
| `HOOKDECK_GET_TRANSFORMATION` | Get Hookdeck Transformation | Retrieves the complete details of a specific Hookdeck transformation by its ID. Use this tool when you need to inspect a transformation's JavaScript code, environment variables, or metadata. Requires a valid transformation_id which can be obtained from HOOKDECK_GET_TRANSFORMATIONS. Returns the transformation's code, name, environment variables, and timestamps. |
| `HOOKDECK_GET_TRANSFORMATION_EXECUTION` | Get Transformation Execution | Retrieve a specific transformation execution by transformation ID and execution ID. Use this tool to inspect execution details including original and transformed event data, logs, and any issues that occurred. |
| `HOOKDECK_GET_TRANSFORMATION_EXECUTIONS` | Get transformation executions | Tool to retrieve executions for a specific Hookdeck transformation. Use when you need to inspect transformation execution logs, debug transformation failures, or analyze transformation performance. |
| `HOOKDECK_GET_TRANSFORMATIONS` | Get transformations | Tool to list Hookdeck transformations. Use when you need to retrieve or filter your Hookdeck transformations. |
| `HOOKDECK_GET_TRANSFORMATIONS_COUNT` | Get Transformations Count | Tool to get the count of Hookdeck transformations with optional filters. Use when you need to get the total number of transformations without retrieving full details. |
| `HOOKDECK_GET_TRANSFORMATIONS_METRICS` | Get transformations metrics | Tool to query aggregated transformation execution metrics with time-based grouping and filtering. Use when you need to analyze transformation patterns over time, calculate statistics like execution counts, or group metrics by dimensions such as transformation_id or status. |
| `HOOKDECK_LIST_BOOKMARKS` | List Hookdeck Bookmarks | Tool to list bookmarks. Use when you need to retrieve your Hookdeck account's bookmarks with optional filters and pagination. Use after authenticating your session. |
| `HOOKDECK_LIST_CUSTOM_DOMAINS` | List Custom Domains | Tool to list all custom domains and their verification statuses for the Hookdeck project. Use when you need to view configured custom domains, check their verification status, or monitor SSL certificate details. |
| `HOOKDECK_LIST_ISSUES` | Hookdeck: List Issues | Tool to list all issues detected in your Hookdeck account. Use when you need to retrieve and filter issues by type, status, or time. |
| `HOOKDECK_PAUSE_CONNECTION` | Hookdeck Pause Connection | Tool to pause a Hookdeck connection. Use when you need to temporarily stop event delivery for a connection without deleting it. |
| `HOOKDECK_PUBLISH_EVENT` | Publish Event to Hookdeck | Tool to publish a webhook event to Hookdeck using the Publish API. Use when testing webhook flows or sending events from your application. |
| `HOOKDECK_REPLAY_EVENT` | Replay Hookdeck Event | Replay (retry) a specific Hookdeck event delivery. Use this to manually retry a failed or queued event. The event will be re-queued for delivery to its destination. After replay, Hookdeck will attempt to deliver the event; if successful, any scheduled automatic retries will be canceled. Note: The event's connection must still be active - events with deleted connections cannot be replayed. |
| `HOOKDECK_RESOLVE_ISSUE` | Resolve Hookdeck Issue | Tool to resolve a Hookdeck issue. Use after confirming the underlying issue has been addressed. |
| `HOOKDECK_RETRIEVE_ISSUE` | Retrieve Hookdeck Issue | Retrieves detailed information about a specific Hookdeck issue by its ID. Use this tool when you need to get complete details about a known issue, including its status, type (delivery/transformation/backpressure), aggregation keys, timestamps, and reference information. To find issue IDs, use the List Issues action first. |
| `HOOKDECK_SEND_SOURCE_REQUEST` | Send Hookdeck Source Request | Tool to send HTTP requests to a Hookdeck Source URL. Use when ingesting test payloads to generate events for testing HOOKDECK_GET_EVENT. |
| `HOOKDECK_TEST_TRANSFORMATION` | Test Hookdeck Transformation | Tool to test a Hookdeck transformation code before deploying it. Use when you need to verify that transformation JavaScript code works correctly with sample request data. |
| `HOOKDECK_TOGGLE_WEBHOOK_NOTIFICATIONS` | Toggle Webhook Notifications | Tool to toggle webhook notifications for the project. Use when you need to enable or disable webhook notifications and configure which topics to receive. |
| `HOOKDECK_TRIGGER_BOOKMARK` | Trigger Hookdeck Bookmark | Trigger a Hookdeck bookmark to replay its stored webhook request. When triggered, a new event is created from the bookmarked request data and delivered to the associated destination. This is useful for testing webhook handlers or replaying specific scenarios during development. Note: The bookmark must be associated with an active connection (webhook). Triggering a bookmark with a deleted connection will fail with a 404 error. |
| `HOOKDECK_UNPAUSE_CONNECTION` | Unpause Hookdeck Connection | Tool to unpause a paused Hookdeck connection. Use when you need to resume event processing for a previously paused connection. |
| `HOOKDECK_UPDATE_BOOKMARK` | Update Hookdeck Bookmark | Tool to update an existing bookmark in Hookdeck. Use when you need to modify a bookmark's label, name, associated event data, or connection. At least one field (label, name, event_data_id, or webhook_id) must be provided for the update. |
| `HOOKDECK_UPDATE_CONNECTION` | Hookdeck Update Connection | Upsert (create or update) a Hookdeck connection between a source and destination. The connection is identified by the source and destination combination. If a connection with the given source and destination exists, it will be updated. Otherwise, a new connection is created. Use this tool to: - Create a new connection between a source and destination - Update an existing connection's name, description, or rules - Configure webhook routing with retry, filter, or transform rules |
| `HOOKDECK_UPDATE_CONNECTION2` | Update Connection by ID | Tool to update an existing Hookdeck connection by its ID. Use when you need to modify a connection's description, name, or rules. |
| `HOOKDECK_UPDATE_DESTINATION` | Update Hookdeck Destination | Tool to update an existing Hookdeck destination. Use when you need to modify a destination's settings after creation. |
| `HOOKDECK_UPDATE_INTEGRATION` | Update Hookdeck Integration | Tool to update an existing Hookdeck integration. Use when you need to modify integration configuration, change labels, update provider settings, or enable/disable features. |
| `HOOKDECK_UPDATE_ISSUE_TRIGGER` | Update Hookdeck Issue Trigger | Tool to update an issue trigger in Hookdeck. Use when you need to modify the name, channels, configs, or disabled status of an existing issue trigger. |
| `HOOKDECK_UPDATE_SOURCE` | Update Hookdeck Source | Update an existing Hookdeck source's name, type, or description. Use this tool when you need to: - Rename a source - Change a source's type (e.g., from WEBHOOK to STRIPE) - Update or add a description to a source Note: Source configuration (allowed_http_methods, auth settings) cannot be updated via this endpoint. At least one field (name, type, or description) must be provided. |
| `HOOKDECK_UPDATE_TRANSFORMATION` | Update Hookdeck Transformation | Tool to update an existing Hookdeck transformation. Use when you need to modify a transformation's code, name, or environment variables after creation. |
| `HOOKDECK_UPSERT_DESTINATION` | Upsert Hookdeck Destination | Tool to create or update a Hookdeck destination. If a destination with the given name exists, it updates it; otherwise creates a new one. Use when configuring webhook endpoints for event routing. |
| `HOOKDECK_UPSERT_ISSUE_TRIGGER` | Upsert Hookdeck Issue Trigger | Tool to create or update an issue trigger in Hookdeck using upsert semantics. If a trigger with the given name exists, it will be updated; otherwise, a new trigger is created. |
| `HOOKDECK_UPSERT_SOURCE` | Upsert Hookdeck Source | Tool to create or update a Hookdeck source by name. If a source with the given name exists, it will be updated; otherwise, a new source is created. |
| `HOOKDECK_UPSERT_TRANSFORMATION` | Upsert Hookdeck Transformation | Tool to create or update a Hookdeck transformation by name. Use when you want to ensure a transformation exists with specific code, creating it if it doesn't exist or updating it if it does. |

## Supported Triggers

None listed.

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

The Hookdeck MCP server is an implementation of the Model Context Protocol that connects your AI agent to Hookdeck. It provides structured and secure access so your agent can perform Hookdeck 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 you begin, make sure you have:
- Node.js and npm installed
- A Composio account with API key
- An OpenAI API key

### 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 required dependencies

First, install the necessary packages for your project.
What you're installing:
- @ai-sdk/openai: Vercel AI SDK's OpenAI provider
- @ai-sdk/mcp: MCP client for Vercel AI SDK
- @composio/core: Composio SDK for tool integration
- ai: Core Vercel AI SDK
- dotenv: Environment variable management
```bash
npm install @ai-sdk/openai @ai-sdk/mcp @composio/core ai dotenv
```

### 3. Set up environment variables

Create a .env file in your project root.
What's needed:
- OPENAI_API_KEY: Your OpenAI API key for GPT model access
- COMPOSIO_API_KEY: Your Composio API key for tool access
- COMPOSIO_USER_ID: A unique identifier for the user session
```bash
OPENAI_API_KEY=your_openai_api_key_here
COMPOSIO_API_KEY=your_composio_api_key_here
COMPOSIO_USER_ID=your_user_id_here
```

### 4. Import required modules and validate environment

What's happening:
- We're importing all necessary libraries including Vercel AI SDK's OpenAI provider and Composio
- The dotenv/config import automatically loads environment variables
- The MCP client import enables connection to Composio's tool server
```typescript
import "dotenv/config";
import { openai } from "@ai-sdk/openai";
import { Composio } from "@composio/core";
import * as readline from "readline";
import { streamText, type ModelMessage, stepCountIs } from "ai";
import { createMCPClient } from "@ai-sdk/mcp";

const composioAPIKey = process.env.COMPOSIO_API_KEY;
const composioUserID = process.env.COMPOSIO_USER_ID;

if (!process.env.OPENAI_API_KEY) throw new Error("OPENAI_API_KEY is not set");
if (!composioAPIKey) throw new Error("COMPOSIO_API_KEY is not set");
if (!composioUserID) throw new Error("COMPOSIO_USER_ID is not set");

const composio = new Composio({
  apiKey: composioAPIKey,
});
```

### 5. Create Tool Router session and initialize MCP client

What's happening:
- We're creating a Tool Router session that gives your agent access to Hookdeck tools
- The create method takes the user ID and specifies which toolkits should be available
- The returned mcp object contains the URL and authentication headers needed to connect to the MCP server
- This session provides access to all Hookdeck-related tools through the MCP protocol
```typescript
async function main() {
  // Create a tool router session for the user
  const session = await composio.create(composioUserID!, {
    toolkits: ["hookdeck"],
  });

  const mcpUrl = session.mcp.url;
```

### 6. Connect to MCP server and retrieve tools

What's happening:
- We're creating an MCP client that connects to our Composio Tool Router session via HTTP
- The mcp.url provides the endpoint, and mcp.headers contains authentication credentials
- The type: "http" is important - Composio requires HTTP transport
- tools() retrieves all available Hookdeck tools that the agent can use
```typescript
const mcpClient = await createMCPClient({
  transport: {
    type: "http",
    url: mcpUrl,
    headers: session.mcp.headers, // Authentication headers for the Composio MCP server
  },
});

const tools = await mcpClient.tools();
```

### 7. Initialize conversation and CLI interface

What's happening:
- We initialize an empty messages array to maintain conversation history
- A readline interface is created to accept user input from the command line
- Instructions are displayed to guide the user on how to interact with the agent
```typescript
let messages: ModelMessage[] = [];

console.log("Chat started! Type 'exit' or 'quit' to end the conversation.\n");
console.log(
  "Ask any questions related to hookdeck, like summarize my last 5 emails, send an email, etc... :)))\n",
);

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  prompt: "> ",
});

rl.prompt();
```

### 8. Handle user input and stream responses with real-time tool feedback

What's happening:
- We use streamText instead of generateText to stream responses in real-time
- toolChoice: "auto" allows the model to decide when to use Hookdeck tools
- stopWhen: stepCountIs(10) allows up to 10 steps for complex multi-tool operations
- onStepFinish callback displays which tools are being used in real-time
- We iterate through the text stream to create a typewriter effect as the agent responds
- The complete response is added to conversation history to maintain context
- Errors are caught and displayed with helpful retry suggestions
```typescript
rl.on("line", async (userInput: string) => {
  const trimmedInput = userInput.trim();

  if (["exit", "quit", "bye"].includes(trimmedInput.toLowerCase())) {
    console.log("\nGoodbye!");
    rl.close();
    process.exit(0);
  }

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

  messages.push({ role: "user", content: trimmedInput });
  console.log("\nAgent is thinking...\n");

  try {
    const stream = streamText({
      model: openai("gpt-5"),
      messages,
      tools,
      toolChoice: "auto",
      stopWhen: stepCountIs(10),
      onStepFinish: (step) => {
        for (const toolCall of step.toolCalls) {
          console.log(`[Using tool: ${toolCall.toolName}]`);
          }
          if (step.toolCalls.length > 0) {
            console.log(""); // Add space after tool calls
          }
        },
      });

      for await (const chunk of stream.textStream) {
        process.stdout.write(chunk);
      }

      console.log("\n\n---\n");

      // Get final result for message history
      const response = await stream.response;
      if (response?.messages?.length) {
        messages.push(...response.messages);
      }
    } catch (error) {
      console.error("\nAn error occurred while talking to the agent:");
      console.error(error);
      console.log(
        "\nYou can try again or restart the app if it keeps happening.\n",
      );
    } finally {
      rl.prompt();
    }
  });

  rl.on("close", async () => {
    await mcpClient.close();
    console.log("\n👋 Session ended.");
    process.exit(0);
  });
}

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

## Complete Code

```typescript
import "dotenv/config";
import { openai } from "@ai-sdk/openai";
import { Composio } from "@composio/core";
import * as readline from "readline";
import { streamText, type ModelMessage, stepCountIs } from "ai";
import { createMCPClient } from "@ai-sdk/mcp";

const composioAPIKey = process.env.COMPOSIO_API_KEY;
const composioUserID = process.env.COMPOSIO_USER_ID;

if (!process.env.OPENAI_API_KEY) throw new Error("OPENAI_API_KEY is not set");
if (!composioAPIKey) throw new Error("COMPOSIO_API_KEY is not set");
if (!composioUserID) throw new Error("COMPOSIO_USER_ID is not set");

const composio = new Composio({
  apiKey: composioAPIKey,
});

async function main() {
  // Create a tool router session for the user
  const session = await composio.create(composioUserID!, {
    toolkits: ["hookdeck"],
  });

  const mcpUrl = session.mcp.url;

  const mcpClient = await createMCPClient({
    transport: {
      type: "http",
      url: mcpUrl,
      headers: session.mcp.headers, // Authentication headers for the Composio MCP server
    },
  });

  const tools = await mcpClient.tools();

  let messages: ModelMessage[] = [];

  console.log("Chat started! Type 'exit' or 'quit' to end the conversation.\n");
  console.log(
    "Ask any questions related to hookdeck, like summarize my last 5 emails, send an email, etc... :)))\n",
  );

  const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    prompt: "> ",
  });

  rl.prompt();

  rl.on("line", async (userInput: string) => {
    const trimmedInput = userInput.trim();

    if (["exit", "quit", "bye"].includes(trimmedInput.toLowerCase())) {
      console.log("\nGoodbye!");
      rl.close();
      process.exit(0);
    }

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

    messages.push({ role: "user", content: trimmedInput });
    console.log("\nAgent is thinking...\n");

    try {
      const stream = streamText({
        model: openai("gpt-5"),
        messages,
        tools,
        toolChoice: "auto",
        stopWhen: stepCountIs(10),
        onStepFinish: (step) => {
          for (const toolCall of step.toolCalls) {
            console.log(`[Using tool: ${toolCall.toolName}]`);
          }
          if (step.toolCalls.length > 0) {
            console.log(""); // Add space after tool calls
          }
        },
      });

      for await (const chunk of stream.textStream) {
        process.stdout.write(chunk);
      }

      console.log("\n\n---\n");

      // Get final result for message history
      const response = await stream.response;
      if (response?.messages?.length) {
        messages.push(...response.messages);
      }
    } catch (error) {
      console.error("\nAn error occurred while talking to the agent:");
      console.error(error);
      console.log(
        "\nYou can try again or restart the app if it keeps happening.\n",
      );
    } finally {
      rl.prompt();
    }
  });

  rl.on("close", async () => {
    await mcpClient.close();
    console.log("\n👋 Session ended.");
    process.exit(0);
  });
}

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

## Conclusion

You've successfully built a Hookdeck agent using the Vercel AI SDK with streaming capabilities! This implementation provides a powerful foundation for building AI applications with natural language interfaces and real-time feedback.
Key features of this implementation:
- Real-time streaming responses for a better user experience with typewriter effect
- Live tool execution feedback showing which tools are being used as the agent works
- Dynamic tool loading through Composio's Tool Router with secure authentication
- Multi-step tool execution with configurable step limits (up to 10 steps)
- Comprehensive error handling for robust agent execution
- Conversation history maintenance for context-aware responses
You can extend this further by adding custom error handling, implementing specific business logic, or integrating additional Composio toolkits to create multi-app workflows.

## How to build Hookdeck MCP Agent with another framework

- [OpenAI Agents SDK](https://composio.dev/toolkits/hookdeck/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/hookdeck/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/hookdeck/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/hookdeck/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/hookdeck/framework/codex)
- [OpenClaw](https://composio.dev/toolkits/hookdeck/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/hookdeck/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/hookdeck/framework/cli)
- [Google ADK](https://composio.dev/toolkits/hookdeck/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/hookdeck/framework/langchain)
- [Mastra AI](https://composio.dev/toolkits/hookdeck/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/hookdeck/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/hookdeck/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 Hookdeck MCP?

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

### Can I use Tool Router MCP with Vercel AI SDK v6?

Yes, you can. Vercel AI SDK v6 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 Hookdeck tools.

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

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

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