Skip to content
MCP server

Dify MCP

MCP server exposing Dify knowledge base retrieval to Cursor and other MCP clients

Runs locallyStatus and history
Install
Pricing
Open source
Runs
Locally
Version
0.1.0
Listing updated
4 days ago

About Dify MCP

Dify MCP is an open-source MCP server for knowledge and memory. It runs locally on your machine and is started by your AI client.

Install

Run in a terminal

claude mcp add dify-mcp --env DIFY_API_BASE='<DIFY_API_BASE>' --env DIFY_API_KEY='<DIFY_API_KEY>' --env DIFY_ALLOWED_DATASETS='<DIFY_ALLOWED_DATASETS>' -- uvx dify-mcp

Add to claude_desktop_config.json

{
  "mcpServers": {
    "dify-mcp": {
      "command": "uvx",
      "args": [
        "dify-mcp"
      ],
      "env": {
        "DIFY_API_BASE": "<DIFY_API_BASE>",
        "DIFY_API_KEY": "<DIFY_API_KEY>",
        "DIFY_ALLOWED_DATASETS": "<DIFY_ALLOWED_DATASETS>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "dify-mcp": {
      "command": "uvx",
      "args": [
        "dify-mcp"
      ],
      "env": {
        "DIFY_API_BASE": "<DIFY_API_BASE>",
        "DIFY_API_KEY": "<DIFY_API_KEY>",
        "DIFY_ALLOWED_DATASETS": "<DIFY_ALLOWED_DATASETS>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "dify-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "dify-mcp"
      ],
      "env": {
        "DIFY_API_BASE": "<DIFY_API_BASE>",
        "DIFY_API_KEY": "<DIFY_API_KEY>",
        "DIFY_ALLOWED_DATASETS": "<DIFY_ALLOWED_DATASETS>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "dify-mcp": {
      "command": "uvx",
      "args": [
        "dify-mcp"
      ],
      "env": {
        "DIFY_API_BASE": "<DIFY_API_BASE>",
        "DIFY_API_KEY": "<DIFY_API_KEY>",
        "DIFY_ALLOWED_DATASETS": "<DIFY_ALLOWED_DATASETS>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "dify-mcp": {
      "command": "uvx",
      "args": [
        "dify-mcp"
      ],
      "env": {
        "DIFY_API_BASE": "<DIFY_API_BASE>",
        "DIFY_API_KEY": "<DIFY_API_KEY>",
        "DIFY_ALLOWED_DATASETS": "<DIFY_ALLOWED_DATASETS>"
      }
    }
  }
}

Configuration

  • DIFY_API_BASEDify Knowledge API base URL, e.g. http://192.168.1.100/v1Required
  • DIFY_API_KEYDify Knowledge Base API keyRequired
  • DIFY_ALLOWED_DATASETSComma-separated dataset UUIDs to exposeRequired
  • DIFY_TIMEOUTHTTP timeout in seconds (default: 30)
  • DIFY_VERIFY_SSLVerify TLS certificates (default: false)

Pricing

Open source

Dify MCP FAQ

Is Dify MCP free?

Yes. Dify MCP is open source, so you can use and self-host it for free.

How do I add Dify MCP to Claude Code?

Run this command in your terminal: claude mcp add dify-mcp --env DIFY_API_BASE='<DIFY_API_BASE>' --env DIFY_API_KEY='<DIFY_API_KEY>' --env DIFY_ALLOWED_DATASETS='<DIFY_ALLOWED_DATASETS>' -- uvx dify-mcp

What are the best alternatives to Dify MCP?

The closest alternatives to Dify MCP are Codebase Memory, XERJ, Claude Code Ultimate Guide, Nautilus Compass Memory and note1.

Alternatives to Dify MCP

  1. Codebase Memory

    MCP server

    Local MCP server that builds a code knowledge graph for AI coding agents

    Runs locally
    • Open source
    • 48.7K GitHub stars
    • Knowledge and memory
  2. XERJ

    MCP server

    Local search engine for AI agents with cited answers over your code and docs

    Runs locally
    • Open source
    • 19.2K GitHub stars
    • Knowledge and memory
  3. MCP server for searching the Claude Code Ultimate Guide from any MCP client

    Runs locally
    • Open source
    • 6.5K GitHub stars
    • AI models and LLM tooling
  4. Local-first long-term memory layer for AI agents, served over MCP

    Not checked yet
    • 5 tools
    • Remote
    • Open source
    • 1.3K GitHub stars
    • Knowledge and memory
  5. note1

    MCP server

    MCP server giving AI assistants search and summaries across your note1 meetings

    • 4 tools
    • Remote
    • Free trial
    • 1 GitHub star
    • Productivity