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
- MCP Chat App: Check out our open source chat app built with Vercel’s AI SDK and Pipedream MCP
- CLI Examples: Load tools dynamically using either OpenAI or Vercel’s AI SDK
- Gemini Agent: Use Pipedream MCP with Google Gemini (built by the Gemini team)
AI Frameworks
Use Pipedream MCP with popular AI frameworks and LLMs:Vercel AI SDK
Streamlined MCP integration with automatic tool execution
OpenAI
Direct integration with OpenAI’s API and playground
Anthropic Claude
Native MCP connector through Claude’s Messages API
Google Gemini
Multimodal AI with text, image, and tool capabilities
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:- A Pipedream account
- A Pipedream project. Accounts connected via MCP will be stored here.
- 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
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
Return a link
- 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.
| Header | Query Param | Value | Required? |
|---|---|---|---|
x-pd-project-id | projectId | proj_xxxxxxx | Yes |
x-pd-environment | environment | development, production | Yes |
x-pd-external-user-id | externalUserId | <your-users-id> | Yes |
x-pd-account-id | accountId | apn_xxxxxxx | No |
x-pd-app-slug | app | linear, notion, etc | Yes* |
x-pd-tool-mode | toolMode | sub-agent, tools-only, full-config | No Defaults to sub-agent |
x-pd-app-discovery | appDiscovery | true | No |
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
https://remote.mcp.pipedream.net?externalUserId={external_user_id}&app={app_slug}