Skip to content

Commit 3e8d52f

Browse files
committed
fix: mcp app not found error
1 parent 6e6a941 commit 3e8d52f

File tree

5 files changed

+20
-142
lines changed

5 files changed

+20
-142
lines changed

backend/pipedream/api.py

Lines changed: 4 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -354,34 +354,10 @@ async def get_available_pipedream_tools(
354354

355355
@router.get("/apps", response_model=Dict[str, Any])
356356
async def get_pipedream_apps(
357-
page: int = Query(1, ge=1),
358357
search: Optional[str] = Query(None),
359358
category: Optional[str] = Query(None)
360359
):
361-
logger.info(f"Fetching Pipedream apps registry, page: {page}")
362-
363-
# Curated list of featured apps (shown first) - verified through discovery script
364-
# Ordered by popularity (featured_weight) and category diversity
365-
FEATURED_APPS = [
366-
# Top productivity & collaboration (1M+ weight)
367-
"notion", "google_sheets", "google_drive", "google_calendar",
368-
"supabase", "slack", "microsoft_teams",
369-
370-
# Development & databases (100K+ weight)
371-
"github", "aws", "stripe", "salesforce_rest_api", "hubspot",
372-
"woocommerce", "mongodb", "mysql", "postgresql",
373-
374-
# Communication & marketing (10K+ weight)
375-
"gmail", "telegram_bot_api", "sendgrid", "klaviyo", "zendesk",
376-
"zoom", "twilio", "discord", "mailchimp",
377-
378-
# Forms, productivity & file storage
379-
"airtable_oauth", "typeform", "google_forms", "dropbox",
380-
"trello", "asana", "jira", "todoist", "clickup",
381-
382-
# E-commerce & design
383-
"shopify_developer_app", "figma", "linkedin", "google_analytics"
384-
]
360+
logger.info(f"Fetching Pipedream apps registry")
385361

386362
try:
387363
from pipedream.client import get_pipedream_client
@@ -400,10 +376,6 @@ async def get_pipedream_apps(
400376
params = {}
401377
if search:
402378
params["q"] = search # Pipedream API uses 'q' for search
403-
if page > 1:
404-
# Pipedream API uses cursor-based pagination, not page numbers
405-
# For now, we'll just return the first page
406-
logger.warning(f"Page {page} requested, but Pipedream API uses cursor-based pagination. Returning first page.")
407379

408380
session = await client._get_session()
409381
response = await session.get(url, headers=headers, params=params)
@@ -412,38 +384,11 @@ async def get_pipedream_apps(
412384
data = response.json()
413385
apps = data.get("data", [])
414386

415-
# Apply curation logic (only if no search query to preserve search results)
416-
if not search:
417-
# Separate featured and non-featured apps
418-
featured_apps = []
419-
other_apps = []
420-
featured_slugs = set(FEATURED_APPS)
421-
422-
for app in apps:
423-
app_slug = app.get("name_slug", "").lower()
424-
if app_slug in featured_slugs:
425-
featured_apps.append(app)
426-
else:
427-
other_apps.append(app)
428-
429-
# Sort featured apps by the order in FEATURED_APPS list
430-
featured_apps.sort(key=lambda app: FEATURED_APPS.index(app.get("name_slug", "").lower())
431-
if app.get("name_slug", "").lower() in FEATURED_APPS else len(FEATURED_APPS))
432-
433-
# Combine: featured first, then others
434-
curated_apps = featured_apps + other_apps
435-
436-
logger.info(f"Applied curation: {len(featured_apps)} featured apps, {len(other_apps)} other apps")
437-
else:
438-
curated_apps = apps
439-
logger.info(f"Search query provided, skipping curation")
440-
441-
logger.info(f"Successfully fetched {len(curated_apps)} apps from Pipedream registry")
387+
logger.info(f"Successfully fetched {len(apps)} apps from Pipedream registry")
442388
return {
443389
"success": True,
444-
"apps": curated_apps,
445-
"page_info": data.get("page_info", {}),
446-
"total_count": data.get("page_info", {}).get("total_count", 0)
390+
"apps": apps,
391+
"total_count": len(apps)
447392
}
448393

449394
except Exception as e:

frontend/src/components/integrations/pipedream/pipedream-registry.tsx

Lines changed: 10 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useState, useMemo } from 'react';
22
import { Button } from '@/components/ui/button';
33
import { Input } from '@/components/ui/input';
44
import { Card, CardContent } from '@/components/ui/card';
5-
import { Badge } from '@/components/ui/badge';
5+
66
import { Search, Loader2, ExternalLink, Zap, User, CheckCircle2, Plus } from 'lucide-react';
77
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from '@/components/ui/dialog';
88
import { usePipedreamApps } from '@/hooks/react-query/pipedream/use-pipedream';
@@ -28,15 +28,15 @@ export const PipedreamRegistry: React.FC<PipedreamRegistryProps> = ({
2828
}) => {
2929
const [search, setSearch] = useState('');
3030
const [selectedCategory] = useState<string>(''); // Category filtering removed - always show all apps
31-
const [page, setPage] = useState(1);
31+
3232
// Removed viewMode - using consistent grid layout
3333
const [showToolSelector, setShowToolSelector] = useState(false);
3434
const [selectedProfile, setSelectedProfile] = useState<PipedreamProfile | null>(null);
3535
const [showProfileManager, setShowProfileManager] = useState(false);
3636
const [selectedAppForProfile, setSelectedAppForProfile] = useState<{ app_slug: string; app_name: string } | null>(null);
3737

3838
const queryClient = useQueryClient();
39-
const { data: appsData, isLoading, error, refetch } = usePipedreamApps(page, search, selectedCategory);
39+
const { data: appsData, isLoading, error, refetch } = usePipedreamApps(search, selectedCategory);
4040
const { data: profiles } = usePipedreamProfiles();
4141

4242
// Removed allAppsData query - no longer needed without category filtering
@@ -45,7 +45,6 @@ export const PipedreamRegistry: React.FC<PipedreamRegistryProps> = ({
4545

4646
const handleSearch = (value: string) => {
4747
setSearch(value);
48-
setPage(1);
4948
};
5049

5150
const handleSearchSubmit = (e: React.FormEvent) => {
@@ -189,14 +188,7 @@ export const PipedreamRegistry: React.FC<PipedreamRegistryProps> = ({
189188
{app.description}
190189
</p>
191190

192-
{/* Featured Badge */}
193-
{app.featured_weight > 100000 && (
194-
<div className="mb-4">
195-
<Badge variant="default" className="text-xs bg-primary/10 text-primary border-primary/20">
196-
Featured
197-
</Badge>
198-
</div>
199-
)}
191+
200192

201193
{/* Connection Status */}
202194
<div className="mt-auto">
@@ -287,62 +279,13 @@ export const PipedreamRegistry: React.FC<PipedreamRegistryProps> = ({
287279

288280
{!isLoading && appsData?.apps && appsData.apps.length > 0 && (
289281
<>
290-
{/* Featured Apps Section - only show on first page with no search */}
291-
{page === 1 && !search && (
292-
<>
293-
<div className="mb-8">
294-
<div className="flex items-center gap-2 mb-4">
295-
<h3 className="text-lg font-semibold text-foreground">Featured Apps</h3>
296-
<Badge variant="outline" className="text-xs">Popular</Badge>
297-
</div>
298-
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 gap-4 max-w-full">
299-
{appsData.apps.filter(app => app.featured_weight > 100000).slice(0, 8).map((app: PipedreamApp) => (
300-
<AppCard key={`featured-${app.id}`} app={app} />
301-
))}
302-
</div>
303-
</div>
304-
305-
{/* All Apps Section */}
306-
<div className="mb-6">
307-
<h3 className="text-lg font-semibold text-foreground mb-4">All Apps</h3>
308-
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 gap-4 max-w-full">
309-
{appsData.apps.map((app: PipedreamApp) => (
310-
<AppCard key={app.id} app={app} />
311-
))}
312-
</div>
313-
</div>
314-
</>
315-
)}
316-
317-
{/* Regular view for search results or subsequent pages */}
318-
{(page > 1 || search) && (
319-
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 gap-4 max-w-full">
320-
{appsData.apps.map((app: PipedreamApp) => (
321-
<AppCard key={app.id} app={app} />
322-
))}
323-
</div>
324-
)}
282+
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 gap-4 max-w-full">
283+
{appsData.apps.map((app: PipedreamApp) => (
284+
<AppCard key={app.id} app={app} />
285+
))}
286+
</div>
287+
325288

326-
{appsData.page_info && appsData.page_info.end_cursor && (
327-
<div className="flex justify-center pt-8">
328-
<Button
329-
onClick={() => setPage(page + 1)}
330-
disabled={isLoading}
331-
variant="default"
332-
size="lg"
333-
className="px-8 py-2 bg-primary hover:bg-primary/90 text-primary-foreground"
334-
>
335-
{isLoading ? (
336-
<>
337-
<Loader2 className="h-4 w-4 animate-spin mr-2" />
338-
Loading more apps...
339-
</>
340-
) : (
341-
'Load More Apps'
342-
)}
343-
</Button>
344-
</div>
345-
)}
346289
</>
347290
)}
348291

@@ -357,7 +300,6 @@ export const PipedreamRegistry: React.FC<PipedreamRegistryProps> = ({
357300
<Button
358301
onClick={() => {
359302
setSearch('');
360-
setPage(1);
361303
}}
362304
variant="default"
363305
className="px-6"

frontend/src/hooks/react-query/pipedream/keys.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export const pipedreamKeys = {
66
config: () => [...pipedreamKeys.all, 'config'] as const,
77
workflows: () => [...pipedreamKeys.all, 'workflows'] as const,
88
workflowRuns: (workflowId: string) => [...pipedreamKeys.all, 'workflow-runs', workflowId] as const,
9-
apps: (page: number, search?: string, category?: string) => [...pipedreamKeys.all, 'apps', page, search || '', category || ''] as const,
10-
appsSearch: (query: string, page: number, category?: string) => [...pipedreamKeys.all, 'apps', 'search', query, page, category || ''] as const,
9+
apps: (search?: string, category?: string) => [...pipedreamKeys.all, 'apps', search || '', category || ''] as const,
10+
appsSearch: (query: string, category?: string) => [...pipedreamKeys.all, 'apps', 'search', query, category || ''] as const,
1111
availableTools: () => [...pipedreamKeys.all, 'available-tools'] as const,
1212
mcpDiscovery: (options?: { app_slug?: string; oauth_app_id?: string; custom?: boolean }) =>
1313
[...pipedreamKeys.all, 'mcp-discovery', options?.app_slug, options?.oauth_app_id, options?.custom] as const,

frontend/src/hooks/react-query/pipedream/use-pipedream.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ export const usePipedreamHealthCheck = () => {
6262
});
6363
};
6464

65-
export const usePipedreamApps = (page = 1, search?: string, category?: string) => {
65+
export const usePipedreamApps = (search?: string, category?: string) => {
6666
const pipedreamApi = usePipedreamApi();
6767
const { disableWindowFocus, disableMount, disableReconnect, disableInterval } = useRefetchControl();
6868

6969
return useQuery({
70-
queryKey: pipedreamKeys.apps(page, search, category),
71-
queryFn: () => pipedreamApi.getApps(page, search, category),
70+
queryKey: pipedreamKeys.apps(search, category),
71+
queryFn: () => pipedreamApi.getApps(search, category),
7272
staleTime: 10 * 60 * 1000, // 10 minutes
7373
refetchOnWindowFocus: !disableWindowFocus,
7474
refetchOnMount: !disableMount,

frontend/src/hooks/react-query/pipedream/utils.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ export interface PipedreamApp {
106106
name_slug: string;
107107
description: string;
108108
categories: string[];
109-
featured_weight: number;
110109
auth_type: string;
111110
img_src?: string; // Official Pipedream app icon URL
112111
custom_fields_json: string;
@@ -120,12 +119,6 @@ export interface PipedreamApp {
120119
export interface PipedreamAppResponse {
121120
success: boolean;
122121
apps: PipedreamApp[];
123-
page_info: {
124-
total_count: number;
125-
count: number;
126-
start_cursor?: string;
127-
end_cursor?: string;
128-
};
129122
total_count: number;
130123
}
131124

@@ -321,11 +314,10 @@ export const usePipedreamApi = () => {
321314

322315
// App Discovery
323316
async getApps(
324-
page = 1,
325317
search?: string,
326318
category?: string
327319
): Promise<PipedreamAppResponse> {
328-
const queryParams = new URLSearchParams({ page: page.toString() });
320+
const queryParams = new URLSearchParams();
329321
if (search) queryParams.append('search', search);
330322
if (category) queryParams.append('category', category);
331323

@@ -502,7 +494,6 @@ export const pipedreamApi = {
502494

503495
// App Discovery
504496
async getApps(
505-
page = 1,
506497
search?: string,
507498
category?: string
508499
): Promise<PipedreamAppResponse> {

0 commit comments

Comments
 (0)