Conversation
…ionality to API tokens settings
| } 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.
Expected ':' and instead saw 'message'.
Expected '}' to match '{' from line 18 and instead saw 'Failed to load tokens'.
Expected an identifier and instead saw '.'.
Expected an identifier and instead saw '||'.
Missing semicolon.
Unnecessary semicolon.
| // 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.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
| @@ -1,14 +1,21 @@ | |||
| import { fail } from '@sveltejs/kit'; | |||
| import { env } from '$env/dynamic/public'; | |||
There was a problem hiding this comment.
'import' is only available in ES6 (use 'esversion: 6').
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR introduces built-in MCP server support for AI agent integration. The main README documents the new feature and setup flow, the backend API now exposes a base URL to the frontend, the frontend provides a client-specific configuration UI with copy functionality, and the MCP server documentation clarifies security requirements and client setup. ChangesMCP AI Agent Integration
🎯 2 (Simple) | ⏱️ ~12 minutes
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
Adds end-user guidance and UI affordances to connect MCP-compatible AI clients to BottleCRM using Personal Access Tokens, and documents MCP setup in the repo docs.
Changes:
- Document MCP server capability and add “Connect your AI agent (MCP)” setup steps in the main README.
- Expand
mcp_server/README.mdwith multi-client configuration examples (JSON + TOML) and clarify confirm-gating for outward-facing actions. - Enhance the API Tokens settings page with a client picker, ready-to-paste configs, and copy-to-clipboard support (including passing the API base URL from the server load).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| README.md | Adds MCP feature mention and user-facing connection instructions; updates repo tree to include mcp_server/. |
| mcp_server/README.md | Adds a unified “Client configuration” section with per-client file locations/formats and clarifies confirm requirements for send. |
| frontend/src/routes/(app)/settings/api-tokens/+page.svelte | Adds MCP client selector, generates per-client config snippets, and adds copy-to-clipboard UI for configs. |
| frontend/src/routes/(app)/settings/api-tokens/+page.server.js | Supplies baseUrl to the page from PUBLIC_DJANGO_API_URL for config generation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // 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'; | ||
|
|
| // Reset the create form after a successful creation. | ||
| formName = ''; | ||
| formExpiresAt = ''; | ||
| copied = false; |
| (provides <code class="font-mono">uvx</code>) on your machine. The agent acts as you and | ||
| inherits your role — it can't see or do anything you can't. |
…ionality to API tokens settings
Summary by CodeRabbit
New Features
Documentation