Skip to content

Commit 7841a6f

Browse files
Additional changes
1 parent 37624c0 commit 7841a6f

File tree

3 files changed

+81
-19
lines changed

3 files changed

+81
-19
lines changed

docs-v2/pages/connect/mcp/_meta.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default {
22
"index": "Overview",
33
"developers": "Developers",
4-
"users": "Users",
4+
"users": "Consumers",
55
"openai": {
66
title: "OpenAI",
77
display: "hidden",

docs-v2/pages/connect/mcp/developers.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ To run your own MCP server, you'll need:
1313

1414
1. A [Pipedream account](https://pipedream.com/auth/signup)
1515
2. A [Pipedream project](/projects/#creating-projects). Accounts connected via MCP will be stored here.
16-
3. [Pipedream OAuth credentials](/connect/managed-auth/oauth-clients/)
16+
3. [Pipedream OAuth credentials](/rest-api/auth/#oauth)
1717

1818
#### Set up environment variables
1919

docs-v2/pages/connect/mcp/openai.mdx

Lines changed: 79 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,80 @@
1-
import { Tabs } from 'nextra/components'
1+
import { Callout, Tabs } from 'nextra/components'
22

33
# Using Pipedream MCP with OpenAI
44

5-
Add {process.env.PUBLIC_APPS}+ APIs and 10,000+ tools to OpenAI using Pipedream MCP with the [OpenAI Responses API](https://platform.openai.com/docs/guides/tools?api-mode=responses).
5+
Access {process.env.PUBLIC_APPS}+ APIs and 10,000+ tools in OpenAI using Pipedream MCP with the [OpenAI Responses API](https://platform.openai.com/docs/guides/tools?api-mode=responses). MCP makes it easy to extend the capabilties of your app or agent, and Pipedream offers drop-in support with OpenAI.
66

7-
MCP makes it easy to extend the capabilties of your app or agent, and Pipedream offers drop-in support with OpenAI.
7+
<Callout type="info">
8+
Pipedream MCP includes built-in user authentication for [every integrated API](https://pipedream.com/apps/), which means you don't need to build any authorization flows or think about token storage or refresh.
9+
</Callout>
810

9-
<Tabs items={['JavaScript', 'Python', 'cURL']}>
10-
<Tabs.Tab>
11+
## Getting Started
12+
To use Pipedream MCP with your own users, you need the following:
13+
14+
1. A [Pipedream account](https://pipedream.com/auth/signup)
15+
2. A [Pipedream project](/projects/#creating-projects). Accounts connected via MCP will be stored here.
16+
3. [Pipedream OAuth credentials](/rest-api/auth/#oauth)
17+
18+
<Callout type="info">
19+
These are requiremnents for you, the developer. Your users do **not** need to sign up for Pipedream in order to connect their accounts in your app or agent.
20+
</Callout>
21+
22+
#### Set up environment variables
23+
24+
Set the following environment variables (learn more about environments in Pipedream Connect [here](/connect/managed-auth/environments/)):
25+
26+
```bash
27+
PIPEDREAM_CLIENT_ID=your_client_id
28+
PIPEDREAM_CLIENT_SECRET=your_client_secret
29+
PIPEDREAM_PROJECT_ID=your_project_id
30+
PIPEDREAM_PROJECT_ENVIRONMENT=development
31+
```
32+
33+
### Examples
34+
35+
{/* <Tabs items={['JavaScript', 'Python', 'cURL']}>
36+
<Tabs.Tab> */}
1137
```javascript
12-
const configuredProps = {
13-
postgresql: {
14-
authProvisionId: "apn_xxxxxxx"
38+
import OpenAI from "openai";
39+
import { createBackendClient } from "@pipedream/sdk/server";
40+
41+
const externalUserId = "abc-123" // Unique ID in your system to identify the user
42+
43+
// Initialize the Pipedream SDK
44+
const pd = createBackendClient({
45+
credentials: {
46+
clientId: PIPEDREAM_CLIENT_ID,
47+
clientSecret: PIPEDREAM_CLIENT_SECRET,
1548
},
16-
sql: {
17-
auth: {
18-
app: "postgresql"
49+
environment: PIPEDREAM_ENVIRONMENT,
50+
projectId: PIPEDREAM_PROJECT_ID,
51+
});
52+
53+
const { token } = await pd.createConnectToken({
54+
external_user_id: externalUserId,
55+
})
56+
57+
const client = new OpenAI();
58+
59+
const response = await client.responses.create({
60+
model: "gpt-4.1",
61+
tools: [
62+
{
63+
"type": "mcp",
64+
"server_label": "Notion",
65+
"server_url": `https://mcp.pipedream.net/${externalUserId}/notion`,
66+
"headers": {
67+
"Authorization": `Bearer ${token}`
68+
}
69+
"require_approval": "never"
1970
},
20-
query: "select * from products where name = $1 and price > $2 limit 1",
21-
params: ["foo", 10.99] // Values to replace $1 and $2 placeholders
22-
}
23-
}
71+
],
72+
input: "Summarize my most recently created Notion doc for me and help draft an email to our customers"
73+
})
74+
75+
console.log(response);
2476
```
25-
</Tabs.Tab>
77+
{/* </Tabs.Tab>
2678
<Tabs.Tab>
2779
```python
2880
from openai import OpenAI
@@ -49,4 +101,14 @@ curl "https://api.openai.com/v1/responses" \
49101
}'
50102
```
51103
</Tabs.Tab>
52-
</Tabs>
104+
</Tabs> */}
105+
106+
107+
## Account Connection
108+
109+
One of the core features of Pipedream Connect and MCP is the ability for your users to easily connect their accounts without having to build any of the authorization flow or handle token storage, etc.
110+
111+
You can handle account connections in a couple different ways in your app:
112+
113+
1. Add the [frontend Pipedream SDK](/connect/managed-auth/quickstart/#use-the-pipedream-sdk-in-your-frontend) to your app, let users connect their account directly in your UI.
114+
2. Return a [Connect Link URL](/connect/managed-auth/quickstart/#or-use-connect-link) to your users from the LLM response.

0 commit comments

Comments
 (0)