dify-plugin-agent _sse
Dify 1.0 Plugin Support MCP Tools Agent strategies
claude mcp add --transport http junjiem-dify-plugin-agent-mcp_sse http://127.0.0.1:8000/sse
How to use
This MCP server provides an agent strategy toolkit for Dify plugins that leverage the MCP (Model Context Protocol) via SSE or Streamable HTTP transports. It enables an agent to discover and call tools exposed by MCP servers, supporting both Function Calling and ReAct-style reasoning. The configuration is designed to connect to one or more MCP endpoints, defaulting to SSE transport if not specified. To use it, point your Dify plugin configuration at the MCP server(s) using the mcpServers setting, and ensure the chosen transport (sse or streamable_http) is reachable from your environment. Tools exposed by the MCP service can be discovered automatically and invoked by the agent as part of task execution, enabling dynamic tool usage during conversations.
How to install
Prerequisites
- Access to a Dify platform instance where you want to install the MCP plugin agent.
- Network access to the MCP Server endpoints (SSE or Streamable HTTP) you plan to use.
- Basic familiarity with editing JSON configuration files for MCP agents.
Step 1: Prepare the MCP configuration Create a file named mcp_config.json (or use your platform’s configuration interface) with one or more MCP servers. Example:
{
"mcpServers": {
"dify-plugin-agent-mcp_sse": {
"transport": "sse",
"url": "http://127.0.0.1:8000/sse",
"headers": {},
"timeout": 50,
"sse_read_timeout": 50
}
}
}
Step 2: Start the MCP agent component Choose one of the following execution environments depending on how you deploy the MCP agent:
Option A - Node.js
# If this MCP server is distributed as a Node.js app, install dependencies and run
npm install
node path/to/server.js
Option B - Python
# If the MCP server ships as a Python module
python -m mcp_agent
Option C - Docker (if an image is provided)
# Replace with the actual image name
docker run --rm -p 8000:8000 your-registry/dify-plugin-agent-mcp_sse
Step 3: Connect the Dify plugin to MCP
- In your Dify platform plugin configuration, reference the MCP configuration you created. If your platform uses the mcpServers format, ensure the key matches (e.g., "dify-plugin-agent-mcp_sse").
- Verify that the transport (sse) and URL are reachable from the Dify host. Check network/firewall settings if you experience timeouts.
Step 4: Validate functionality
- Initiate a test conversation that requires tool usage. The agent should discover available tools through MCP and call them as part of the reasoning process. Monitor logs for MCP discovery events and tool invocations to confirm correct operation.
Additional notes
Tips and common notes:
- The default transport is SSE if transport is not specified in the configuration.
- If you encounter timeouts, increase timeout or sse_read_timeout in the mcpServers configuration.
- Ensure CORS and authentication settings on the MCP server allow connections from your Dify deployment if applicable.
- When using Streamable HTTP transport, ensure the endpoint supports streaming tool discovery and invocation as per MCP specifications.
- If tools are dynamic, you may need to refresh the MCP configuration in Dify to pick up newly published tools.
- For troubleshooting, enable verbose logging on both the MCP agent and the MCP server to capture discovery and call sequences.
Related MCP Servers
dify-plugin-tools _sse
Dify 1.0 Plugin MCP HTTP with SSE or Streamable HTTP transport Tools
dify -client
MCP Client as an Agent Strategy Plugin. Support GUI operation via UI-TARS-SDK.
mcp-toolbox-sdk-python
Python SDK for interacting with the MCP Toolbox for Databases.
ReActMCP
ReActMCP is a reactive MCP client that empowers AI assistants to instantly respond with real-time, Markdown-formatted web search insights powered by the Exa API.
mcp-lite-dev
共学《MCP极简开发》项目代码
MCPSecBench
MCPSecBench: A Systematic Security Benchmark and Playground for Testing Model Context Protocols