> ## Documentation Index
> Fetch the complete documentation index at: https://linkly.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Linkly AI in Dify

> Integrate your Linkly AI local knowledge base with the Dify AI application development platform to enhance document retrieval capabilities in AI applications

## What You Can Do

> [accordion] Build a Q\&A bot based on private documents
>
> No need to upload documents to Dify. By connecting Linkly AI via MCP, let Dify's Agent use the `search` tool to retrieve documents stored on your computer in real time — quickly build an internal knowledge Q\&A assistant for your team.

> [accordion] Local knowledge base as a dynamic data source — always up to date
>
> Unlike Dify's built-in vector knowledge base, Linkly AI reads local files directly. Documents are updated without needing to re-index, and the Agent retrieves the latest content every time — always in sync with your computer.

> [accordion] Combine three tools to build multi-level document processing applications
>
> Use Dify's visual interface to chain together Linkly AI's `search` (retrieval), `outline` (outline), and `read` (close reading) tools to quickly build well-structured document summary, Q\&A, or content extraction application prototypes.

## Prerequisites

* [Dify](https://dify.ai) installed and running
* Linkly AI Desktop running with the MCP service active

## Configuration Steps

Choose the appropriate access mode based on where your Dify is deployed:

> [tab] Same computer
>
> When Dify and Linkly AI are running on the same computer, use the local address directly:
>
> Add an MCP tool in Dify and configure:
>
> * URL: `http://127.0.0.1:60606/mcp`
>
> * No additional authentication required
>
> > [!TIP]
> >
> > If Dify is running in a Docker container, `127.0.0.1` points to the container itself. You need to use the host machine IP or `host.docker.internal` to access the local Linkly AI.

> [tab] LAN
>
> When Dify is running on another device on the LAN:
>
> 1. In the Linkly AI Desktop main window, turn on **Allow LAN access** on the **Agent usage** page
> 2. Click **View MCP connection settings** and copy the address and access token from the **LAN** section
> 3. Add an MCP tool in Dify and configure:
>    * URL: `http://192.168.x.x:60606/mcp` (use your actual LAN IP)
>    * Header: `Authorization: Bearer <your access token>`

> [tab] Cloud
>
> When Dify is deployed in the cloud (such as Dify Cloud):
>
> 1. Complete [remote access configuration](https://linkly.ai/docs/en/use-in-remote.md)
>
> 2. In Dify, open **Tools → MCP → Add MCP Server (HTTP)** and configure:
>    * Server URL: `https://mcp.linkly.ai/mcp`
>    * Name and server identifier: for example `linkly-ai` (apps reference the identifier, so don't change it later)
>    * Authentication: keep dynamic client registration on; no Client ID or headers needed
>
> 3. After you save, Dify opens the linkly.ai authorization page. Sign in, check that it says it will redirect to your Dify address, then click **Allow**
>
> > [!NOTE]
> >
> > Requires Dify 1.6.0 or later. For self-hosted Dify, set `CONSOLE_API_URL` to an address your browser can reach, or authorization can't return to Dify. To stop using it later, revoke it under **Authorized apps** on the [Security page of the dashboard](https://linkly.ai/dashboard/security).

## Application Examples

Once configured, you can build various AI applications in Dify using the document retrieval capabilities provided by Linkly AI, for example:

* A Q\&A bot based on private documents
* A document summary generator
* An intelligent document search assistant

## FAQ

> [accordion] Dify cannot connect to Linkly AI
>
> Check based on your deployment method: - **Same computer**: Confirm that the Linkly AI MCP service is running. If Dify is in Docker, use `host.docker.internal` instead of `127.0.0.1` - **LAN**: Confirm that LAN access is enabled and the access token is correct - **Cloud**: Confirm the tunnel is connected and the MCP server is authorized


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.