diff --git a/components/MCPSetupComponent.tsx b/components/MCPSetupComponent.tsx index b1f1800..605fcc1 100644 --- a/components/MCPSetupComponent.tsx +++ b/components/MCPSetupComponent.tsx @@ -1,11 +1,14 @@ -"use client" +"use client"; -import { useState } from "react" +// import { title } from "process"; // Not used, can be removed +import { useState } from "react"; + +type ConfigType = { title: string; code?: string; steps?: string[] }; export const MCPSetupComponent = () => { - const [activeTab, setActiveTab] = useState("cursor") + const [activeTab, setActiveTab] = useState("cursor"); - const configurations = { + const configurations: Record = { cursor: { title: "Cursor — .cursor/mcp.json", code: `{ @@ -21,58 +24,107 @@ export const MCPSetupComponent = () => { }, claude: { title: "Claude — Command Line", - code: `Claude mcp add nexlayer-mcp https://mcp.nexlayer.ai/api/mcp -e BEARER_TOKEN=`, + code: `claude mcp add nexlayer-mcp --transport sse https://mcp.nexlayer.ai/api/mcp --header "Authorization: Bearer "`, + }, + vscode: { + title: "VS Code", + steps: [ + "Open the Command Palette in VS Code 2 (Ctrl+Shift+P on Windows/Linux, Cmd+Shift+P on macOS)", + 'Search and select the "MCP: Add Server" command', + "Select HTTP (HTTP or Server-Sent Events)", + "Enter 'https://mcp.nexlayer.ai/api/mcp' for the Server URL", + "Enter 'nexlayer-mcp' for the Server ID", + "In the nexlayer-mcp object, add the following lines of code:", + '', + "Save and begin prompting with Github Copilot!", + ], }, other: { title: "Other AI coding agents", code: `https://mcp.nexlayer.ai/api/mcp`, }, - } + }; + + // Removed misplaced return and code block. The main return is below. + + // Helper to safely get code string + const getActiveCode = () => { + const config = configurations[activeTab as keyof typeof configurations]; + return config && config.code ? config.code : ''; + }; const copyToClipboard = () => { - navigator.clipboard.writeText(configurations[activeTab as keyof typeof configurations].code) - } + navigator.clipboard.writeText(getActiveCode()); + }; return (
{/* Header */}
-

Setup with your AI agent assistant

-

Nexlayer MCP configuration for different AI code editors

+

+ Setup with your AI agent assistant +

+

+ Nexlayer MCP configuration for different AI code editors +

{/* Tabs */}
-
+
+
- {/* Code Block */}
@@ -81,8 +133,16 @@ export const MCPSetupComponent = () => { {configurations[activeTab as keyof typeof configurations].title} -
- ) -} + ); +}; diff --git a/public/icons/vs-code.svg b/public/icons/vs-code.svg new file mode 100644 index 0000000..b9a5693 --- /dev/null +++ b/public/icons/vs-code.svg @@ -0,0 +1 @@ +