Skip to content

Conversation

@Dumbris
Copy link
Contributor

@Dumbris Dumbris commented Jan 19, 2026

Summary

  • Fixes a bug where importing servers from canonical config paths (Claude Desktop, Claude Code, etc.) in the Web UI would fail with "Content is required" error
  • The handleImport function was incorrectly falling through to the JSON content API instead of using the path API when importing from canonical paths

Root Cause

When a user clicks "Import" on a canonical config path:

  1. importFromCanonicalPath() uses api.importServersFromPath() for preview - ✅ correct
  2. Preview succeeds and shows servers to import
  3. User clicks "Import X Servers" button
  4. handleImport() checks importMode === 'file' && importFile - ❌ false (no file was uploaded)
  5. Falls through to api.importServersFromJSON({ content: importContent }) - ❌ wrong API
  6. importContent is empty (we used path, not paste) → "Content is required" error

Fix

  • Added activeCanonicalImport state to track when importing from a canonical path
  • Set it when canonical path preview succeeds
  • Check it first in handleImport() to use the correct path API
  • Clear it on file/paste preview and modal close

Test plan

  • Open Web UI → Add Server → Import tab
  • Click "Import" on Claude Code (or any found config)
  • Verify preview shows servers without error
  • Click "Import X Servers" button
  • Verify import succeeds without "Content is required" error
  • Verify servers are added to the list

🤖 Generated with Claude Code

When importing servers from a canonical config path (e.g., Claude Desktop,
Claude Code), the handleImport function incorrectly used the JSON content
API instead of the path API, causing "Content is required" errors.

The fix tracks when a canonical path import is active and uses the
appropriate importServersFromPath API endpoint for the actual import.

Changes:
- Add activeCanonicalImport state to track canonical path imports
- Set activeCanonicalImport when preview from canonical path succeeds
- Update handleImport to check activeCanonicalImport first and use path API
- Clear activeCanonicalImport on file/paste preview and modal close

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 821ab25
Status: ✅  Deploy successful!
Preview URL: https://b212c63e.mcpproxy-docs.pages.dev
Branch Preview URL: https://fix-import-canonical-path-va.mcpproxy-docs.pages.dev

View logs

@github-actions
Copy link

📦 Build Artifacts

Workflow Run: View Run
Branch: fix/import-canonical-path-validation

Available Artifacts

  • archive-darwin-amd64 (23 MB)
  • archive-darwin-arm64 (21 MB)
  • archive-linux-amd64 (12 MB)
  • archive-linux-arm64 (11 MB)
  • archive-windows-amd64 (23 MB)
  • archive-windows-arm64 (20 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (26 MB)
  • installer-dmg-darwin-arm64 (23 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 21127164952 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@Dumbris Dumbris merged commit da6e817 into main Jan 19, 2026
24 checks passed
@Dumbris Dumbris deleted the fix/import-canonical-path-validation branch January 19, 2026 06:22
technicalpickles pushed a commit to technicalpickles/mcpproxy-go that referenced this pull request Jan 21, 2026
…proxy#265)

When importing servers from a canonical config path (e.g., Claude Desktop,
Claude Code), the handleImport function incorrectly used the JSON content
API instead of the path API, causing "Content is required" errors.

The fix tracks when a canonical path import is active and uses the
appropriate importServersFromPath API endpoint for the actual import.

Changes:
- Add activeCanonicalImport state to track canonical path imports
- Set activeCanonicalImport when preview from canonical path succeeds
- Update handleImport to check activeCanonicalImport first and use path API
- Clear activeCanonicalImport on file/paste preview and modal close

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants