Skip to content

[Bug] "Import All" button in MCP Server setup imports single tool instead of all tools #74

@yanniszhou

Description

@yanniszhou

Location: `frontend/src/pages/EnterpriseSettings.tsx` line ~1263–1292

Describe the bug

In Enterprise Settings → Tools → Add MCP Server, after testing a connection, the tool list is displayed with one "Import All" (`导入全部`) button per tool row. However:

  1. The button label says "Import All" but clicking it only imports the single tool on that row, not all tools.
  2. The "Import All" button is rendered inside a `.map()` loop, resulting in N identical-looking buttons for N tools — which is confusing and misleading.

Expected behavior

  • Each tool row should have an "Import" button (imports that single tool)
  • A single "Import All" button should appear outside the loop (below the tool list), which imports all discovered tools at once

Steps to reproduce

  1. Go to Enterprise Settings → Tools tab
  2. Click "+ Add MCP Server"
  3. Enter a valid MCP server URL and click "Test Connection"
  4. Observe that each tool row has a button labeled "Import All"

Code reference

// Line 1263 — button is inside .map(), but labeled "Import All"
{(mcpTestResult.tools || []).map((tool: any, i: number) => (
    <div key={i} ...>
        <span>{tool.name}</span>
        <button onClick={/* imports only this one tool */}>
            {t('enterprise.tools.importAll')}  {/* ← misleading label */}
        </button>
    </div>
))}

Suggested fix

  • Rename the per-row button label to t('enterprise.tools.import') (single tool import)
  • Add a new "Import All" button outside the `.map()` loop that iterates over all tools and calls `POST /api/tools` for each one
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions