Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

1.4 KB
Raw Blame
import { McpServerType } from '@activepieces/shared';
import { t } from 'i18next';

import { useMcpServerUrl } from '@/app/routes/mcp-server/mcp-server-url';
import { CopyButton } from '@/components/custom/clipboard/copy-button';
import { CollapsibleJson } from '@/components/custom/collapsible-json';

export function McpCredentials() {
  const { serverUrl } = useMcpServerUrl({ serverType: McpServerType.PROJECT });

  const jsonConfiguration = {
    mcpServers: {
      activepieces: {
        url: serverUrl,
      },
    },
  };

  return (
    <div className="space-y-4">
      <div className="flex flex-col gap-1.5">
        <label className="text-sm font-medium">{t('Server URL')}</label>
        <p className="text-xs text-gray-11">
          {t(
            'Use this URL to connect from Cursor, Windsurf, Claude Desktop, or any MCP-compatible client. Authentication is handled via OAuth.',
          )}
        </p>
        <div className="flex items-center gap-2">
          <div className="bg-gray-3/50 rounded-md px-3 py-2 text-sm flex-1 overflow-x-auto">
            {serverUrl}
          </div>
          <CopyButton textToCopy={serverUrl} />
        </div>
      </div>

      <CollapsibleJson
        json={jsonConfiguration}
        label={t('JSON Configuration')}
        description={t(
          'Copy this into your MCP client config (Cursor, Windsurf, Claude Desktop, etc.).',
        )}
        defaultOpen={false}
      />
    </div>
  );
}