4,500+ servers built on MCP Fusion
Vinkius
Dify.AI SDK logo
Vinkius
OpenAI Agents SDK logo

How to Use the Dify.AI SDK MCP in OpenAI Agents SDK

Run production-ready Dify workflows and chat apps inside your OpenAI Agents SDK pipelines with strict guardrails and zero-config tool discovery.

See Vinkius in Action

Works with every AI agent you already use

…and any MCP-compatible client

Dify.AI SDK MCP on Cursor AI Code Editor MCP Client Dify.AI SDK MCP on Claude Desktop App MCP Integration Dify.AI SDK MCP on OpenAI Agents SDK MCP Compatible Dify.AI SDK MCP on Visual Studio Code MCP Extension Client Dify.AI SDK MCP on GitHub Copilot AI Agent MCP Integration Dify.AI SDK MCP on Google Gemini AI MCP Integration Dify.AI SDK MCP on Lovable AI Development MCP Client Dify.AI SDK MCP on Mistral AI Agents MCP Compatible Dify.AI SDK MCP on Amazon AWS Bedrock MCP Support
MCP Servers - Free for Subscribers
OpenAI Agents SDK

Connect Dify.AI SDK MCP to OpenAI Agents SDK

Create your Vinkius account to connect Dify.AI SDK to OpenAI Agents SDK and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.

GDPR Free for Subscribers

Run workflows with OpenAI guardrails

This MCP Server exposes the `run_workflow` tool to trigger your Dify backend pipelines directly from your Python runtime. When your agent invokes this tool, the OpenAI Agents SDK intercepts the payload, applies your local validation rules, and executes the target workflow. You get execution outputs without exposing raw API keys to the agent context. Here's how it works under the hood. The agent discovers the tool signature automatically, parses the required inputs via `get_workflow_parameters`, and schedules the task. If the input data fails your defined safety checks, the SDK halts execution before hitting the Dify endpoint, saving API credits and protecting your internal systems.

Manage user sessions via OpenAI agent handoffs

The `get_conversations` tool fetches existing session histories so your agents can resume past chats. You can use specialized OpenAI agents for different parts of a conversation, passing the Dify thread ID between them during handoffs. This keeps your context window clean because only the active agent processes the current message history. Your agent updates thread names on the fly using `rename_conversation` to keep things organized for the end user. If a user goes off-topic, a router agent hands the session over to a generic support agent. The new agent calls `get_conversation_messages` to catch up instantly, maintaining a continuous user experience.

Trace Dify MCP Server calls in your dashboard

The `chat_message` tool sends user queries directly to your Dify chatbots. When using this MCP Server, every single tool call, payload, and response latency gets logged directly in your OpenAI developer dashboard. You see the exact inputs sent to `upload_file` alongside your agent's decision-making steps. Debugging complex multi-agent systems becomes straightforward with this visibility. If a model generates a bad response, you can trace the issue back to the `get_app_meta` call that retrieved the application's configuration. You don't have to guess which agent triggered which workflow.

Setup guide

Set up Dify.AI SDK MCP in OpenAI Agents SDK

Prerequisites

  • Python 3.10+ installed
  • openai-agents package (pip install openai-agents)
  • Active Vinkius subscription with a valid endpoint token
  1. 1

    Install the SDK

    Run pip install openai-agents to install the OpenAI Agents SDK. The MCP integration is built-in — no extra dependencies needed.

  2. 2

    Connect via SSE transport

    Use MCPServerSse with your Vinkius endpoint URL. Replace [YOUR_TOKEN_HERE] with your token from cloud.vinkius.com. The SDK auto-discovers all Dify.AI SDK tools at runtime.

  3. 3

    Create your Agent

    Pass the MCP to Agent(mcp_servers=[server]). The agent receives Dify.AI SDK tools as native definitions — JSON schemas resolve automatically.

  4. 4

    Run the agent

    Call Runner.run(agent, prompt) to execute. The agent invokes the appropriate Dify.AI SDK tools and returns structured results. Copy the full example on the right to get started.

agent.py
import asyncio
from agents import Agent, Runner
from agents.mcp import MCPServerSse

async def main():
    async with MCPServerSse(
        url="https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp"
    ) as server:
        agent = Agent(
            name="Dify.AI SDK Agent",
            instructions="You have access to Dify.AI SDK tools.",
            mcp_servers=[server],
        )
        result = await Runner.run(agent, "List recent transactions")
        print(result.final_output)

asyncio.run(main())

Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by Dify.AI. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.

Why Choose Vinkius

Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.

Real-time monitoring

Live

visibility into every interaction

Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.

Built-in savings

60%

lower AI costs

Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.

Single dashboard

One

place for every integration

Every tool your AI connects to, managed from a single screen. One account, complete control.

Common questions about Dify.AI SDK MCP in OpenAI Agents SDK

Install the package via pip and configure the `MCPServerStreamableHttp` client with your Vinkius endpoint. This registers the MCP Server so your agent discovers all 14 tools automatically during startup.
Yes. Set `cacheToolsList=True` in your server configuration parameters. This prevents the SDK from querying the Dify.AI SDK endpoint for tool schemas on every single run, which drops initialization latency to near zero.
The MCP connection executes `run_workflow` as an asynchronous task. Your agent waits for the execution to complete before proceeding to the next step. If you need to cancel a running chat generation, the agent triggers `stop_chat_generation` to release the thread immediately.
Use the `upload_file` tool on this MCP Server to send a file URL to Dify before sending your message. The tool returns a file ID that your agent then includes in the `chat_message` payload, enabling multimodal analysis.
Your chat logs and file uploads travel directly between the OpenAI runtime and the Dify API via Vinkius's isolated V8 sandbox. No data is stored on Vinkius servers. All traffic is encrypted in transit, and credentials are swept from memory immediately after the tool execution completes.

Start using the Dify.AI SDK MCP today

We host it, we monitor it, we maintain it. You just paste one token.

Built & Managed by Vinkius 30s setup 14 tools

We've already built the connector for Dify.AI SDK. Just plug in your AI agents and start using Vinkius.

No hosting. No infrastructure. No complex setup.
All 14 tools are live and waiting. You're up and running in seconds.

Claude Claude
ChatGPT ChatGPT
Cursor Cursor
Gemini Gemini
Windsurf Windsurf
VS Code VS Code
JetBrains JetBrains
Vercel Vercel
+ other MCP clients

Vinkius gives your AI agents access to the full catalog of app connectors, all fully managed, secure, and enterprise-ready. One subscription, every tool you need.

Zero hosting required Full MCP catalog included Enterprise-grade security Auto-updated by Vinkius

Built, hosted, and secured by Vinkius. You just connect and go.