Back Home

GitHub Repo

Dify Community Reports MCP Resource Links Being Dropped, Leaving Empty Results Despite Successful Tool Responses

Dify’s MCP integration has been reported to mishandle resource_link content, potentially leaving tools that return only resource links with blank observations. A community patch to preserve links and metadata has been proposed but not merged; the impact on released versions remains unconfirmed.

The original uploader was Ggia at Greek Wikipedia. · CC BY-SA 2.5 · Image source
zh-Hant

On October 3, the Dify community reported an MCP compatibility issue: even when a tool returns protocol-compliant resource links, the content may be dropped before it reaches the tool observation that an agent can read. The report reproduces the issue against a source snapshot of the main branch using a simulated remote response; it does not establish that all released versions or cloud deployments are affected. Issue report

The trigger is specific: the tool has no output schema, provides no structuredContent, and its content contains only resource_link items. The reporter says the protocol model recognizes ResourceLink, but content dispatch in MCPTool._invoke has no corresponding handler, so it logs the item as unsupported and skips it. A response containing only links produces no messages; when text and links are mixed, the text is retained but the links disappear. Reproduction details

The MCP tools specification allows servers to return resource URIs for clients to retrieve or subscribe to later, along with a name, description, and MIME type. These links are not guaranteed to appear in resources/list. In workflows such as report generation or file search, losing a link when a tool returns only that link could break the path to retrieving the data. This is an engineering implication inferred from the specification and report, not a published production incident. MCP tools specification

A patch PR submitted the same day reuses the existing JSON message path to preserve the URI, name, description, MIME type, annotations, and _meta. It does not fetch the resource or add dependencies. The author reports that regression tests covering link-only and mixed-content responses failed on the original baseline and passed with the patch; 14 related unit tests also passed. These results are the submitter’s own verification. At the time of review, the PR was still awaiting review and merge. Proposed patch

Engineering teams using Dify to connect to MCP can first test link-only and text-plus-link responses, and confirm that URIs reach the agent’s observations intact. They should then track upstream review, release versions, and tests against actual remote servers. Preserving a link is only one step in data delivery; the application flow still determines whether the resource’s contents are retrieved.

Sources

  1. [Bug] MCP resource_link-only tool results are discarded
  2. fix(mcp): preserve resource links in tool observations
  3. MCP 2025-06-18 specification: Tools