Skip to content

Commit 3513b5b

Browse files
Danny/another mcp hosted server docs patch (#16756)
* Update developers.mdx * pnpm-lock * Cleaning up remote server code snippet * Update pnpm-lock.yaml * Update openai.mdx * Update developers.mdx
1 parent 024cfe2 commit 3513b5b

File tree

3 files changed

+34
-13
lines changed

3 files changed

+34
-13
lines changed

docs-v2/pages/connect/components.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Before sending requests to the API, make sure to [authenticate using a Pipedream
4545
<Tabs items={['Node.js', 'HTTP (cURL)']}>
4646
<Tabs.Tab>
4747
```javascript
48-
// Initialize the Pipedream client with the SDK
48+
// Initialize the Pipedream SDK client
4949

5050
import { createBackendClient } from "@pipedream/sdk/server";
5151

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

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Pipedream provides [{process.env.PUBLIC_APPS}+ APIs as MCP servers](https://mcp.
8383
```javascript
8484
import { createBackendClient } from "@pipedream/sdk/server";
8585

86-
// Initialize the Pipedream client with the SDK
86+
// Initialize the Pipedream SDK client
8787
const pd = createBackendClient({
8888
environment: PIPEDREAM_ENVIRONMENT,
8989
credentials: {
@@ -105,7 +105,7 @@ const apps = await pd.getApps();
105105
```javascript
106106
import { createBackendClient } from "@pipedream/sdk/server";
107107

108-
// Initialize the Pipedream client with the SDK
108+
// Initialize the Pipedream SDK client
109109
const pd = createBackendClient({
110110
environment: PIPEDREAM_ENVIRONMENT,
111111
credentials: {
@@ -148,7 +148,7 @@ To authenticate requests to Pipedream's MCP server, you need to include an acces
148148
```javascript
149149
import { createBackendClient } from "@pipedream/sdk/server";
150150

151-
// Initialize the Pipedream client with the SDK
151+
// Initialize the Pipedream SDK client
152152
const pd = createBackendClient({
153153
environment: PIPEDREAM_ENVIRONMENT,
154154
credentials: {
@@ -182,19 +182,40 @@ curl -s -X POST https://api.pipedream.com/v1/oauth/token \
182182
Include these headers in every HTTP request:
183183

184184
```javascript
185-
{
186-
Authorization: `Bearer ${PIPEDREAM_ACCESS_TOKEN}`,
187-
"x-pd-project-id": PIPEDREAM_PROJECT_ID, // proj_xxxxxxx
188-
"x-pd-environment": PIPEDREAM_ENVIRONMENT // development | production
189-
}
185+
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
186+
import { createBackendClient } from "@pipedream/sdk/server";
187+
188+
// Initialize the Pipedream SDK client
189+
const pd = createBackendClient({
190+
environment: PIPEDREAM_ENVIRONMENT,
191+
credentials: {
192+
clientId: PIPEDREAM_CLIENT_ID,
193+
clientSecret: PIPEDREAM_CLIENT_SECRET,
194+
},
195+
projectId: PIPEDREAM_PROJECT_ID
196+
});
197+
198+
// Retrieve your developer access token via the Pipedream SDK
199+
const accessToken = await pd.rawAccessToken();
200+
const serverUrl = process.env.MCP_SERVER_URL || "https://remote.mcp.pipedream.net";
201+
202+
const transport = new StreamableHTTPClientTransport(new URL(serverUrl), {
203+
requestInit: {
204+
headers: {
205+
"Authorization": `Bearer ${accessToken}`,
206+
"x-pd-project-id": PIPEDREAM_PROJECT_ID, // proj_xxxxxxx
207+
"x-pd-environment": PIPEDREAM_ENVIRONMENT // development | production
208+
}
209+
}
210+
});
190211
```
191212

192213
### Self-host Pipedream's MCP server
193214

194215
Hosting the MCP server locally or in your app will expose these routes:
195216

196-
- `GET /:external_user_id/:app` - App-specific connection endpoint
197-
- `POST /:external_user_id/:app/messages` - App-specific message handler
217+
- `GET /:external_user_id/:app`: app-specific connection endpoint
218+
- `POST /:external_user_id/:app/messages`: app-specific message handler
198219

199220
#### Using the `Dockerfile`
200221

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Callout, Tabs, Steps } 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 Connect. MCP makes it easy to extend the capabilities of any LLM or agent, and Pipedream offers drop-in support for [calling tools in OpenAI](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 Connect. MCP makes it easy to extend the capabilities of any LLM or agent, and Pipedream offers drop-in support for [calling tools in OpenAI](https://platform.openai.com/docs/guides/tools-remote-mcp).
66

77
<Callout type="info">
88
Pipedream Connect includes built-in user authentication for [every MCP server](https://mcp.pipedream.com), 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. [Learn more here](/connect/mcp/developers/#user-account-connections).
@@ -51,7 +51,7 @@ Below is an end to end example showing how to:
5151
import OpenAI from 'openai';
5252
import { createBackendClient } from "@pipedream/sdk/server";
5353

54-
// Initialize the Pipedream client with the SDK
54+
// Initialize the Pipedream SDK client
5555
const pd = createBackendClient({
5656
environment: PIPEDREAM_ENVIRONMENT,
5757
credentials: {

0 commit comments

Comments
 (0)