Skip to content

Conversation

@caapap
Copy link

@caapap caapap commented Nov 20, 2025

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:

TypeError: Cannot read properties of undefined (reading 'name')

This is caused by a data structure mismatch in the deprecated mint-mcp package where it expects a nested tool.tool object, but the API returns a flat tool object.

Changes

  1. docs.json: Added integrations.mcp configuration pointing to dify-6c0370d8.
  2. patches/@mintlify+mcp+1.1.216.patch: Added a patch file using patch-package to fix the cli-config.js in @mintlify/mcp. This allows the tool to correctly parse the API response by handling both nested and flat tool object structures.
  3. package.json: Added patch-package dependency and postinstall script to ensure the patch is applied automatically after npm install.

How to verify

  1. Run npm install
  2. Run npx mint-mcp add dify-6c0370d8
  3. Verify that the installation succeeds and the MCP server is created at ~/.mcp/dify-6c0370d8

Technical Details

The fix modifies node_modules/@mintlify/mcp/bin/utils/cli-config.js in the initializeToolsFromConfig function to handle both data structures:

// Before: tool.tool.name (fails when tool is flat)
// After: (tool.tool || tool).name (handles both cases)

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant