-
Notifications
You must be signed in to change notification settings - Fork 1k
feat: add MCP client configuration picker and copy-to-clipboard funct… #695
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,21 @@ | ||
| import { fail } from '@sveltejs/kit'; | ||
| import { env } from '$env/dynamic/public'; | ||
| import { apiRequest } from '$lib/api-helpers.js'; | ||
|
|
||
| // The MCP server runs on the user's own machine, so BCRM_BASE_URL must be the | ||
| // PUBLIC API host (e.g. https://api.bottlecrm.io) — the same base the browser | ||
| // talks to. PUBLIC_DJANGO_API_URL is that host with no /api suffix, which is | ||
| // exactly what the MCP client expects (it appends /api/... itself). | ||
| const apiBaseUrl = env.PUBLIC_DJANGO_API_URL || 'https://api.bottlecrm.io'; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz). |
||
|
|
||
|
Comment on lines
+5
to
+10
|
||
| /** @type {import('./$types').PageServerLoad} */ | ||
| export async function load({ cookies, locals }) { | ||
| try { | ||
| const data = await apiRequest('/profile/tokens/', {}, { cookies, org: locals?.org }); | ||
| return { tokens: data.tokens || [] }; | ||
| return { tokens: data.tokens || [], baseUrl: apiBaseUrl }; | ||
| } catch (err) { | ||
| console.error('Failed to load API tokens:', err); | ||
| return { tokens: [], loadError: err?.message || 'Failed to load tokens' }; | ||
| return { tokens: [], baseUrl: apiBaseUrl, loadError: err?.message || 'Failed to load tokens' }; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected ':' and instead saw 'message'. |
||
| } | ||
| } | ||
|
|
||
|
|
||
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.
'import' is only available in ES6 (use 'esversion: 6').