home / mcp / dify mcp client mcp server
Provides on-demand MCP client capabilities, connecting ReAct agents to remote MCP servers and enabling tool-based automation with optional UI-TARS GUI automation.
Configuration
View docs{
"mcpServers": {
"3dify-project-dify-mcp-client": {
"url": "http://host.docker.internal:8080/sse",
"headers": {
"FORCE_VERIFYING_SIGNATURE": "false"
}
}
}
}You can use the MCP client to connect to remote MCP servers from your agent workflow. It converts Tools, Resources, and Prompts into Dify Tools and lets your chosen LLM discover and call those tools within a ReAct loop, enabling structured automation and GUI-assisted tasks through UI-TARS when needed.
Configure your MCP client to connect to one or more MCP servers. The system exposes server endpoints you can target over HTTP or use as local (stdio) processes. When connected, the MCP client presents available tools derived from your Tool, Resource, and Prompt lists to the LLM. The LLM can reason, act by selecting tools, and observe results in a loop until the task completes.
If you want to run multiple MCP servers, you can define separate connections and the client will handle each server independently. The HTTP connections are the primary method and you can also use local stdio servers if you prefer running a server as a child process.
You can leverage UI-TARS for GUI automation during a task. UI-TARS calls are on-demand and can be limited by a life-time parameter to avoid runaway actions. This integration is available for GUI automation when you need interactive actions during a task.
For safety and reliability, you can configure life-time limits and memory usage per task. This helps prevent long-running automation loops and ensures you can reuse the Agent node in Chatflow by saving context as needed.
To connect to MCP servers, you provide connection details in a configuration object. Two example HTTP connections are shown below, which you can adapt to your environment.
{
"mcpServers": {
"server1": {
"url": "http://host.docker.internal:8080/sse",
"type": "http",
"args": []
},
"server2": {
"url": "http://host.docker.internal:8008/mcp",
"type": "http",
"args": []
}
}
}Prerequisites: you need a working Python environment and Node.js if you plan to use UI-TARS or TypeScript-based tooling. You also need Docker if you want to run pre-built images.
Install the plugin locally by either cloning the project or using a packaged install. The plugin exposes an execution path that starts a Python-based MCP client supporting UI-TARS and HTTP SSE connections.
Option A — Build and run the Docker image for a ready-to-use environment.
docker build -t dify-mcp-client:latest .
```
```yaml
# In your docker-compose.yml
services:
plugin-daemon:
image: memedayo/dify-plugin-daemon:latest # with Pre-built Node.js
# ... rest of configurationOption B — Use a pre-built image if you prefer not to build locally.
Install dependencies and run the MCP client in a development environment.
# Navigate to the project root
cd dify-mcp-client
# Optional: create a virtual environment (preferred for Python)
python3 -m venv .venv
source .venv/bin/activate
# Install Python dependencies for the plugin
pip install -r requirements.txt
# If you also use UI-TARS (Node.js) in your workflow, install Node dependencies
npm install
# Start the MCP client
python -m mainConfiguration is provided as a JSON object that lists MCP servers you want to connect to. You can place this configuration in your agent parameters or a configuration file referenced by the plugin.
Environment variables shown in examples include a signature verification override used during development. You can disable signature verification if needed for testing.
{
"mcpServers": {
"server1": {
"url": "http://host.docker.internal:8080/sse"
},
"server2": {
"url": "http://host.docker.internal:8008/mcp"
}
}
}UI-TARS integration is supported only in local debug deployments of the plugin and requires OS-native access. For production deployments, consider the standard MCP client flow and avoid relying on GUI automation unless you have a compatible environment.
The plugin supports on-demand GUI automation with a configurable life-time per task, and it aims to minimize token usage by avoiding unnecessary GUI calls.
If you encounter install-time signature verification issues, you can temporarily disable verification to proceed with plugin installation by adjusting FORCE_VERIFYING_SIGNATURE in the environment and restarting the service.
Common issues include network connectivity to MCP servers, incorrect server URLs, or mismatched ports. Ensure each server uses a unique port and that the HTTP URLs match the servers you actually run.
If you need to convert a local stdio MCP server to a streamable HTTP server, follow the guidance for transforming the transport to streamable HTTP where applicable.
You can test MCP integration using a sample chat flow that exercises the tools exposed by the configured MCP servers. Ensure the Tools field in the flow has at least one valid tool selected, such as the current time tool, to prevent empty-tool errors.
UI-TARS integration enables on-demand GUI automation during tasks; used to interact with GUI elements and set life-time limits for actions