Skip to content

Commit da55c2a

Browse files
authored
feature: add Neon and Browserbase MCP support (#947)
1 parent 7fc1158 commit da55c2a

File tree

14 files changed

+147
-23
lines changed

14 files changed

+147
-23
lines changed

apps/web/src/app/(private)/settings/integrations/[integrationId]/details/_components/McpServerLogsModal.tsx

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
CodeBlock,
99
AnimatedDots,
1010
CloseTrigger,
11+
Button,
1112
} from '@latitude-data/web-ui'
1213
import { ROUTES } from '$/services/routes'
1314
import useMcpLogs from '$/stores/mcpLogs'
@@ -30,7 +31,13 @@ export function McpServerLogsModal({ integrationId }: McpServerLogsModalProps) {
3031
const mcpServerId = integration?.mcpServerId?.toString() || null
3132

3233
// Use the mcpLogs hook to fetch logs
33-
const { logs, isLoading, error } = useMcpLogs(mcpServerId)
34+
const {
35+
data,
36+
isLoading,
37+
isValidating,
38+
error,
39+
mutate: refresh,
40+
} = useMcpLogs(mcpServerId)
3441

3542
// Handle close
3643
const handleClose = () => {
@@ -52,7 +59,24 @@ export function McpServerLogsModal({ integrationId }: McpServerLogsModalProps) {
5259
title={integration.name}
5360
description='Here is the status of your integration and its latest logs.'
5461
size='large'
55-
footer={<CloseTrigger />}
62+
footer={
63+
<>
64+
<Button
65+
fancy
66+
variant='outline'
67+
onClick={() => refresh()}
68+
iconProps={{
69+
name: 'refresh',
70+
placement: 'left',
71+
spin: isValidating,
72+
}}
73+
disabled={isLoading || isValidating}
74+
>
75+
Refresh logs
76+
</Button>
77+
<CloseTrigger />
78+
</>
79+
}
5680
>
5781
<div className='flex flex-col gap-4'>
5882
<McpServerStatus mcpServerId={integration?.mcpServerId || undefined} />
@@ -69,13 +93,13 @@ export function McpServerLogsModal({ integrationId }: McpServerLogsModalProps) {
6993
An unknown error occurred
7094
</Text.H6>
7195
</div>
72-
) : logs.length === 0 ? (
73-
<div className='text-center p-4'>
96+
) : data.logs.length === 0 ? (
97+
<div className='text-center p-4 flex flex-col items-center gap-4'>
7498
<Text.H6 color='foregroundMuted'>No logs available</Text.H6>
7599
</div>
76100
) : (
77101
<div className='h-full rounded-lg overflow-auto'>
78-
<CodeBlock language='log'>{logs}</CodeBlock>
102+
<CodeBlock language='log'>{data.logs}</CodeBlock>
79103
</div>
80104
))}
81105
</div>

apps/web/src/app/(private)/settings/integrations/[integrationId]/details/_components/McpServerStatus.tsx

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,27 @@ export function McpServerStatus({
4040
const statusVariant = getStatusVariant(mcpServer.status)
4141

4242
return (
43-
<div className='flex items-center gap-2'>
44-
<Text.H5 color='foregroundMuted'>
45-
{short ? '' : 'MCP server status: '}
46-
{capitalize(mcpServer.status)}{' '}
47-
</Text.H5>
48-
<DotIndicator pulse variant={statusVariant} />
43+
<div className='flex flex-col gap-1'>
44+
<div className='flex items-center gap-2'>
45+
<Text.H5 color='foregroundMuted'>
46+
{short ? '' : 'MCP server status: '}
47+
{capitalize(mcpServer.status)}{' '}
48+
</Text.H5>
49+
<DotIndicator pulse variant={statusVariant} />
50+
</div>
51+
52+
{!short && mcpServer.status === 'failed' && (
53+
<Text.H6 color='foregroundMuted'>
54+
Deployment failed. Check the logs for more details. We'll
55+
automatically attempt to redeploy in a few seconds.
56+
</Text.H6>
57+
)}
58+
59+
{!short && mcpServer.status === 'deploying' && (
60+
<Text.H6 color='foregroundMuted'>
61+
Deployment in progress. This should complete in a few seconds.
62+
</Text.H6>
63+
)}
4964
</div>
5065
)
5166
}

apps/web/src/lib/integrationTypeOptions.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ export const HOSTED_INTEGRATION_TYPE_OPTIONS: Record<
116116
label: 'Time',
117117
icon: 'clock',
118118
},
119+
[HostedIntegrationType.browserbase]: {
120+
label: 'browserbase',
121+
icon: 'browserbase',
122+
},
123+
[HostedIntegrationType.Neon]: {
124+
label: 'Neon',
125+
icon: 'neon',
126+
},
119127
}
120128

121129
export function integrationOptions(

apps/web/src/stores/mcpLogs.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,17 @@ export default function useMcpLogs(
2525
{ fallback: { logs: '' } },
2626
)
2727

28-
const {
29-
data = { logs: '' },
30-
isLoading,
31-
error,
32-
} = useSWR<McpLogsResponse>(
28+
const { data = { logs: '' }, ...rest } = useSWR<McpLogsResponse>(
3329
mcpServerId ? ['mcpLogs', mcpServerId, options] : null,
3430
fetcher,
3531
{
36-
refreshInterval: 10000, // Default to 10 seconds
32+
fallbackData: { logs: '' },
3733
...swrConfig,
3834
},
3935
)
4036

4137
return {
42-
logs: data.logs,
43-
isLoading,
44-
error,
38+
data,
39+
...rest,
4540
}
4641
}

packages/constants/src/integrations.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ export enum HostedIntegrationType {
3131
// SequentialThinking = 'sequential_thinking', // useless
3232
Time = 'time',
3333

34+
browserbase = 'browserbase',
35+
Neon = 'neon',
36+
37+
// Gmail = 'google_drive', // env vars not supported, requires auth file
38+
// GoogleCalendar = 'google_drive', // env vars not supported, requires auth file
3439
// GoogleDrive = 'google_drive', // env vars not supported, requires auth file
3540
// Postgres = 'postgres', // Uses a custom parameter in the command instead of env vars
3641
// Redis = 'redis', // Uses a custom parameter in the command instead of env vars

packages/core/src/lib/chainStreamManager/resolveTools/integrationTools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export async function resolveIntegrationTools({
5757
mcpTools.map((mcpTool) => [
5858
mcpTool.name,
5959
{
60-
description: mcpTool.description ?? '',
60+
description: mcpTool?.description?.slice(0, 1023) ?? '',
6161
parameters: mcpTool.inputSchema,
6262
},
6363
]),
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { HostedIntegrationConfig } from '../types'
2+
3+
export default {
4+
description: 'Integrates the Browserbase API, a headless web browser.',
5+
command: 'node mcps/mcp-server-browserbase/browserbase/dist/index.js',
6+
env: {
7+
BROWSERBASE_PROJECT_ID: {
8+
label: 'Browserbase Project ID',
9+
description: 'The Project ID for the Browserbase API',
10+
placeholder: 'your-project-id',
11+
required: true,
12+
},
13+
BROWSERBASE_API_KEY: {
14+
label: 'Browserbase API Key',
15+
description: 'The API key for the Browserbase API',
16+
placeholder: 'your-api-key',
17+
required: true,
18+
},
19+
},
20+
envSource:
21+
'https://docs.browserbase.com/introduction/getting-started#overview-dashboard',
22+
} as HostedIntegrationConfig
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { HostedIntegrationConfig } from '../types'
2+
3+
export default {
4+
description: 'Integrates with Neon, serverless postgres.',
5+
command: 'npx @neondatabase/mcp-server-neon start $NEON_API_KEY',
6+
env: {
7+
NEON_API_KEY: {
8+
label: 'Neon API Key',
9+
description: 'The API key for the Neon API',
10+
placeholder: 'your-api-key',
11+
required: true,
12+
},
13+
},
14+
envSource: 'https://neon.tech/docs/manage/api-keys',
15+
} as HostedIntegrationConfig

packages/core/src/services/integrations/hostedTypes/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import GOOGLE_MAPS_MCP_CONFIG from './configs/googleMaps'
2121
import PUPPETEER_MCP_CONFIG from './configs/puppeteer'
2222
import SENTRY_MCP_CONFIG from './configs/sentry'
2323
import TIME_MCP_CONFIG from './configs/time'
24+
import browserbase_MCP_CONFIG from './configs/browserbase'
25+
import NEON_MCP_CONFIG from './configs/neon'
2426

2527
export const HOSTED_MCP_CONFIGS: Record<
2628
HostedIntegrationType,
@@ -47,4 +49,6 @@ export const HOSTED_MCP_CONFIGS: Record<
4749
[HostedIntegrationType.Puppeteer]: PUPPETEER_MCP_CONFIG,
4850
[HostedIntegrationType.Sentry]: SENTRY_MCP_CONFIG,
4951
[HostedIntegrationType.Time]: TIME_MCP_CONFIG,
52+
[HostedIntegrationType.browserbase]: browserbase_MCP_CONFIG,
53+
[HostedIntegrationType.Neon]: NEON_MCP_CONFIG,
5054
}

packages/env/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ if (environment === 'development' || environment === 'test') {
8181
BULL_ADMIN_USER: 'admin',
8282
BULL_ADMIN_PASS: 'admin',
8383
MCP_SCHEME: 'internet-facing',
84-
MCP_DOCKER_IMAGE: 'ghcr.io/latitude-dev/latitude-mcp:latest',
84+
MCP_DOCKER_IMAGE: 'ghcr.io/latitude-dev/latitude-mcp:sha-dd84ff4',
8585
MCP_NODE_GROUP_NAME: 'latitude-dev-node-group',
8686
},
8787
{ path: pathToEnv },

0 commit comments

Comments
 (0)