Overview

Pipedream Connect includes built-in user authentication for more than APIs via MCP, which means you don’t need to build any authorization flows or deal with token storage and refresh in order to make authenticated requests on behalf of your users.

Examples

AI Frameworks

Use Pipedream MCP with popular AI frameworks and LLMs:

Key Pipedream concepts to understand

external_user_id
  • This is your user’s ID, in your system: whatever you use to uniquely identify them
  • Requests made for that user ID are coupled to that end user and their connected accounts (learn more)
app
  • The app’s “name slug” (the unique identifier for the app)
  • Check out the app discovery docs to learn how to discover and use available apps

Tool modes

Pipedream MCP supports different methods for interacting with tools. Learn about the available modes in the Tool Modes section of the docs.

Prerequisites

To use either the remote or self-hosted MCP server, you’ll need:
  1. A Pipedream account
  2. A Pipedream project. Accounts connected via MCP will be stored here.
  3. Pipedream OAuth credentials

Set up your environment

Set the following environment variables:
PIPEDREAM_CLIENT_ID=your_client_id
PIPEDREAM_CLIENT_SECRET=your_client_secret
PIPEDREAM_PROJECT_ID=your_project_id # proj_xxxxxxx
PIPEDREAM_ENVIRONMENT=development # development | production
Learn more about environments in Pipedream Connect.

Authentication

Developer authentication

Your application authenticates with Pipedream using client credential OAuth. See below for details.

User account connections

One of the core features of Pipedream Connect and the MCP server is the ability for your users to easily connect their accounts without having to build any of the authorization flow or handle token storage. You can handle account connections in one of two ways in your app:

Add a button in your UI

  • Use Pipedream’s frontend SDK to let users connect their account directly in your UI
  • You can see an example of this when you connect any account in mcp.pipedream.com
  • Use Connect Link to let your users connect their account in a new browser tab
  • This is handled automatically by Pipedream’s MCP server and there’s no additional implementation required
  • If a user doesn’t have a connected account that’s required for a given tool call, the server will return a URL in the tool call response:
https://pipedream.com/_static/connect.html?token=ctok_xxxxxxx&connectLink=true&app={appSlug}

Discover available integrations

Pipedream provides + APIs as MCP servers. Each server corresponds to an app integration (like Notion, Gmail, or Slack) and has its own specific set of tools. For detailed information on discovering apps and enabling automatic app discovery, check out app discovery section.

Getting started

Use Pipedream’s remote MCP server

Supported transport types

The Pipedream MCP server supports both SSE and streamable HTTP transport types dynamically, with no configuration required by the developer or MCP client.

Base URL

https://remote.mcp.pipedream.net

API Authentication

To authenticate requests to Pipedream’s MCP server, you need to include an access token with every HTTP request. Here’s how to get it:
import { PipedreamClient } from "@pipedream/sdk";
 
// Initialize the Pipedream SDK client
const client = new PipedreamClient({
  projectEnvironment: PIPEDREAM_ENVIRONMENT,
  clientId: PIPEDREAM_CLIENT_ID,
  clientSecret: PIPEDREAM_CLIENT_SECRET,
  projectId: PIPEDREAM_PROJECT_ID
});
 
// Get access token for MCP server auth
const accessToken = await client.rawAccessToken;
 
console.log(accessToken);

Params

  • Below are params that you should send with every HTTP request to Pipedream’s MCP server.
  • You can pass them as HTTP headers or as query parameters on the URL.
HeaderQuery ParamValueRequired?
x-pd-project-idprojectIdproj_xxxxxxxYes
x-pd-environmentenvironmentdevelopment, productionYes
x-pd-external-user-idexternalUserId<your-users-id>Yes
x-pd-account-idaccountIdapn_xxxxxxxNo
x-pd-app-slugapplinear, notion, etcYes*
x-pd-tool-modetoolModesub-agent, tools-only, full-configNo Defaults to sub-agent
x-pd-app-discoveryappDiscoverytrueNo
*Required unless using appDiscovery=true

Example request

import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
import { PipedreamClient } from "@pipedream/sdk";
 
// Initialize the Pipedream SDK client
const client = new PipedreamClient({
  projectEnvironment: PIPEDREAM_ENVIRONMENT,
  clientId: PIPEDREAM_CLIENT_ID,
  clientSecret: PIPEDREAM_CLIENT_SECRET,
  projectId: PIPEDREAM_PROJECT_ID
});
 
// Retrieve your developer access token via the Pipedream SDK
const accessToken = await client.rawAccessToken;
const serverUrl = MCP_SERVER_URL || `https://remote.mcp.pipedream.net`;
 
const transport = new StreamableHTTPClientTransport(new URL(serverUrl), {
  requestInit: {
    headers: {
      "Authorization": `Bearer ${accessToken}`,
      "x-pd-project-id": PIPEDREAM_PROJECT_ID, // proj_xxxxxxx
      "x-pd-environment": PIPEDREAM_ENVIRONMENT, // development | production
      "x-pd-external-user-id": EXTERNAL_USER_ID, // the user's ID from your system
      "x-pd-app-slug": APP_SLUG, // notion, linear, gmail, etc
    }
  }
});

Using the MCP inspector

The MCP inspector can be helpful when debugging tool calls.
npx @modelcontextprotocol/inspector
Enter the server URL:
https://remote.mcp.pipedream.net?externalUserId={external_user_id}&app={app_slug}

Using custom tools

Publish custom tools to your workspace to use them with Pipedream’s MCP server. This lets you add custom and unique functionality that may not be available in the public registry.