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.
Add Pipedream MCP
Click the Create button in the Tools section, then select Pipedream.
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:
- Initialize the Pipedream SDK
- Find the relevant MCP server
- 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);