Dify MCP server for AI agents

Live

BEARER TOKEN

LLM APPS

AI

Dify gives your agent access to your Dify apps: send chat messages, run workflows and text generation apps, manage conversations and annotations, and read workflow logs and message feedback.

  • Per-user credentials: each call uses the actual user's access token, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
Dify
agent · Acme Q3
Run
Ask my support chatbot what the refund window is.
S
dify_chat_message_send
1750ms
LLM app agent
The Dify chat app replied with the refund window and returned the conversation id for follow-up messages.
Sources: Dify chat app, 1 conversation
dify
1 message
18:29
Message Claude...

Tools your llm apps agent reaches for on Dify, scoped per user.

CALL ANY TOOL
26 tools for LLM apps in Dify: send chat messages, run workflows, manage conversations and annotations, and read workflow logs and feedback.
dify_annotation_create
Create annotation
Add an annotation: a question and the exact answer the app should return when a user asks something matching. Returns the new annotation with its id. Annotation reply must be enabled (dify_annotation_reply_configure) for it to be used.
Parameters
Name
Type
Required
Description
answer
string
Required
Answer to return. Example: You can request a full refund within 30 days.
question
string
Required
Question to match. Example: What is your refund policy?.
dify_annotation_delete
Delete annotation
dify_annotation_reply_configure
Annotation reply configure
dify_annotation_reply_status_get
Get annotation reply status
dify_annotation_update
Update annotation
dify_annotations_list
List annotations
dify_app_feedbacks_list
List app feedbacks
dify_app_info_get
Get app info
dify_app_meta_get
Get app meta
dify_app_parameters_get
Get app parameters
dify_app_site_get
Get app site
dify_chat_message_send
Send chat message
dify_completion_message_send
Send completion message
dify_conversation_delete
Delete conversation
dify_conversation_rename
Conversation rename
dify_conversation_variable_update
Update conversation variable
dify_conversation_variables_list
List conversation variables
dify_conversations_list
List conversations
dify_end_user_get
Get end user
dify_message_feedback_submit
Submit message feedback
dify_message_suggested_questions_get
Get message suggested questions
dify_messages_list
List messages
dify_workflow_logs_list
List workflow logs
dify_workflow_run
Run workflow
dify_workflow_run_by_id
Workflow run by id
dify_workflow_run_get
Get workflow run
Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// Dify tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["dify"], toolNames: [
    "dify_chat_message_send",
    "dify_workflow_run",
    "dify_messages_list"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "Send my question to the support chatbot, run the summarization workflow on the answer, and show the conversation history" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["dify"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "Send my question to the support chatbot, run the summarization workflow on the answer, and show the conversation history" }],
  tools,
});

// Execute the tool call with the user's vaulted Dify access token
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["dify"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Send my question to the support chatbot, run the summarization workflow on the answer, and show the conversation history" }],
  tools,
});

// Tool call runs with the user's vaulted Dify access token
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["dify"] }, pageSize: 100,
});

const agent = new Agent({
  name: "llm_app_agent",
  model: "gemini-2.5-pro",
  instruction: "Dify tools scoped to this user",
  tools,
});

await agent.run("Send my question to the support chatbot, run the summarization workflow on the answer, and show the conversation history");
Try these prompts
Copy any prompt into your agent. Each maps directly to a Dify tool. Click to copy, paste into your agent, done.
Chat
Copy the prompt
Copied
Send this question to my support chatbot.
Copy the prompt
Copied
Show the follow-up questions Dify suggests for that message.
Copy the prompt
Copied
Rename this conversation based on its messages.
Workflows
Copy the prompt
Copied
Run my summarization workflow with this input.
Copy the prompt
Copied
Show the status and outputs of workflow run abc123.
Copy the prompt
Copied
List workflow runs from the last day.
Annotations and feedback
Copy the prompt
Copied
Add an annotation for the question 'What is the refund window?'.
Copy the prompt
Copied
List all likes and dislikes on the app's messages.
Copy the prompt
Copied
Turn annotation reply on for the app.
SEE HOW AUTH WORKS
Each user connects their own Dify access token once, and Scalekit sends it with every call. Access tokens stay vaulted, every call is scope checked, and every action is logged.
1
Authorize
Your user connects
Dify
once. We tie it to their identity and the access they approved, with no shared bot account and no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
Dify
credential lives in a vault scoped to them. User A's data is never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tenants:
isolated
3
Resolve
When your agent calls a
Dify
tool, we fetch the right credential server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
Dify
tool call is logged: who triggered it, which tool ran, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other AI connectors.
Engineering Teams
Slack triage
Polls Slack for new messages, classifies bugs and support requests with a LangGraph router, files GitHub issues or Zendesk tickets, and confirms in the thread.
Test other agents
See the same per-user auth pattern across other AI connectors.
ENGINEERING
Slack workflow agent (LangGraph)
LangGraph agent that drives multi-step Slack workflows: triggers, approvals, and follow-up actions per user identity.
ENGINEERING
Slack triage agent
Classify new Slack messages as bugs or support requests, file the GitHub issue or Zendesk ticket, and reply in the thread.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared Dify access token looks fine in a demo. In production every app run looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared key
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
Dify today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access Dify as the user or through a shared key?
As the user. Each user connects their own Dify access token once, and Scalekit sends it with every call. Audit logs attribute every app run to that user, not a shared service account.
Where is the Dify access token stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. To rotate it, the user reconnects with a new access token. Revocation is a single dashboard action. Credentials never appear in prompts, logs, or LLM context.
Can I limit what the agent does in Dify?
Yes. Filter by tool name in listScopedTools to expose only what you want, for example the list and get tools without dify_conversation_delete and dify_annotation_delete, the 2 destructive tools. Scalekit also enforces scope checks before every API call, so write tools such as dify_workflow_run can be left out too. Scalekit also enforces scope checks before every API call.
What happens when a user revokes Dify access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.
Which Dify app does the connection reach?
The app that the connected token belongs to. dify_app_info_get returns basic information about that app, and dify_app_parameters_get reads its input form and feature settings.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""dify"": {
""url"": ""https://mcp.scalekit.com/dify"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.dify]
url = ""https://mcp.scalekit.com/dify""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""dify"": {
""url"": ""https://mcp.scalekit.com/dify"",
""type"": ""http""
}
}
}