Skip to content

Commit ce9dc82

Browse files
authored
fix(docs): Fix copying MCP url to clipboard [ignore] (#2162)
<!-- CURSOR_SUMMARY --> > [!NOTE] > Updates the MCP copy functionality and related identifiers in `LLMButtons/index.jsx`. > > - Renames dropdown option value from `copyMcpServer` to `copyMcpServerUrl` and updates switch handling/function name to `onCopyMcpServerUrlClick` > - Removes `MCP_CONFIG_JSON` and changes clipboard content to `MCP_SERVER_URL` > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5246297. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 4659f4b commit ce9dc82

1 file changed

Lines changed: 5 additions & 13 deletions

File tree

  • apify-docs-theme/src/theme/LLMButtons

apify-docs-theme/src/theme/LLMButtons/index.jsx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const DROPDOWN_OPTIONS = [
3939
description: 'Copy MCP Server URL to clipboard',
4040
showExternalIcon: false,
4141
Icon: McpIcon,
42-
value: 'copyMcpServer',
42+
value: 'copyMcpServerUrl',
4343
},
4444
{
4545
label: 'Connect to Cursor',
@@ -82,14 +82,6 @@ const DROPDOWN_OPTIONS = [
8282

8383
const MCP_SERVER_URL = 'https://mcp.apify.com/?tools=docs';
8484

85-
const MCP_CONFIG_JSON = `{
86-
"mcpServers": {
87-
"apify": {
88-
"url": "${MCP_SERVER_URL}"
89-
}
90-
}
91-
}`;
92-
9385
const getPrompt = (currentUrl) => `Read from ${currentUrl} so I can ask questions about it.`;
9486
const getMarkdownUrl = (currentUrl) => {
9587
const url = new URL(currentUrl);
@@ -197,7 +189,7 @@ const onCopyAsMarkdownClick = async ({ setCopyingStatus }) => {
197189
}
198190
};
199191

200-
const onCopyMcpServerClick = async () => {
192+
const onCopyMcpServerUrlClick = async () => {
201193
if (window.analytics) {
202194
window.analytics.track('Clicked', {
203195
app: 'docs',
@@ -207,7 +199,7 @@ const onCopyMcpServerClick = async () => {
207199
}
208200

209201
try {
210-
await navigator.clipboard.writeText(MCP_CONFIG_JSON);
202+
await navigator.clipboard.writeText(MCP_SERVER_URL);
211203
} catch (error) {
212204
console.error('Failed to copy MCP configuration:', error);
213205
}
@@ -374,8 +366,8 @@ export default function LLMButtons({ isApiReferencePage = false }) {
374366
case 'viewAsMarkdown':
375367
onViewAsMarkdownClick();
376368
break;
377-
case 'copyMcpServer':
378-
onCopyMcpServerClick();
369+
case 'copyMcpServerUrl':
370+
onCopyMcpServerUrlClick();
379371
break;
380372
case 'connectCursor':
381373
onConnectCursorClick();

0 commit comments

Comments
 (0)