This repository contains examples of using Pipedream's dynamic MCP server.
Unlike traditional MCP implementations that only provide a fixed set of tools, Pipedream's MCP server offers the ability to identify and load tools dynamically. This means that the tools can either be pre-defined, or discovered and configured on-demand.
This type of tool discovery is defined in the MCP spec, but most MCP clients don't support yet provide support for it.
This repo contains examples of how you, as the developer of an MCP client, can use Pipedream's app-level or dynamic MCP server.
The idea is to manually reload the list of tools on each turn.
This repo includes two examples showing different approaches to integrating with Pipedream's dynamic MCP server:
- The AI SDK Example uses Vercel's AI SDK with automatic tool handling
- The OpenAI SDK Example uses OpenAI SDK directly with manual tool conversion for full control
Install dependencies:
pnpm install
To set up your environment, you'll need:
- A Pipedream account
- A Pipedream project. Accounts connected via MCP will be stored here.
- Pipedream OAuth credentials
- An OpenAI API key
Copy the example environment file and add your credentials:
cp .env.example .env
Learn more about environments in Pipedream Connect.
You can run the examples using the following commands from the root directory:
pnpm ai-sdk -u <external-user-id> "<prompt>"
pnpm openai-sdk -u <external-user-id> "<prompt>"
For example:
pnpm ai-sdk -u <uuid> "Send a funny joke to the #random channel in Slack"
pnpm openai-sdk -u <uuid> "Send a funny joke to the #random channel in Slack"