fix: use correct API for canonical path imports in web UI#265
Merged
Conversation
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>
Deploying mcpproxy-docs with
|
| 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 |
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 21127164952 --repo smart-mcp-proxy/mcpproxy-go
|
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
handleImportfunction was incorrectly falling through to the JSON content API instead of using the path API when importing from canonical pathsRoot Cause
When a user clicks "Import" on a canonical config path:
importFromCanonicalPath()usesapi.importServersFromPath()for preview - ✅ correcthandleImport()checksimportMode === 'file' && importFile- ❌ false (no file was uploaded)api.importServersFromJSON({ content: importContent })- ❌ wrong APIimportContentis empty (we used path, not paste) → "Content is required" errorFix
activeCanonicalImportstate to track when importing from a canonical pathhandleImport()to use the correct path APITest plan
🤖 Generated with Claude Code