Skip to content

Commit 28b1d83

Browse files
Improving docs slightly (#16719)
1 parent a024e77 commit 28b1d83

File tree

3 files changed

+69
-35
lines changed

3 files changed

+69
-35
lines changed

docs-v2/pages/connect/managed-auth/quickstart.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ If you're building your own app, you'll need to provide these credentials to the
4444
# Used to authorize requests to the Pipedream API
4545
PIPEDREAM_CLIENT_ID=your_client_id
4646
PIPEDREAM_CLIENT_SECRET=your_client_secret
47-
PIPEDREAM_PROJECT_ENVIRONMENT=development
47+
PIPEDREAM_ENVIRONMENT=development
4848
PIPEDREAM_PROJECT_ID=your_project_id
4949
```
5050

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Set the following environment variables:
2323
PIPEDREAM_CLIENT_ID=your_client_id
2424
PIPEDREAM_CLIENT_SECRET=your_client_secret
2525
PIPEDREAM_PROJECT_ID=your_project_id
26-
PIPEDREAM_PROJECT_ENVIRONMENT=development
26+
PIPEDREAM_ENVIRONMENT=development
2727
```
2828

2929
#### Run the MCP server

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

Lines changed: 67 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { Callout, Tabs } from 'nextra/components'
22

33
# Using Pipedream MCP with OpenAI
44

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.
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 any LLM or agent, and Pipedream offers drop-in support for OpenAI.
66

77
<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.
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. [Learn more here](#account-connection).
99
</Callout>
1010

1111
## Getting Started
@@ -27,13 +27,13 @@ Set the following environment variables (learn more about environments in Pipedr
2727
PIPEDREAM_CLIENT_ID=your_client_id
2828
PIPEDREAM_CLIENT_SECRET=your_client_secret
2929
PIPEDREAM_PROJECT_ID=your_project_id
30-
PIPEDREAM_PROJECT_ENVIRONMENT=development
30+
PIPEDREAM_ENVIRONMENT=development
3131
```
3232

3333
### Examples
3434

35-
{/* <Tabs items={['JavaScript', 'Python', 'cURL']}>
36-
<Tabs.Tab> */}
35+
<Tabs items={['JavaScript', 'cURL']}>
36+
<Tabs.Tab>
3737
```javascript
3838
import OpenAI from "openai";
3939
import { createBackendClient } from "@pipedream/sdk/server";
@@ -65,7 +65,7 @@ const response = await client.responses.create({
6565
"server_url": `https://mcp.pipedream.net/${externalUserId}/notion`,
6666
"headers": {
6767
"Authorization": `Bearer ${token}`
68-
}
68+
},
6969
"require_approval": "never"
7070
},
7171
],
@@ -74,41 +74,75 @@ const response = await client.responses.create({
7474

7575
console.log(response);
7676
```
77-
{/* </Tabs.Tab>
78-
<Tabs.Tab>
79-
```python
80-
from openai import OpenAI
81-
client = OpenAI()
82-
83-
response = client.responses.create(
84-
model="gpt-4.1",
85-
tools=[{"type": "web_search_preview"}],
86-
input="What was a positive news story from today?"
87-
)
88-
89-
print(response.output_text)
90-
```
9177
</Tabs.Tab>
9278
<Tabs.Tab>
9379
```bash
94-
curl "https://api.openai.com/v1/responses" \
95-
-H "Content-Type: application/json" \
96-
-H "Authorization: Bearer $OPENAI_API_KEY" \
97-
-d '{
98-
"model": "gpt-4.1",
99-
"tools": [{"type": "web_search_preview"}],
100-
"input": "what was a positive news story from today?"
101-
}'
80+
# Step 1: Authenticate to the Pipedream API
81+
curl -X POST https://api.pipedream.com/v1/oauth/token \
82+
-H "Content-Type: application/json" \
83+
-d '{
84+
"grant_type": "client_credentials",
85+
"client_id": "$PIPEDREAM_CLIENT_ID",
86+
"client_secret": "$PIPEDREAM_CLIENT_SECRET"
87+
}'
88+
89+
# Store the access_token from the response
90+
91+
# Step 2: Get a short-lived Connect Token
92+
curl -X POST https://api.pipedream.com/v1/connect/$PIPEDREAM_PROJECT_ID/tokens \
93+
-H "Content-Type: application/json" \
94+
-H "X-PD-Environment: $PIPEDREAM_ENVIRONMENT" \
95+
-H "Authorization: Bearer $ACCESS_TOKEN" \
96+
-d '{
97+
"external_user_id": "abc-123"
98+
}'
99+
100+
# Store the token from the response
101+
102+
# Step 3: Call OpenAI with the MCP Server
103+
curl -X POST https://api.openai.com/v1/chat/completions \
104+
-H "Content-Type: application/json" \
105+
-H "Authorization: Bearer $OPENAI_API_KEY" \
106+
-d '{
107+
"model": "gpt-4.1",
108+
"messages": [
109+
{
110+
"role": "user",
111+
"content": "Summarize my most recently created Notion doc for me and help draft an email to our customers"
112+
}
113+
],
114+
"tools": [
115+
{
116+
"type": "mcp",
117+
"server_label": "Notion",
118+
"server_url": "https://mcp.pipedream.net/abc-123/notion",
119+
"headers": {
120+
"Authorization": "Bearer $CONNECT_TOKEN"
121+
},
122+
"require_approval": "never"
123+
}
124+
]
125+
}'
102126
```
103127
</Tabs.Tab>
104-
</Tabs> */}
128+
</Tabs>
105129

106130

107131
## Account Connection
108132

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.
133+
One of the core features of Pipedream Connect and our MCP product 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.
134+
135+
You can handle account connections in one of two ways in your app:
110136

111-
You can handle account connections in a couple different ways in your app:
137+
### Add a button in your UI
138+
- Use Pipedream's [frontend SDK](/connect/managed-auth/quickstart/#use-the-pipedream-sdk-in-your-frontend) to let users connect their account directly in your UI
139+
- You can see an example of this when you connect any account in [mcp.pipedream.com](https://mcp.pipedream.com)
112140

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.
141+
### Return a link
142+
- Use [Connect Link ](/connect/managed-auth/quickstart/#or-use-connect-link) to let your users open a Pipedream hosted page to connect their account
143+
- There isn't any implementation required for this option since it's already handled in Pipedream's MCP server
144+
- If a user doesn't have a connected account that's required for a given tool call, we'll return a URL in the tool call response. For example:
145+
146+
```
147+
https://pipedream.com/_static/connect.html?token=ctok_xxxxxxx&connectLink=true&app=notion
148+
```

0 commit comments

Comments
 (0)