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

> Integrate your Linkly AI local knowledge base with OpenAI Codex CLI, providing document search and reading capabilities to the command-line AI assistant

## Prerequisites

* [Codex CLI](https://github.com/openai/codex) installed
* Linkly AI Desktop running with the MCP service active

## Configuration Steps

<Tabs>
  <Tab title="MCP HTTP (Recommended)" icon="globe">
    Run in your terminal:

    ```bash theme={null}
    codex mcp add linkly-ai --url http://127.0.0.1:60606/mcp
    ```
  </Tab>

  <Tab title="MCP Stdio" icon="terminal">
    First [install Linkly AI CLI](/docs/en/use-cli), then run:

    ```bash theme={null}
    codex mcp add linkly-ai -- linkly mcp
    ```
  </Tab>

  <Tab title="CLI" icon="square-terminal">
    First [install Linkly AI CLI](/docs/en/use-cli). Once installed, Codex can directly call CLI commands to search and read your documents:

    ```bash theme={null}
    linkly search "keyword"
    linkly read <document-id>
    ```
  </Tab>
</Tabs>

<Tip>
  We recommend also installing [Linkly AI Skills](/docs/en/use-skills) to teach the
  AI assistant how to efficiently use Linkly AI's tools, improving search and
  reading efficiency.
</Tip>

## Verify the Connection

After adding, send the following prompt in Codex to verify:

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

If configured correctly, Codex will call Linkly AI's tools and return the search results.

## FAQ

<AccordionGroup>
  <Accordion title="Cannot connect to MCP service">
    Check whether Linkly AI Desktop is running and whether the MCP service is
    active. The default port is 60606, which you can confirm in Linkly AI
    settings.
  </Accordion>
</AccordionGroup>
