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

# Remote Access to Linkly AI

> Securely access your local knowledge base remotely from online AI applications like ChatGPT and Claude.ai using a public tunnel with Auth authentication

## What Is Remote Access

Linkly AI runs on your local machine, while online AI applications like ChatGPT and Claude.ai run in the cloud — they cannot directly access your local knowledge base MCP service.

The `Remote Access` feature works by establishing a secure tunnel between your desktop and the cloud, enabling public internet relay:

1. The desktop authenticates with an API Key and establishes a WebSocket tunnel connection to `mcp.linkly.ai`
2. After OAuth authorization, the online AI application sends MCP requests to `https://mcp.linkly.ai/mcp`
3. The cloud service forwards the requests through the tunnel to your desktop, which executes them and returns the results

Your document data always stays on your local machine. The tunnel only forwards MCP requests and responses — no document content is stored.

<Note>
  `mcp.linkly.ai` is a cloud MCP relay service maintained by Linkly AI
  officially. Data is transmitted anonymously through it, and Linkly AI only
  records usage counts for display purposes.
</Note>

## Configuration Steps

<Steps>
  <Step title="Register a Linkly AI account">
    Go to [linkly.ai](https://linkly.ai) to register and log in.
  </Step>

  <Step title="Generate an API Key">
    In the Dashboard under "API Key Management", click "New API Key" to generate a key starting with `lkai_`.

    <Warning>
      Keep your API Key safe and do not share it with others. A leaked key could be used to access your local knowledge base.
    </Warning>
  </Step>

  <Step title="Connect the tunnel in the desktop app">
    Open Linkly AI Desktop, go to **Settings → MCP**, and find the "Remote Access" section:

    1. Paste the generated key into the API Key input field
    2. Click the "Connect Public Tunnel" button
    3. Wait for the status to show <Badge stroke color="green">● Connected</Badge>
  </Step>

  <Step title="Add the MCP service in your AI application">
    In AI applications that support MCP (such as ChatGPT or Claude.ai), add the following MCP endpoint:

    ```
    https://mcp.linkly.ai/mcp
    ```

    The first time you add it, an OAuth authorization flow will be triggered. Follow the prompts to log in and authorize in your browser.

    For specific configuration instructions for each application, see the [integration documentation](/docs/en/integration/use-in-claude).
  </Step>
</Steps>

## OAuth Authorization Explained

When online AI applications like ChatGPT and Claude.ai connect to a remote MCP service for the first time, an OAuth 2.1 authorization flow is automatically triggered:

1. The AI application detects that the MCP endpoint requires authorization
2. It automatically redirects to the linkly.ai login page
3. After you log in and confirm authorization, the AI application receives an access token
4. Subsequent requests automatically carry the token — no need to re-authorize

<Tip>
  If you are already logged in to linkly.ai in your browser, the authorization
  process will be faster.
</Tip>

## Security Considerations

* **Protect your API Key**: Your API Key is equivalent to your tunnel credential — do not share it with others. If you suspect it has been compromised, revoke it in the Dashboard and generate a new one
* **HTTPS transmission**: The remote tunnel uses HTTPS/WSS encrypted transmission throughout to ensure data security
* **Revoke anytime**: You can disconnect the tunnel in the desktop app at any time. Revoking the API Key in the Dashboard will prevent new connections and reconnections, but won't immediately disconnect an already established tunnel session
* **Data never leaves your machine**: Your document data always stays on your local computer — the tunnel only forwards MCP tool call requests and responses

## FAQ

<AccordionGroup>
  <Accordion title="Error: 'API Key is invalid'">
    Please check:

    1. Whether the API Key was pasted in full (it should start with `lkai_`)
    2. Whether the API Key has been revoked in the Dashboard
    3. Try generating a new API Key in the Dashboard
  </Accordion>

  <Accordion title="Desktop is offline, remote calls return an error">
    The remote MCP service requires the desktop app to be running with the tunnel connected. If the desktop is closed or the tunnel is disconnected, remote calls will immediately return a 503 error.

    Please ensure:

    * Linkly AI Desktop is running
    * The MCP service is running (shown as Running in settings)
    * The tunnel status shows <Badge stroke color="green">● Connected</Badge>
  </Accordion>

  <Accordion title="Tunnel connection dropped">
    The tunnel has an automatic reconnection mechanism (up to 10 retries with exponential backoff). If disconnections occur frequently, check:

    * Whether your network connection is stable
    * Whether the API Key is still valid

    If disconnections persist, try manually disconnecting and reconnecting.
  </Accordion>

  <Accordion title="OAuth authorization failed">
    If authorization fails after adding MCP in ChatGPT or Claude.ai:

    1. Ensure the desktop tunnel is connected
    2. Try logging in to linkly.ai in your browser first
    3. Re-add the MCP server in the AI application

    If the issue persists, remove the already-added MCP server and add it again.
  </Accordion>
</AccordionGroup>
