Use Pipedream MCP with OpenAI’s API and playground. OpenAI provides native MCP support for tool calling.

Testing in OpenAI’s API Playground

OpenAI provides an API playground for developers to test prompts and tool calling, which provides an easy way to test Pipedream MCP. Get started below.
1

Open the playground

Navigate to OpenAI’s playground and sign in with your OpenAI account.
2

Add Pipedream MCP

Click the Create button in the Tools section, then select Pipedream.
3

Enter your access token

4

Select an app

5

Click Connect

Enter a prompt and start chatting!
Refer to the instructions below when you’re ready to use Pipedream MCP in your app.

Using Pipedream MCP in your app

Set your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key
Other environment variables are covered in the setup guide.

Generate responses with Pipedream MCP

Below is an end to end example showing how to:
  1. Initialize the Pipedream SDK
  2. Find the relevant MCP server
  3. Send a prompt to OpenAI with the MCP server as a tool call
import OpenAI from 'openai';
import { PipedreamClient } from "@pipedream/sdk";
 
// Initialize the Pipedream SDK client
const pd = new PipedreamClient({
  projectEnvironment: PIPEDREAM_ENVIRONMENT,
  clientId: PIPEDREAM_CLIENT_ID,
  clientSecret: PIPEDREAM_CLIENT_SECRET,
  projectId: PIPEDREAM_PROJECT_ID
});
 
// Find the app to use for the MCP server
// For this example, we'll use Notion
const apps = await pd.apps.list({ q: "notion" });
const appSlug = apps.data[0].name_slug; // e.g., "notion"
 
// Get access token for MCP server auth
const accessToken = await pd.rawAccessToken;
 
// Send the unique ID that you use to identify this user in your system
const externalUserId = 'abc-123'; // Used in MCP URL to identify the user
 
// Initialize OpenAI client
const openaiClient = new OpenAI();
 
// Make the OpenAI request with the MCP server
const response = await openaiClient.responses.create({
  model: 'gpt-4.1',
  tools: [
    {
      type: 'mcp',
      server_label: appSlug,
      server_url: `https://remote.mcp.pipedream.net`,
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": PIPEDREAM_PROJECT_ID,
        "x-pd-environment": PIPEDREAM_ENVIRONMENT,
        "x-pd-external-user-id": externalUserId,
        "x-pd-app-slug": appSlug,
      },
      require_approval: 'never'
    }
  ],
  input: 'Summarize my most recently created Notion doc for me and help draft an email to our customers'
});
 
console.log(response);