fix: patch mint-mcp to resolve 'Cannot read properties of undefined' error & add MCP integration#530
Open
caapap wants to merge 1 commit intolanggenius:mainfrom
Open
fix: patch mint-mcp to resolve 'Cannot read properties of undefined' error & add MCP integration#530caapap wants to merge 1 commit intolanggenius:mainfrom
caapap wants to merge 1 commit intolanggenius:mainfrom
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.
What does this PR do?
This PR fixes a critical issue preventing the setup of the MCP (Model Context Protocol) server for Dify documentation. It also adds the necessary MCP configuration to
docs.json.Problem
When running
npx mint-mcp add dify-6c0370d8, the installation fails with:This is caused by a data structure mismatch in the deprecated
mint-mcppackage where it expects a nestedtool.toolobject, but the API returns a flattoolobject.Changes
docs.json: Addedintegrations.mcpconfiguration pointing todify-6c0370d8.patches/@mintlify+mcp+1.1.216.patch: Added a patch file usingpatch-packageto fix thecli-config.jsin@mintlify/mcp. This allows the tool to correctly parse the API response by handling both nested and flat tool object structures.package.json: Addedpatch-packagedependency andpostinstallscript to ensure the patch is applied automatically afternpm install.How to verify
npm installnpx mint-mcp add dify-6c0370d8~/.mcp/dify-6c0370d8Technical Details
The fix modifies
node_modules/@mintlify/mcp/bin/utils/cli-config.jsin theinitializeToolsFromConfigfunction to handle both data structures: