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

> Connect your Linkly AI local knowledge base to Kimi Code CLI, letting the Kimi agent search and read your private documents

## What You Can Do

<AccordionGroup>
  <Accordion title="Answer questions from your own materials, not the model's memory">
    Kimi Code calls Linkly AI's `search` tool to find the relevant documents on
    your computer, then `read` to pull in the exact sections — so the answer is
    grounded in your notes, specs, and reports instead of general knowledge.
  </Accordion>

  <Accordion title="Go from search to outline to full text, layer by layer">
    Use `search` to locate candidates, `outline` to see a long document's
    structure, and `read` to page through only the sections that matter. Long
    reports get handled without flooding the context window.
  </Accordion>

  <Accordion title="Scope it per project or share it everywhere">
    Configure Linkly AI once at the user level and every project inherits it, or
    drop a project-level config into a specific repository. Same-named entries
    at the project level override the user level.
  </Accordion>
</AccordionGroup>

## Prerequisites

* [Kimi Code CLI](https://www.kimi.com/code) installed (requires Node.js 22.19.0
  or later)
* Linkly AI Desktop running with the MCP service active

<Note>
  This guide covers **Kimi Code CLI**. The Kimi Work desktop app currently
  offers only a curated plugin center and has no entry point for adding your own
  MCP servers, so Linkly AI cannot be connected there yet.
</Note>

## Configuration Steps

Kimi Code reads MCP servers from `mcp.json`:

* User scope: `~/.kimi-code/mcp.json`
* Project scope: `.kimi-code/mcp.json` in your project root

<Tabs>
  <Tab title="Local MCP HTTP (Recommended)" icon="globe">
    Add the following to `~/.kimi-code/mcp.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "linkly-ai": {
          "url": "http://127.0.0.1:60606/mcp"
        }
      }
    }
    ```

    An entry with a `url` field and no `transport` is treated as an HTTP server.
  </Tab>

  <Tab title="Remote MCP" icon="cloud">
    Complete [remote access configuration](/docs/en/use-in-remote) first, with the
    desktop tunnel showing <Badge stroke color="green">● Connected</Badge>.

    Add the following to `~/.kimi-code/mcp.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "linkly-ai": {
          "url": "https://mcp.linkly.ai/mcp",
          "headers": {
            "Authorization": "Bearer <your API Key>"
          }
        }
      }
    }
    ```

    Your API Key is created on the
    [Linkly AI dashboard](https://linkly.ai/dashboard/integrations) and starts
    with `lkai_`.
  </Tab>

  <Tab title="CLI Stdio (Fallback)" icon="terminal">
    [Install Linkly AI CLI](/docs/en/use-cli) first, then add the following to
    `~/.kimi-code/mcp.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "linkly-ai": {
          "command": "linkly",
          "args": ["mcp"]
        }
      }
    }
    ```

    An entry with a `command` field is treated as a stdio server.
  </Tab>
</Tabs>

<Tip>
  You can also run `/mcp-config` inside the Kimi Code TUI to add, edit, or
  delete servers interactively instead of editing the JSON file by hand.
</Tip>

## Install Skills

Kimi Code scans `~/.agents/skills/` for Agent Skills, so you can install Linkly
AI Skills to teach the agent how to use these tools efficiently:

```bash theme={null}
git clone https://github.com/LinklyAI/linkly-ai-skills.git ~/.agents/skills/linkly-ai
```

Invoke it with `/skill:linkly-ai`. See [Using Skills](/docs/en/use-skills) for other
installation methods.

## Verify the Connection

Run `/mcp` in the Kimi Code TUI to check the connection status — `linkly-ai`
should be listed as connected along with its tools.

Then try a prompt:

```
Search my documents for content about project design
```

If configured correctly, Kimi Code will call Linkly AI's `search` tool and return
the results.

## FAQ

<AccordionGroup>
  <Accordion title="`kimi mcp add` reports an unknown command">
    That syntax belongs to the older `kimi-cli`, which is being phased out. Kimi
    Code CLI has no `mcp` subcommand — configure servers through `/mcp-config`
    in the TUI or by editing `mcp.json` directly.
  </Accordion>

  <Accordion title="HTTP method connection failed">
    Check whether Linkly AI Desktop is running and whether the MCP service is
    active. You can run `curl http://127.0.0.1:60606/mcp` in a terminal to test
    connectivity.
  </Accordion>

  <Accordion title="The server is listed but its tools never get called">
    Confirm the entry does not carry `"enabled": false`, and that no
    `disabledTools` list is filtering out the Linkly AI tools. Installing Linkly
    AI Skills also makes the agent far more likely to reach for these tools.
  </Accordion>

  <Accordion title="Stdio method says it cannot find the linkly command">
    Make sure you have [installed Linkly AI CLI](/docs/en/use-cli) and that the
    `linkly` command is available in your PATH. Verify with `linkly --version`.
  </Accordion>
</AccordionGroup>
