npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dify-management-mcp-server

v1.0.0

Published

MCP server for Dify application and workflow management with full lifecycle support

Readme

Dify Management MCP Server

Complete MCP server for Dify application and workflow management with full lifecycle support.

Features

Application Management

  • ✅ List applications with pagination and filtering
  • ✅ Create new applications (chat, workflow, agent, completion)
  • ✅ Get application details
  • ✅ Update application settings
  • ✅ Delete applications
  • ✅ Copy/duplicate applications
  • ✅ Export applications to YAML
  • ✅ Import applications from YAML/URL

Workflow Management

  • ✅ Get draft workflow
  • ✅ Sync/update workflow graph and features
  • ✅ Publish workflows
  • ✅ List all published workflow versions
  • ✅ Get specific workflow version
  • ✅ Delete workflow versions

Workflow Execution

  • ✅ Run draft workflow for testing
  • ✅ Run individual nodes for debugging

Installation

Option 1: Use with npx (Recommended)

Add to your MCP configuration:

```json { "mcpServers": { "dify-management": { "command": "npx", "args": ["-y", "dify-management-mcp-server"], "env": { "DIFY_CONSOLE_URL": "https://your-dify-instance.com", "DIFY_CONSOLE_TOKEN": "your_console_token" } } } } ```

Option 2: Build from source

```bash

Clone or download the project

cd dify-management-mcp-server

Install dependencies

npm install

Build TypeScript

npm run build

The built files will be in the dist/ directory

```

Configuration

Environment Variables

  • DIFY_CONSOLE_URL (required): Your Dify instance URL (e.g., https://uatai.haierfinancial.com)
  • DIFY_CONSOLE_TOKEN (required): Console authentication token

Getting Console Token

Method 1: From Browser Cookie

  1. Log in to your Dify instance in a web browser
  2. Open browser developer tools (F12)
  3. Go to Application → Cookies
  4. Find the console_token cookie
  5. Copy its value

Method 2: From Browser Local Storage

  1. Log in to your Dify instance
  2. Open developer tools → Application → Local Storage
  3. Look for authentication tokens
  4. Use format: Bearer <your_token>

Available Tools

App Management

dify_list_apps

List all applications with optional filtering.

Parameters:

  • page (number): Page number (default: 1)
  • limit (number): Items per page (default: 20, max: 100)
  • mode (string): Filter by app mode (chat, workflow, agent-chat, etc.)
  • name (string): Filter by app name

Example: ```json { "name": "dify_list_apps", "arguments": { "mode": "workflow", "limit": 10 } } ```

dify_create_app

Create a new application.

Parameters:

  • name (string): Application name
  • mode (string): Application mode (chat, workflow, agent-chat, completion)
  • description (string, optional): Application description
  • icon (string, optional): Icon emoji

Example: ```json { "name": "dify_create_app", "arguments": { "name": "My Workflow", "mode": "workflow", "description": "Automated workflow for data processing" } } ```

dify_export_app

Export application to YAML format.

Parameters:

  • app_id (string): Application ID
  • include_secret (boolean): Include API secrets (default: false)

dify_import_app

Import application from YAML.

Parameters:

  • mode (string): Import mode (yaml_content or yaml_url)
  • yaml_content (string): YAML content (for yaml_content mode)
  • yaml_url (string): YAML file URL (for yaml_url mode)
  • name (string, optional): Application name
  • description (string, optional): Application description

Workflow Management

dify_get_draft_workflow

Get the draft version of a workflow.

Parameters:

  • app_id (string): Application ID

dify_sync_workflow

Update the draft workflow.

Parameters:

  • app_id (string): Application ID
  • graph (object): Workflow graph with nodes and edges
  • features (object): Workflow features

dify_publish_workflow

Publish the draft workflow.

Parameters:

  • app_id (string): Application ID

dify_run_draft_workflow

Test run the draft workflow.

Parameters:

  • app_id (string): Application ID
  • inputs (object): Input parameters

Usage Examples

Example 1: List all workflow apps

``` Ask Claude: "List all my Dify workflow applications" ```

Claude will use dify_list_apps with mode: "workflow".

Example 2: Create a new workflow

``` Ask Claude: "Create a new Dify workflow named 'Data Processor'" ```

Claude will use dify_create_app with the workflow mode.

Example 3: Export and backup an app

``` Ask Claude: "Export my 'Invoice Processing' Dify app to YAML" ```

Claude will:

  1. Find the app using dify_list_apps
  2. Export it using dify_export_app

Example 4: Duplicate a workflow

``` Ask Claude: "Copy the 'Data Processor' workflow and name it 'Data Processor v2'" ```

Claude will use dify_copy_app with the new name.

Architecture

``` dify-management-mcp-server/ ├── src/ │ ├── index.ts # MCP server main entry │ ├── client.ts # Dify Console API client │ ├── tools.ts # Tool definitions │ └── types.ts # TypeScript types ├── dist/ # Compiled JavaScript ├── package.json ├── tsconfig.json └── README.md ```

API Reference

This server uses the Dify Console API which requires admin authentication. All endpoints are under /console/api/.

Base URL

{DIFY_CONSOLE_URL}/console/api

Authentication

  • Cookie: console_token=<token>
  • Or Authorization header: Bearer <token>

Troubleshooting

"Missing required environment variables"

  • Ensure DIFY_CONSOLE_URL and DIFY_CONSOLE_TOKEN are set
  • For existing Dify setups, you can use DIFY_API_URL and DIFY_API_KEY as alternatives

"Unauthorized" or "Invalid token"

  • Token may have expired
  • Re-obtain the console token from browser
  • Ensure the token has proper permissions

"Application not found"

  • Verify the app_id is correct
  • Check if you have access to the application

Development

Building

```bash npm run build ```

Development mode (watch)

```bash npm run dev ```

License

MIT

Contributing

Contributions welcome! This is an open-source project to help the Dify community.

Support

For issues and feature requests, please open an issue on GitHub.


Note: This MCP server provides full administrative access to your Dify instance. Keep your console token secure and only use it in trusted environments.