3P

3dify-project/dify-mcp-client

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

172 stars 33 forks Качество 61 Тренд 17Apache-2.0

3dify-project/dify-mcp-client — это кандидат на MCP-сервер, импортированный из https://github.com/3dify-project/dify-mcp-client.

Обзор

3dify-project/dify-mcp-client — это кандидат на MCP-сервер, импортированный из https://github.com/3dify-project/dify-mcp-client.

Обзор (машинный перевод)

MCP Client как плагин Agent Strategy с поддержкой Computer Using Agent (UI-TARS-SDK).

[! ВАЖНО] Dify — это не MCP Server, а MCP Host.

Как это работает

Каждый узел MCP client (ReAct Agent) может подключать MCP servers.

  1. Списки Tool, Resource, Prompt преобразуются в инструменты Dify.
  2. Выбранный вами LLM может видеть их name, description, argument type
  3. LLM вызывает инструменты на основе цикла ReAct (Reason → Act → Observe).

[! ПРИМЕЧАНИЕ] Большая часть кода в этом репозитории содержит следующие файлы.

Официальные плагины / стратегии агентов Dify

https://github.com/langgenius/dify-official-plugins/tree/main/agent-strategies/cot_agent

✅ Что я сделал

  • Скопирован ReAct.py и переименован файл в mcpReAct.py
  • Добавлено поле ввода GUI config_json путём редактирования mcpReAct.yaml и class mcpReActParams()

в mcpReAct.py я добавил

  • Новые 12 функций для MCP
  • __init__() для инициализации AsyncExitStack и event loop
  • Некоторые коды в _handle_invoke_action() для MCP
  • Настройка и очистка MCP в _invoke()

[! ВАЖНО] ReAct, пока цикл остаётся таким, какой они есть.

🔄 История обновлений

  • Добавить клиент SSE MCP (v0.0.2)
  • Поддержка нескольких SSE-серверов (v0.0.3)

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

dify-mcp-client

MCP Client as Agent Strategy Plugin with Computer Using Agent (UI-TARS-SDK) support.

[!IMPORTANT] Dify is not MCP Server but MCP Host.

How it works

Each MCP client (ReAct Agent) node can connect MCP servers.

  1. Tool, Resource, Prompt lists are converted into Dify Tools.
  2. Your selected LLM can see their name, description, argument type
  3. The LLM calls Tools based on the ReAct loop (Reason → Act → Observe).

[!NOTE] Most of the code in this repository contains the following files.

Dify Official Plugins / Agent Strategies

https://github.com/langgenius/dify-official-plugins/tree/main/agent-strategies/cot_agent

✅ What I did

  • Copied ReAct.py and renamed file as mcpReAct.py
  • Added config_json GUI input field by editing mcpReAct.yaml and class mcpReActParams()

in mcpReAct.py, I added

  • New 12 functions for MCP
  • __init__() for initializing AsyncExitStack and event loop
  • Some codes in _handle_invoke_action() for MCP
  • MCP setup and cleanup in _invoke()

[!IMPORTANT] ReAct while loop is as they are

🔄 Update history

  • Add SSE MCP client (v0.0.2)
  • Support multi SSE servers (v0.0.3)
  • Update python module and simplify its dependency (v0.0.4)
    • mcp(v1.1.2→v1.6.0+)
    • dify_plugin(0.0.1b72→v0.1.0)
  • Add UI-TARS SDK integration for GUI automation capabilities (v0.0.5)
  • Support Streamable HTTP MCP client
  • Feat SSE param: /sse?key=value (v0.0.6)

🤖 UI-TARS Integration

This plugin includes UI-TARS SDK integration for GUI automation capabilities.

[!WARNING] UI-TARS-SDK integration is supported only Dify Plugin’s local debug deployment. https://github.com/3dify-project/dify-mcp-client#-how-to-develop-and-deploy-plugin

Normal difypkg install doesn’t work. Because UI-TARS require OS native API, yet Dify plugin env is Linux docker container.

I’m thinking alternative solusion via Streamable HTTP MCP.

Key Features

  • On-demand GUI automation: UI-TARS is called only when needed, reducing token consumption
  • Life-time control: Set maximum loop count per task to prevent runaway automation

Known Limitations

  • Single Monitor Support: UI-TARS currently recognizes the primary monitor only. Multi-monitor setups are not supported.
  • Mac Retina Display Issue: On macOS with Retina displays, UI-TARS requires the display resolution to be set to “Default” instead of the highest quality setting. Otherwise wrong (w,h) point is clicked. https://github.com/bytedance/UI-TARS-desktop/issues/591

Life-time Parameter

The life_time parameter controls the maximum number of GUI actions UI-TARS can perform:

  • Default: 10 iterations
  • User-configurable maximum via ui_tars_max_life_time_count
  • Your selected LLM can dynamically adjust within the user-defined limit based on task complexity

[!NOTE]

Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →