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

# Integrate with AI Assistants via MCP

> Learn how to use Linkly AI MCP for greater flexibility and a more technical experience.

## Introduction to MCP

MCP (Model Context Protocol) is an open protocol that enables AI assistants to call external tools to obtain contextual information. Linkly AI Desktop has a built-in MCP service that starts automatically upon installation — no additional configuration required.

You only need to add Linkly AI's MCP endpoint to your AI assistant, and the AI can directly search, browse, and read your local documents.

## Three Access Modes

Linkly AI provides three MCP access modes for different scenarios:

> [card] Local Access
>
> Use directly in local AI tools on your machine — no extra configuration needed. Suitable for Claude Code, Cursor, and other local applications.
>
> Endpoint: `http://127.0.0.1:60606/mcp`

> [card] LAN Access
>
> Other devices on the same network can also connect. Requires enabling LAN access and using an access token.
>
> Endpoint: `http://{LAN IP}:60606/mcp`

> [card] [Remote Access (Public)](https://linkly.ai/docs/en/use-in-remote.md)
>
> Remotely access over the public internet via a tunnel. Suitable for online AI applications like ChatGPT and Claude.ai. **Pro only**.
>
> Endpoint: `https://mcp.linkly.ai/mcp`

This page covers configuration for local access and LAN access, both of which are free. For remote access (public internet), see the [Remote Access Guide](https://linkly.ai/docs/en/use-in-remote.md) — that one is Pro only. If all you want is for a cloud AI to read one particular set of material, the free [Cloud Library](https://linkly.ai/docs/en/use-cloud-library.md) is usually the better fit; the [Integration Overview](https://linkly.ai/docs/en/integration.md) compares all the paths.

> [card] HTTP MCP (Recommended)
>
> Most AI assistants support the HTTP transport protocol. Connect directly to Linkly AI's MCP endpoint without installing the CLI

> [card] Stdio MCP
>
> Some AI assistants only support the stdio transport protocol and require Linkly AI CLI as a bridge

> [!TIP]
>
> If you're not sure which method to choose, go with HTTP MCP. You only need the Stdio method when your AI assistant explicitly does not support HTTP transport.

## Prerequisites

**1. Install and launch Linkly AI Desktop**

Go to [linkly.ai](https://linkly.ai/#download) to download and install the desktop application. After the first launch, complete the initialization wizard, and the app will automatically begin indexing your documents.

**2. Confirm MCP service is running**

Linkly AI Desktop automatically runs the MCP service upon startup. Click the Agent icon at the bottom of the main window's left sidebar to open the **Agent usage** page:

* The **Allow local access** row under **Management** shows whether the service is running;
* **View MCP connection settings** in the **Integration** section has the actual address and port number.

Default MCP endpoint: `http://127.0.0.1:60606/mcp`

> [!NOTE]
>
> If you choose the Stdio MCP method, you also need to [install Linkly AI CLI](https://linkly.ai/docs/en/use-cli.md).

## Usage

### HTTP MCP (Recommended)

For AI assistants that support HTTP/StreamableHTTP transport protocol. No CLI installation needed — connect directly.

> [tab] Claude Code
>
> Run in your terminal:
>
> ```bash theme={null}
> claude mcp add --transport http linkly-ai "http://127.0.0.1:60606/mcp?client=claude-code"
> ```

> [tab] Cursor
>
> 1. Open Settings → MCP Servers → Add Server
> 2. Name: `linkly-ai`
> 3. Type: `StreamableHTTP`
> 4. URL: `http://127.0.0.1:60606/mcp?client=cursor`

> [tab] Codex
>
> Run in your terminal:
>
> ```bash theme={null}
> codex mcp add linkly-ai --url "http://127.0.0.1:60606/mcp?client=codex"
> ```

> [tab] Cherry Studio
>
> 1. Open Settings → MCP Servers → Add
> 2. Name: `linkly-ai`
> 3. Type: `StreamableHTTP`
> 4. URL: `http://127.0.0.1:60606/mcp?client=cherry-studio`

The trailing `?client=` in the URL is optional. If you include it, the access log on the **Agent usage** page can tell which client is calling.

> [!TIP]
>
> `60606` is the default port for the MCP service. If you cannot connect, click **View MCP connection settings** on the **Agent usage** page to see the actual address and port number.

### Stdio MCP

For AI assistants that support the stdio transport protocol. You need to [install Linkly AI CLI](https://linkly.ai/docs/en/use-cli.md#installation) first, then configure `linkly mcp` as the stdio bridge command in your AI assistant.

`linkly mcp` automatically picks up the name the client reports when it connects and writes it into the desktop app's access log; the `--client` option in the examples below sets a fixed name that overrides the detected one.

> [tab] Claude Code
>
> Run in your terminal:
>
> ```bash theme={null}
> claude mcp add linkly-ai -- linkly mcp --client claude-code
> ```

> [tab] Codex
>
> Run in your terminal:
>
> ```bash theme={null}
> codex mcp add linkly-ai -- linkly mcp --client codex
> ```

> [tab] Cherry Studio
>
> 1. Open Settings → MCP Servers → Add
> 2. Name: `linkly-ai`
> 3. Type: `stdio`
> 4. Command: `linkly`
> 5. Args: `mcp`, `--client`, `cherry-studio` (one per line)

> [tab] Other AI Assistants
>
> For other AI assistants that support stdio MCP, configure the following as the MCP server:
>
> * Command: `linkly`
> * Args: `mcp`
>
> The CLI will automatically discover the locally running Linkly AI Desktop and establish a connection.

### LAN Access

If you need to access Linkly AI from another device on the same network (such as another computer or n8n running on a NAS), you can enable LAN access mode.

**1. Enable LAN access**

Click the Agent icon at the bottom of the Linkly AI Desktop main window's left sidebar to open the **Agent usage** page, and turn on **Allow LAN access** under **Management**. **Allow local access** must stay on too, or this switch can't be turned on.

The first time you turn it on, the app generates an access token automatically.

**2. Get the LAN address and access token**

Click **View MCP connection settings** in the **Integration** section; the **LAN** part of the dialog lists:

* **Address**: similar to `http://192.168.x.x:60606/mcp`, ready to copy
* **Token**: hidden by default — click the eye icon to show it, or just click the copy button

This part also has a JSON config; replace `<token>` and `your-app-name` in it with the actual values and you can use it on the device you want to connect from.

After regenerating the token, every LAN client already set up has to switch to the new token.

**3. Configure on other devices**

When adding an MCP server in the AI tool on the other device, use the LAN address as the endpoint and include the access token in the request header:

```
Authorization: Bearer <your access token>
```

LAN access requires an AI tool that supports HTTP transport. The stdio bridge (`linkly mcp`) only connects to the desktop app on this machine and does not support LAN.

Fill in this configuration yourself. **Don't paste the access token into any AI conversation**, and don't let an AI assistant configure it for you: conversations are sent to the model provider and kept in the chat history. If the token has already appeared in a conversation, regenerate it under **View MCP connection settings**.

If you are using Linkly AI CLI, save the LAN address and access token once in your own terminal, then just add `--lan`:

```bash theme={null}
linkly auth set-key <your access token> --lan --endpoint http://192.168.x.x:60606
linkly search "keyword" --lan
```

> [!WARNING]
>
> LAN access uses plaintext HTTP transmission and is only recommended on trusted networks such as your home network. Do not enable this feature on public Wi-Fi or untrusted network environments.

### Reload after configuring

Once the MCP config is written, **the new tools will not show up in the conversation you already have open** — the vast majority of AI clients read the tool list once, at the moment the session starts. This is the client's loading mechanism, not a configuration error.

Two options; try the first one first:

1. **Start a new conversation** (for command-line tools, quit and open a new session). A conversation that is already running keeps the tool list it started with; a new one picks up the latest.
2. **Quit the client completely, then reopen it.** Use this when the first option doesn't help — and note that closing the window is not quitting: on macOS press `Cmd + Q` or choose Quit from the menu bar, on Windows check that it also exited from the tray.

Once you've reloaded, come back to the verification step below. If nothing is missing and only one particular tool won't work, see *When a newly shipped tool doesn't show up* further down.

### Verify Integration

After configuration, you can send the following prompt in your AI assistant to verify:

Search my documents for content about XX

Search my documents for content about project management

If the integration is successful, the AI assistant will call Linkly AI's `search` tool and return relevant results from your local documents.

### When a newly shipped tool doesn't show up

We ship new MCP tools from time to time. Most AI clients fetch the tool list once, at the moment the session starts, and never refresh it on their own, so a newly shipped tool simply will not appear until the client fetches the list again.

If a tool documented here is missing from your client:

1. Refresh the connection in your client — in ChatGPT: **Settings → Connectors → your connector → Refresh**.
2. If it still doesn't appear, remove the connection and add it again.
3. Start a new conversation. A conversation that is already running keeps the tool list it started with.

### Use with Skills

We strongly recommend [installing Linkly AI Skills](https://linkly.ai/docs/en/use-skills.md) alongside MCP configuration. Skills teach the AI assistant how to efficiently use Linkly AI's tools, including when to search, when to browse outlines, when to read full text, and how to handle paginated reading of long documents.

Please install the Agent Skill linkly-ai-skills and complete the LinklyAI tool integration...

Please install the Agent Skill linkly-ai-skills and complete the LinklyAI tool integration, refer to: [https://linkly.ai/docs/en/use-skills](https://linkly.ai/docs/en/use-skills.md)

## Hiding sensitive information

When what an agent reads contains keys, passwords, recovery codes or other sensitive information, Linkly AI can replace it with `[REDACTED:<type>]` markers, according to your settings. There are two layers, each set up separately:

* **Desktop app**: when an agent reads files on your computer, the desktop app hides sensitive information before handing the results over; titles and paths stay as they are. Click the shield icon at the bottom of the main window's left sidebar to open the **Privacy data protection** page, then set it up in the **Auto-hide sensitive data** section on the **Settings** tab.
* **Web**: results of remote access and of cloud libraries pass through the cloud gateway, which hides them once more according to **Hide sensitive information for remote access** on the [Security page of the dashboard](https://linkly.ai/dashboard/security).

### The desktop layer

Under **What is protected**, there is one switch for each place an agent connects from:

| Switch | Default | Description |
| - | - | - |
| Local | Hidden | Agents on this computer reading through MCP or the Linkly AI CLI |
| LAN | Hidden | Other devices on the same Wi-Fi |
| Remote | Hidden | Access over the internet |
| Built-in chat | Hidden | The [Chatbot](https://linkly.ai/docs/en/use-chatbot.md). What it reads is sent to the AI model; you can turn this off with a local model |

* Next to each switch is its current state: **Protected**, **Not hiding** or **Hiding paused**. Turning off any of them asks you to confirm first.
* **Seeing the original for a while**: on the **Overview** tab, click **Pause 10 min**, and all four switches stop hiding for that long. A pause only affects the desktop layer; for remote access the web layer keeps hiding. While paused, the time left shows on the **Overview** tab, in this section and in the tray menu. Click **Resume** to end it early; it also ends when the time is up or when you restart the app.
* **What to hide**: in the same section, **Hidden when agents read files** has one switch per kind of information, applied to every switch above that is set to hide. Keys and tokens, passwords, recovery codes and seed phrases, bank card numbers and ID numbers are hidden by default; phone numbers and email addresses aren't, since agents often need them to look up contacts or sort through résumés.
* **Folders left as they are**: in the same place, **Folders shown as they are** suits material that is easily mistaken for secrets, such as sample code and technical docs.
* **Notes**: markers in notes carry line numbers, such as `[REDACTED:github-pat L7]`. As long as an agent editing a note leaves the marker where it is, saving restores the original text instead of overwriting it.
* **How much was hidden**: on the **Log** tab of the **Agent usage** page, each call shows how many sensitive values were hidden; hover over it to see them by kind.

### How the two layers work together

| What is read | Who reads it | Decided by |
| - | - | - |
| Files on your computer | Local and LAN agents | The desktop app's **Local** and **LAN** switches |
| Files on your computer | Built-in chat | The desktop app's **Built-in chat** switch |
| Files on your computer | Remote agents | The desktop app's **Remote** switch and the web switch: the original is visible only when both are off |
| Your own cloud libraries | Remote agents, built-in chat | The web switch |
| Cloud libraries others share with you | Anyone | Always hidden |

* The switches for each kind of information and the folders left as they are belong to the desktop layer only. When a remote agent reads files on your computer, the gateway still hides what it recognizes as long as the web switch is on; only phone numbers and email addresses are not hidden by the gateway.
* For a remote agent to see the original text of files on your computer, turn the web switch off and also pause or turn off **Remote** in the desktop app. The desktop app doesn't show the state of the web switch; check it on the Security page of the dashboard.
* The web switch doesn't tell files on your computer apart from cloud libraries: while it's on, the gateway hides every remote result. So you can't let remote agents see the original of files on your computer while still hiding cloud libraries.

> [!NOTE]
>
> Hiding lowers the risk of leaks but isn't foolproof: it only recognizes common formats. Keep your most important material out of the index with [exclusion rules](https://linkly.ai/docs/en/index-scope.md#exclusion-rules); files whose names look like passwords or keys are left out of the index by default, see [Password-like files](https://linkly.ai/docs/en/index-scope.md#password-like-files).

## Parameter Reference

The MCP service exposes nine tools (eleven on the cloud gateway, which adds `library_search` and `library_link`), forming a progressive document access workflow:

* `search` — hybrid retrieval (BM25 + vector), the main entry point; also matches your own clip annotations (`scope: "annotations"` searches only those)
* `outline` — document outlines
* `grep` — regex matching within a single document
* `read` — line-based document reading; a clip's highlights, notes and comments follow the first page (`annotations_offset` pages through them)
* `list_libraries` — list available knowledge libraries
* `explore` — bird's-eye overview of a document collection
* `find_paths` — locate folder paths by keyword to feed `search`'s `path_glob`
* `list` — list the entries inside a container: a disk directory (`folder`), a library (`library`), or your notes (`notes`)
* `note_save` — create or edit a note, **writes** (the only writer on a local connection)
* `library_search` — search the cloud library catalog, including libraries not linked yet (cloud gateway only)
* `library_link` — link a cloud library so it becomes searchable, or unlink one you named with `action: "unlink"` (cloud gateway only, **writes**)

Every tool except `note_save` (and `library_link` on the cloud gateway) is read-only and will never modify your documents. Keys, passwords and other sensitive information in what agents read are hidden by default — see [Hiding sensitive information](#hiding-sensitive-information).

Every successful response carries a UTC timestamp: a trailing `[meta] now=...` line in Markdown output, or a top-level `_meta.now` field in JSON output, useful for computing relative dates such as "last month". Error responses do not include this metadata.

For full parameter tables, response fields, response metadata format, and usage examples, see [Linkly AI MCP Tools Introduction](https://linkly.ai/docs/en/tools-intro.md).


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