Get the FREE Ultimate OpenClaw Setup Guide →

dify-plugin-agent _sse

Dify 1.0 Plugin Support MCP Tools Agent strategies

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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

Sponsor this space

Reach thousands of developers