dify icon indicating copy to clipboard operation
dify copied to clipboard

feat: add MCP support

Open Nov1c444 opened this issue 6 months ago • 1 comments

close #11415 close #18974 close https://github.com/langgenius/dify/issues/18974 close https://github.com/langgenius/dify/issues/18358

Summary

Added official MCP support

  1. Invoke SSE/Streamable Http MCP tools in Agent nodes and Agent applications
  2. Added SSE/Streamable Http MCP tool types in workflow tool nodes
  3. Applications can be exported as Streamable Http MCP Server

Screenshots

Before After
... ...

Checklist

  • [ ] This change requires a documentation update, included: Dify Document
  • [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • [x] I've updated the documentation accordingly.
  • [x] I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

Nov1c444 avatar Jun 06 '25 02:06 Nov1c444

#18974

junjiem avatar Jun 06 '25 06:06 junjiem

When will the next version be released ? Will it add support for MCP Server ?

andylzming avatar Jun 12 '25 01:06 andylzming

When will the next version be released ? Will it add support for MCP Server ?

Will support Streamable HTTP and SSE Server, and will also support exporting apps as MCP Server. Expected to be released in two weeks.

Nov1c444 avatar Jun 12 '25 02:06 Nov1c444

Great, bro. I want to know if the Resource and Prompt modules are included in this implementation?

FreeOnePlus avatar Jun 12 '25 05:06 FreeOnePlus

Great, bro. I want to know if the Resource and Prompt modules are included in this implementation?

Because I am a database developer, for example, I use the MCP tool to obtain performance operation files such as Profile. If I insert the context directly through the Tools tool, it often causes the context to explode or consume a large number of tokens. So I want to generate a Profile file through Tools, and then let Resource obtain the resource address and load it into LLM, similar to the attachment upload and parsing function. I look forward to your answer. Thank you.

FreeOnePlus avatar Jun 12 '25 05:06 FreeOnePlus

CV: pU1BGgpsFEmJ7m4X.0.0 ---------- Forwarded message --------- From: Yijia Su @.> Date: Thu, Jun 12, 2025 at 6:30 AM Subject: Re: [langgenius/dify] feat: add MCP support (PR #20716) To: langgenius/dify @.> CC: Subscribed @.> FreeOnePlus left a comment (langgenius/dify#20716) <#20716 (comment)> Great, bro. I want to know if the Resource and Prompt modules are included in this implementation? — Reply to this email directly, view it on GitHub <#20716 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BDSVBZPLJYWO7IRMA6UZ5A33DEF7BAVCNFSM6AAAAAB6W6OD7WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSNRVGE3DOMZXGU . You are receiving this because you are subscribed to this thread.Message ID: @.>

Sorry, I don't understand what this mysterious code means?

FreeOnePlus avatar Jun 12 '25 05:06 FreeOnePlus

Great, bro. I want to know if the Resource and Prompt modules are included in this implementation?

Because I am a database developer, for example, I use the MCP tool to obtain performance operation files such as Profile. If I insert the context directly through the Tools tool, it often causes the context to explode or consume a large number of tokens. So I want to generate a Profile file through Tools, and then let Resource obtain the resource address and load it into LLM, similar to the attachment upload and parsing function. I look forward to your answer. Thank you.

Prompt and resource are not supported for now. I roughly understand what you mean, and we will iterate based on everyone's feedback in the future.

Nov1c444 avatar Jun 12 '25 10:06 Nov1c444

Great, bro. I want to know if the Resource and Prompt modules are included in this implementation?

Because I am a database developer, for example, I use the MCP tool to obtain performance operation files such as Profile. If I insert the context directly through the Tools tool, it often causes the context to explode or consume a large number of tokens. So I want to generate a Profile file through Tools, and then let Resource obtain the resource address and load it into LLM, similar to the attachment upload and parsing function. I look forward to your answer. Thank you.

Prompt and resource are not supported for now. I roughly understand what you mean, and we will iterate based on everyone's feedback in the future.

OK, looking forward to your iteration.

FreeOnePlus avatar Jun 12 '25 10:06 FreeOnePlus

Does v1.5.0 support MCP Server?

andylzming avatar Jun 25 '25 09:06 andylzming

Does v1.5.0 support MCP Server?

Will be supported in v1.6.0

Nov1c444 avatar Jun 25 '25 11:06 Nov1c444

wow~ great

TheChildWang avatar Jun 26 '25 03:06 TheChildWang

I assume there's an MCP spec reason for why you strip requests parameters when adding an MCP tool? There's an MCP Server that I would like to integrate with which requires authorization via a token provided in a request param - but I assume they've done it wrong.

NullPrice avatar Jul 11 '25 13:07 NullPrice