> ## 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

<AccordionGroup>
  <Accordion title="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>

  <Accordion title="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>

  <Accordion title="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.
  </Accordion>
</AccordionGroup>

## 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:

<Tabs>
  <Tab title="Same computer" icon="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.
    </Tip>
  </Tab>

  <Tab title="LAN" icon="wifi">
    When Dify is running on another device on the LAN:

    1. Enable "LAN Access" in Linkly AI Desktop
    2. Copy the LAN URL and access token
    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>

  <Tab title="Cloud" icon="globe">
    When Dify is deployed in the cloud (such as Dify Cloud):

    1. Complete [remote access configuration](/docs/en/use-in-remote)
    2. Add an MCP tool in Dify and configure:
       * URL: `https://mcp.linkly.ai/mcp`
       * Header: `Authorization: Bearer <your API Key>`
  </Tab>
</Tabs>

## 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

<AccordionGroup>
  <Accordion title="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 API Key is correct
  </Accordion>
</AccordionGroup>
