-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Danny/mcp hosted servers #16743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Danny/mcp hosted servers #16743
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe documentation for Pipedream's MCP server was extensively revised. The developers' guide was rewritten to provide detailed explanations, improved examples, and new sections on customization and debugging. The OpenAI integration documentation was simplified by consolidating code examples and redirecting users to dedicated sections for in-depth instructions, enhancing clarity and usability. Changes
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 30th. To opt out, configure Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
docs-v2/pages/connect/mcp/openai.mdx (1)
147-149: Avoid duplicate account-connections references
You now have two references to the account-connections section (once in the info callout and again here). To reduce redundancy, consider removing one or redirecting solely from the page’s intro.docs-v2/pages/connect/mcp/developers.mdx (2)
3-3: Consistency in page title punctuation
Consider adding an apostrophe after "Pipedream" for consistency with other docs (e.g.,Add Pipedream’s MCP…) or ensure this style matches the project's headline conventions.
9-9: Grammar: use “on GitHub” instead of “in GitHub”
Change the preposition to improve readability:-Pipedream's MCP server code is [publicly available in GitHub](…) +Pipedream's MCP server code is [publicly available on GitHub](…)🧰 Tools
🪛 LanguageTool
[uncategorized] ~9-~9: The preposition “on” seems more likely in this position than the preposition “in”.
Context: ... MCP server code is [publicly available in GitHub](https://github.com/PipedreamHQ/...(AI_EN_LECTOR_REPLACEMENT_PREPOSITION_IN_ON)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
docs-v2/pages/connect/mcp/developers.mdx(3 hunks)docs-v2/pages/connect/mcp/openai.mdx(3 hunks)
🧰 Additional context used
🪛 LanguageTool
docs-v2/pages/connect/mcp/developers.mdx
[uncategorized] ~9-~9: The preposition “on” seems more likely in this position than the preposition “in”.
Context: ... MCP server code is [publicly available in GitHub](https://github.com/PipedreamHQ/...
(AI_EN_LECTOR_REPLACEMENT_PREPOSITION_IN_ON)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: pnpm publish
- GitHub Check: Lint Code Base
- GitHub Check: validate-links
🔇 Additional comments (18)
docs-v2/pages/connect/mcp/openai.mdx (5)
8-8: Verify account-connections link accuracy
The info callout now points to/connect/mcp/developers/#account-connections. Please confirm that this anchor exists exactly in the developer guide (it currently appears as### Account connections). Consistency ensures the link doesn’t 404.
11-11: Heading level demotion appropriate
Downgrading "Getting started" from a tertiary (###) to a secondary (##) heading improves the hierarchy on this page. Ensure it aligns with the overall site-level heading conventions.
33-34: Ensure environment variable consistency
Great addition ofPIPEDREAM_PROJECT_IDandPIPEDREAM_ENVIRONMENTwith inline comments. Double-check that these names and values match the ones used in your SDK examples and the developer guide to avoid user confusion.
39-39: Simplified discovery link
Replacing the inline discovery examples with a single link to the developer guide streamlines this page effectively. Confirm the/connect/mcp/developers/#discover-available-mcp-serverstarget is correct and up-to-date.
144-144: Trivial closing tag change
This update only adjusts the closing</Tabs>placement. The rendering appears unaffected, so no action is required here.docs-v2/pages/connect/mcp/developers.mdx (13)
1-1: Approve import addition ofTabs
IncludingTabsfromnextra/componentsaligns with the new tabbed code examples. This import is necessary and correct.
11-12: Verify intra-page anchor targets
Links to#use-pipedreams-remote-mcp-serverand#self-host-pipedreams-mcp-servermust exactly match section IDs. Ensure anchors respect dashes and casing so they resolve properly.
18-22: Approveexternal_user_idexplanation
Theexternal_user_idsection clearly explains its purpose and links to the external users API. Good clarity and structure.
24-27: Approveapproute param details
The description of theappparameter and the pointer to discovery instructions are concise and accurate.
29-31: Account connections section clarity
The new "Account connections" section succinctly describes connection methods without code duplication. Well-placed and easy to follow.
63-67: Ensure unified environment variable usage
You've introducedPIPEDREAM_PROJECT_IDandPIPEDREAM_ENVIRONMENThere; confirm they match examples across other docs (e.g., OpenAI page) and the SDK initialization code.
73-83: Approve discover-MCP-servers code examples
The tabbed examples for listing and searching apps are clear, showing both methods. Good use ofTabs.
111-141: Approve authentication code snippets
Node.js and cURL examples for obtaining an access token are well-formatted and accurate. They align with the SDK usage patterns shown earlier.
146-154: Approve required headers section
Listing the necessary HTTP headers, includingx-pd-project-idandx-pd-environment, ensures users won’t miss required metadata.
163-165: Approve Docker self-host instructions
The Docker commands for building and running the MCP server are correct and reference the officialDockerfile.
171-179: Approve server startup commands
Instructions for both Streamable HTTP and SSE transports, along with debug flags, are comprehensive and clear.
196-208: Approve customization guide
The cloning, build, and SSE run steps for customizing the MCP server accurately reference the repo structure and commands.
216-222: Approve MCP inspector instructions
The steps to use the inspector tool, including the CLI command and URL formats for both remote and local servers, are helpful and error-free.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (4)
docs-v2/pages/connect/mcp/developers.mdx (4)
1-1: Remove unused importSteps
TheStepscomponent is imported but never used in this file, which can lead to linter warnings and confusion.-import { Callout, Steps, Tabs } from 'nextra/components' +import { Callout, Tabs } from 'nextra/components'
3-5: Provide a fallback or requirePUBLIC_APPS
The intro interpolates{process.env.PUBLIC_APPS}directly. If this environment variable isn’t set at build time, you’ll see an empty string or a runtime error. Consider either:
- Documenting that
PUBLIC_APPSmust be defined in.env.- Adding a fallback in the MDX, e.g.:
-Add Pipedream's MCP server ... to {process.env.PUBLIC_APPS}+ APIs and 10,000+ tools. +Add Pipedream's MCP server ... to {process.env.PUBLIC_APPS ?? '10,000'}+ APIs and 10,000+ tools.
44-48: IncludePUBLIC_APPSin the environment variables setup
Since the tutorial referencesprocess.env.PUBLIC_APPS, add it to the list of required env vars. For example:Set the following environment variables: ```bash 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 +PUBLIC_APPS=10000 # number of public apps exposed--- `82-87`: **Show `pd` initialization before using `pd.getApps()`** The snippet calls `pd.getApps()` without demonstrating how `pd` was created. Add a brief note or one‐liner to remind users to initialize the client, e.g.: ```diff +// Ensure you’ve initialized the Pipedream client: +// const pd = createBackendClient({ environment: process.env.PIPEDREAM_ENVIRONMENT, credentials: { clientId: process.env.PIPEDREAM_CLIENT_ID, clientSecret: process.env.PIPEDREAM_CLIENT_SECRET }, projectId: process.env.PIPEDREAM_PROJECT_ID }); // Get all available apps (paginated) const apps = await pd.getApps();
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (2)
docs-v2/pages/connect/mcp/developers.mdx(3 hunks)docs-v2/pages/connect/mcp/openai.mdx(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- docs-v2/pages/connect/mcp/openai.mdx
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: pnpm publish
- GitHub Check: Lint Code Base
- GitHub Check: validate-links
| { | ||
| Authorization: `Bearer ${PIPEDREAM_ACCESS_TOKEN}`, | ||
| "x-pd-project-id": PIPEDREAM_PROJECT_ID, // proj_xxxxxxx | ||
| "x-pd-environment": PIPEDREAM_ENVIRONMENT // development | production | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify header variable references
The JavaScript snippet shows bare PIPEDREAM_ACCESS_TOKEN, PIPEDREAM_PROJECT_ID, etc., which aren’t defined. Update to use the accessToken variable and read env vars via process.env:
-{
- Authorization: `Bearer ${PIPEDREAM_ACCESS_TOKEN}`,
- "x-pd-project-id": PIPEDREAM_PROJECT_ID,
- "x-pd-environment": PIPEDREAM_ENVIRONMENT // development | production
-}
+{
+ Authorization: `Bearer ${accessToken}`,
+ "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID,
+ "x-pd-environment": process.env.PIPEDREAM_ENVIRONMENT, // development | production
+}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| { | |
| Authorization: `Bearer ${PIPEDREAM_ACCESS_TOKEN}`, | |
| "x-pd-project-id": PIPEDREAM_PROJECT_ID, // proj_xxxxxxx | |
| "x-pd-environment": PIPEDREAM_ENVIRONMENT // development | production | |
| } | |
| { | |
| Authorization: `Bearer ${accessToken}`, | |
| "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID, | |
| "x-pd-environment": process.env.PIPEDREAM_ENVIRONMENT, // development | production | |
| } |
🤖 Prompt for AI Agents
In docs-v2/pages/connect/mcp/developers.mdx around lines 155 to 159, the code
snippet uses undefined variables like PIPEDREAM_ACCESS_TOKEN and
PIPEDREAM_PROJECT_ID directly. Update the snippet to use the variable
accessToken for the token and access environment variables via process.env for
project ID and environment, ensuring the example is clear and functional.
|
|
||
| Pipedream's MCP servers can run in two modes: | ||
| // 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 | ||
| }); | ||
|
|
||
| ##### Stdio (for local testing) | ||
| // Get access token for MCP server auth | ||
| const accessToken = await pd.rawAccessToken(); | ||
|
|
||
| console.log(accessToken); | ||
| ``` | ||
| </Tabs.Tab> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix Node.js snippet to read from process.env and handle await correctly
As written, the snippet references bare identifiers (PIPEDREAM_*) which will cause ReferenceError. Also, top-level await requires an ES module context. Proposed diff:
-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 access token for MCP server auth
-const accessToken = await pd.rawAccessToken();
-
-console.log(accessToken);
+import { createBackendClient } from "@pipedream/sdk/server";
+
+// Example assumes ES module with top‐level await enabled
+const pd = createBackendClient({
+ environment: process.env.PIPEDREAM_ENVIRONMENT,
+ credentials: {
+ clientId: process.env.PIPEDREAM_CLIENT_ID,
+ clientSecret: process.env.PIPEDREAM_CLIENT_SECRET,
+ },
+ projectId: process.env.PIPEDREAM_PROJECT_ID,
+});
+
+// Retrieve and log the access token
+const accessToken = await pd.rawAccessToken();
+console.log(accessToken);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import { createBackendClient } from "@pipedream/sdk/server"; | |
| Pipedream's MCP servers can run in two modes: | |
| // 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 | |
| }); | |
| ##### Stdio (for local testing) | |
| // Get access token for MCP server auth | |
| const accessToken = await pd.rawAccessToken(); | |
| console.log(accessToken); | |
| ``` | |
| import { createBackendClient } from "@pipedream/sdk/server"; | |
| // Example assumes ES module with top-level await enabled | |
| const pd = createBackendClient({ | |
| environment: process.env.PIPEDREAM_ENVIRONMENT, | |
| credentials: { | |
| clientId: process.env.PIPEDREAM_CLIENT_ID, | |
| clientSecret: process.env.PIPEDREAM_CLIENT_SECRET, | |
| }, | |
| projectId: process.env.PIPEDREAM_PROJECT_ID, | |
| }); | |
| // Retrieve and log the access token | |
| const accessToken = await pd.rawAccessToken(); | |
| console.log(accessToken); |
🤖 Prompt for AI Agents
In docs-v2/pages/connect/mcp/developers.mdx around lines 119 to 135, the Node.js
snippet incorrectly uses bare identifiers for environment variables and
top-level await without an async context. Fix this by replacing all
`PIPEDREAM_*` variables with `process.env.PIPEDREAM_*` to correctly access
environment variables. Also, wrap the asynchronous code inside an async function
or use an immediately invoked async function expression to properly handle the
await keyword.
| -H "Content-Type: application/json" \ | ||
| -d '{ | ||
| "grant_type": "client_credentials", | ||
| "client_id": "'$PIPEDREAM_CLIENT_ID'", | ||
| "client_secret": "'$PIPEDREAM_CLIENT_SECRET'" | ||
| }' | ||
| ``` | ||
| </Tabs.Tab> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct quoting in the cURL -d payload
Single-quoted strings in Bash do not expand variables. Change to double quotes and escape inner quotes so ${PIPEDREAM_*} is interpolated correctly:
-curl -s -X POST https://api.pipedream.com/v1/oauth/token \
- -H "Content-Type: application/json" \
- -d '{
- "grant_type": "client_credentials",
- "client_id": "'$PIPEDREAM_CLIENT_ID'",
- "client_secret": "'$PIPEDREAM_CLIENT_SECRET'"
- }'
+curl -s -X POST https://api.pipedream.com/v1/oauth/token \
+ -H "Content-Type: application/json" \
+ -d "{
+ \"grant_type\": \"client_credentials\",
+ \"client_id\": \"${PIPEDREAM_CLIENT_ID}\",
+ \"client_secret\": \"${PIPEDREAM_CLIENT_SECRET}\"
+ }"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| curl -s -X POST https://api.pipedream.com/v1/oauth/token \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "grant_type": "client_credentials", | |
| "client_id": "'$PIPEDREAM_CLIENT_ID'", | |
| "client_secret": "'$PIPEDREAM_CLIENT_SECRET'" | |
| }' | |
| ``` | |
| curl -s -X POST https://api.pipedream.com/v1/oauth/token \ | |
| -H "Content-Type: application/json" \ | |
| -d "{ | |
| \"grant_type\": \"client_credentials\", | |
| \"client_id\": \"${PIPEDREAM_CLIENT_ID}\", | |
| \"client_secret\": \"${PIPEDREAM_CLIENT_SECRET}\" | |
| }" |
🤖 Prompt for AI Agents
In docs-v2/pages/connect/mcp/developers.mdx around lines 139 to 146, the cURL
command uses single quotes around the JSON payload, preventing Bash from
expanding the environment variables. Change the outer quotes to double quotes
and escape the inner double quotes properly so that the ${PIPEDREAM_CLIENT_ID}
and ${PIPEDREAM_CLIENT_SECRET} variables are correctly interpolated in the
payload.
WHY
Summary by CodeRabbit