Launch offer: the first 1,000 users get Settl free for a year* Claim your spot
settlbuilding in public

Dify's four-box PDF chatbot, plugged into Claude Code (the setup, the switch, the one line)

The short version

Dify is a drag-and-drop canvas for building AI apps: you put boxes on a screen, join them with lines, and get a chatbot or a workflow without writing code. It has 159,268 GitHub stars and is made by LangGenius; its founder and CEO is Luyu Zhang, whose stated goal is to "put this technology in everyone's hands, not just the most well-resourced corporations." Claude Code works for you; Dify builds a bot that other people (your customers) can talk to. This guide gives you the four-box setup that turns a PDF into that bot on Dify's free cloud, then the one switch and the one line that let Claude Code ask the same bot questions. Below: what to click, the exact line, the free plan's limits, what running it yourself takes, and the licence. Source: Dify's docs (https://docs.dify.ai), pricing page (https://dify.ai/pricing) and GitHub repo (https://github.com/langgenius/dify), checked 23 Oct 2026.

What The number
GitHub stars 159,268 (checked 23 Oct 2026)
Boxes on the canvas 4: User Input, Knowledge Retrieval, LLM, Answer
Code you write 0
Free plan 200 message credits (one-time), 5 apps, 50 Knowledge documents
Line that plugs it into Claude Code 1
Running it yourself Docker, 2 CPU cores, 4 GB RAM
Licence Dify's own licence: Apache 2.0 plus no multi-tenant hosting without a paid licence

First: what you need

Step 1: put your PDF into a Knowledge base

  1. In Dify, click Knowledge > Create > Create a ready-to-use knowledge base, and choose to upload a local file.
  2. Pick your PDF. Dify cuts it into small pieces ("chunks") so it can find the right passage later. The default chunk and search settings are fine for a first try.
  3. Wait until processing finishes. That's your bot's memory.

Step 2: drag the four boxes

  1. Go to Studio > Create from Blank and pick Chatflow (a chatbot built on the canvas). Give it a name, like "My Shop Help".
  2. Make the chain read like this, left to right (Dify's own docs name exactly these four):
    1. User Input: the customer's question comes in.
    2. Knowledge Retrieval: searches your Knowledge base for that question. Pick the Knowledge base from Step 1.
    3. LLM: the AI writes the reply. In its Context field, select the Knowledge Retrieval box's result, and in its instruction, use the Context variable, so it answers from your PDF. A simple instruction works: "Answer only from the context. If it isn't there, say you don't know."
    4. Answer: sends the reply back to the customer.
  3. Click Preview and ask it something your PDF covers, like "What's your refund policy?". In chatflows, Dify shows the passage it used (citations) by default.
  4. Click Publish > Publish Update. You now have a chat link you can share. If you change anything later, publish again, or the change won't go live.

Which AI writes the reply? On the free cloud, new accounts get a starter allowance of AI credits for some models, so you don't need your own key to try it (set it under the model provider settings if the LLM box asks for a model).

Step 3: switch on the plug for Claude Code

  1. In your app, open the Access Point tab and find the MCP Server card. It's off by default.
  2. Switch it on. Dify gives you a unique server address (a link). MCP is a plug standard that lets AI tools like Claude Code use outside tools; this link turns your bot into one.
  3. Copy the link.

Copy this: the one line

Open your Terminal in your project folder (on a Mac: Cmd + Space, type Terminal) and paste, putting your link in place of the last part:

claude mcp add --transport http my-shop-bot <your Dify MCP link>

What it does: it adds your Dify bot to Claude Code as a tool called my-shop-bot, for this project. Then:

  1. Start Claude Code (claude), type /mcp and check that my-shop-bot shows as connected.
  2. Ask in plain words: "Ask my-shop-bot what our refund policy is." Claude Code calls your bot, and the bot answers from your PDF.

Want it in every project, not just this one? Add --scope user after add.

To be plain about it: Dify's docs show this link being added to Claude Desktop and Cursor, not Claude Code. claude mcp add --transport http <name> <url> is Claude Code's standard way to add any such web (HTTP) MCP link, so the same link goes in this way.

The catch

For builders

Sources

Get the next one in your inbox