Fix MCP nested response handling for repo_reader tool#33
Merged
williams21v merged 1 commit intomainfrom Dec 3, 2025
Merged
Conversation
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.
📝 PR DESCRIPTION (Copy/Paste Ready)
Summary
This PR fixes the issue where the front-end could not load GitHub repositories or branches during the “Connect” flow. The root cause was a mismatch between the actual MCP response shape and what the front-end API client expected.
What was happening
The repo_reader MCP tool returns a nested response:
payload.data.data.repositoriesBut the front-end assumed:
payload.data.repositoriesThis caused:
• listRepos() to return an empty array
• loadRepos() in Zustand to save empty state
• The UI dropdowns to appear empty even though the backend returned valid data
Fix
• Updated listRepos() and listBranches() to correctly unwrap the nested MCP response
• Ensured full alignment with the backend MCP response format
• Added detailed console logs to the store for future debugging
Impact
• Repository dropdown now correctly populates from GitHub
• Branch dropdown loads as expected
• Connect → Configure flow works end-to-end
• No backend changes required
Testing Steps
1. Connect GitHub via OAuth
2. Click Re-sync Repos
3. Repo dropdown should populate
4. Select a repo → branches should load
5. Confirm logs show valid repo + branch data
Additional Notes
This was a front-end only fix.
Backend MCP logic remains unchanged.