Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions docs-v2/pages/connect/mcp/_meta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@ export default {
"index": "Overview",
"developers": "Developers",
"users": "Consumers",
"openai": {
title: "OpenAI",
display: "hidden",
},
"openai": "OpenAI",
} as const
88 changes: 57 additions & 31 deletions docs-v2/pages/connect/mcp/developers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ PIPEDREAM_PROJECT_ID=your_project_id # proj_xxxxxxx
PIPEDREAM_ENVIRONMENT=development # development | production
```

Learn more about [environments in Pipedream Connect](/connect/managed-auth/environments).

### Authentication

#### Developer authentication
Expand Down Expand Up @@ -79,6 +81,18 @@ Pipedream provides [{process.env.PUBLIC_APPS}+ APIs as MCP servers](https://mcp.
<Tabs items={['List all apps', 'Search for a specific app']}>
<Tabs.Tab>
```javascript
import { createBackendClient } from "@pipedream/sdk/server";

// Initialize the Pipedream client with the SDK
const pd = createBackendClient({
environment: PIPEDREAM_ENVIRONMENT,
credentials: {
clientId: PIPEDREAM_CLIENT_ID,
clientSecret: PIPEDREAM_CLIENT_SECRET,
},
projectId: PIPEDREAM_PROJECT_ID
});

// Get all available apps (paginated)
const apps = await pd.getApps();

Expand All @@ -89,6 +103,18 @@ const apps = await pd.getApps();
</Tabs.Tab>
<Tabs.Tab>
```javascript
import { createBackendClient } from "@pipedream/sdk/server";

// Initialize the Pipedream client with the SDK
const pd = createBackendClient({
environment: PIPEDREAM_ENVIRONMENT,
credentials: {
clientId: PIPEDREAM_CLIENT_ID,
clientSecret: PIPEDREAM_CLIENT_SECRET,
},
projectId: PIPEDREAM_PROJECT_ID
});

// Search by app name
const notionApps = await pd.getApps({ q: "notion" });
const gmailApps = await pd.getApps({ q: "gmail" });
Expand All @@ -100,13 +126,17 @@ const slackApps = await pd.getApps({ q: "slack" });
### Use Pipedream's remote MCP server

<Callout type="info">
Pipedream MCP server supports both SSE and streamable HTTP transport types, with no configuration required by the developer or MCP client.
The remote MCP server is in beta, and we're looking for feedback. During the beta, the API is subject to change.
</Callout>

#### Supported transport types

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

#### Base URL

```
https://mcp.pipedream.net
https://remote.mcp.pipedream.net
```

#### API Authentication
Expand Down Expand Up @@ -161,61 +191,57 @@ Include these headers in every HTTP request:

### Self-host Pipedream's MCP server

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

- `GET /:external_user_id/:app` - App-specific connection endpoint
- `POST /:external_user_id/:app/messages` - App-specific message handler

#### Using the `Dockerfile`

If you have Docker installed locally, you can build and run the container from the [reference implementation](https://github.com/PipedreamHQ/pipedream/blob/master/modelcontextprotocol/Dockerfile):
You can build and run the container from the [reference implementation](https://github.com/PipedreamHQ/pipedream/blob/master/modelcontextprotocol/Dockerfile):

```console
> docker build -t pipedream-connect .
> docker run -d --name pd-mcp -p 3010:3010 --env-file .env pipedream-connect:latest
```

This exposes a generic MCP server at [http://localhost:3010/:external_user_id/:app](http://localhost:3010/:external_user_id/:app).

#### Start the server with Streamable HTTP Transport

```bash
pnpm dev:http
```

You can use the optional env var `PD_SDK_DEBUG` to print out all the requests and responses going to the Connect API:

```bash
PD_SDK_DEBUG=true pnpm dev:http
```

#### Start the server with SSE
#### Running the server using npx

```bash
npx @pipedream/mcp sse
```

This exposes routes at:
- `GET /:external_user_id/:app` - App-specific SSE connection endpoint
- `POST /:external_user_id/:app/messages` - App-specific message handler
<Callout type="warning">
The current npx package only supports the `sse` transport type, `http` is coming soon.
</Callout>

#### Customize for your needs
#### Running the server locally

You can also host and customize the MCP server for your specific requirements:
You can also run the server locally and even customize the MCP server for your specific requirements:

```bash
# Clone the repo
git clone https://github.com/PipedreamHQ/pipedream
cd pipedream/modelcontextprotocol

# Install dependencies
npm install
pnpm install

# Build
npm run build

# Run the SSE server
npm run start:sse:prod
# Start the server
pnpm dev:http
```

See the [MCP server README](https://github.com/PipedreamHQ/pipedream/blob/master/modelcontextprotocol/README.md) for detailed instructions on customization options.

### Use the MCP inspector
#### Debugging

You can use the optional env var `PD_SDK_DEBUG` to print out all the requests and responses going to the Connect API:

```bash
PD_SDK_DEBUG=true pnpm dev:http
```

### Using the MCP inspector

The [MCP inspector](https://modelcontextprotocol.io/docs/tools/inspector) can be helpful when debugging tool calls.

Expand All @@ -228,7 +254,7 @@ Enter the server URL:
If using Pipedream's remote server:

```
https://mcp.pipedream.net/{external_user_id}/{app_slug}
https://remote.mcp.pipedream.net/{external_user_id}/{app_slug}
```

If running locally:
Expand Down
4 changes: 2 additions & 2 deletions docs-v2/pages/connect/mcp/openai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const response = await client.responses.create({
{
type: 'mcp',
server_label: 'Notion',
server_url: `https://mcp.pipedream.net/${externalUserId}/${appSlug}`,
server_url: `https://remote.mcp.pipedream.net/${externalUserId}/${appSlug}`,
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": PIPEDREAM_PROJECT_ID,
Expand Down Expand Up @@ -129,7 +129,7 @@ curl -X POST https://api.openai.com/v1/chat/completions \
{
"type": "mcp",
"server_label": "Notion",
"server_url": "https://mcp.pipedream.net/abc-123/'$APP_SLUG'",
"server_url": "https://remote.mcp.pipedream.net/abc-123/'$APP_SLUG'",
"headers": {
"Authorization": "Bearer '"$ACCESS_TOKEN"'",
"x-pd-project-id": "$PIPEDREAM_PROJECT_ID",
Expand Down
16 changes: 12 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading