> ## Documentation Index
> Fetch the complete documentation index at: https://docs.unstructured.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Unstructured Foundation installation for the Codex CLI

> Learn how to install Unstructured Foundation into the Codex CLI. You can then use Foundation to give the Codex CLI persistent access to your organization's knowledge without file uploads.

<Note>
  Unstructured Foundation is an Early Access product. **Unstructured must accept you into the Early Access program
  before you can begin using Foundation.**
  [Add your name to the Early Access interest list](https://unstructured.io/foundation-early-access).

  Unstructured is currently accepting a limited number of participants into the Early Access program at its discretion, with
  plans to expand access to a more general audience in the future.

  The following information is being provided to give you an advance preview of possible future functionality. Unstructured
  makes no express claims as to what extent this information will reflect the state of the product upon initial
  general availability.
</Note>

## Requirements

Before you begin, you must have the following:

* Acceptance by Unstructured into its Early Access program for Foundation.
  [Add your name to the Early Access interest list](https://unstructured.io/foundation-early-access).
  Do not begin this installation until you have received your Early Access acceptance email from Unstructured.
* A ChatGPT plan. [Sign up for ChatGPT](https://www.chatgpt.com/signup).
* The Codex CLI installed on your local development machine. [Install the Codex CLI from your terminal](https://developers.openai.com/codex/cli).

## Set up Foundation

1. From your terminal, add the Foundation MCP server plugin marketplace:

   ```bash theme={null}
   codex plugin marketplace add Unstructured-IO/unstructured-foundation-marketplace
   ```

   If prompted, sign in to the Codex CLI.

2. Use the marketplace you just added to install the Foundation MCP server:

   ```bash theme={null}
   codex plugin add foundation@unstructured-foundation
   ```

3. Use the installed Foundation MCP server to sign in to Foundation. To do this, run the following command:

   ```bash theme={null}
   codex mcp login foundation
   ```

4. A web browser tab will appear, prompting you to authenticate with Foundation.
   Follow the on-screen instructions to finish authenticating.

## Connect to and index your source

1. From within a Codex CLI session in your terminal, prompt with the following:

   ```text theme={null}
   $foundation:connect
   ```

2. Click the link that appears in the response.

   If the link does not appear, go to the following link in your web browser instead:
   [https://foundation.unstructured.io/connect](https://foundation.unstructured.io/connect)

3. If prompted, sign in to Foundation.

4. The **Connect sources to use Foundation** page appears.

   <img src="https://mintcdn.com/unstructured-53/iuQ6ZYz4UZ1tXQhy/img/foundation/new-source.png?fit=max&auto=format&n=iuQ6ZYz4UZ1tXQhy&q=85&s=35a33d98e8c2b827c886451c93b9e8fa" alt="Connecting to a new source from the Codex CLI" width="986" height="1402" data-path="img/foundation/new-source.png" />

   If this page does not appear after you sign in to Foundation, click the **New Source** button to show a page with similar functionality.

5. Click one of the available sources, and then click **Connect**.

6. Follow the on-screen directions to finish connecting to your source.

7. View the source files' ingestion and indexing job's progress. To do this, on the sidebar, click **Summary**.

8. Wait until the source's tile displays **Fully indexed**.

9. You can now start using the Codex CLI to work with the generated index. For example, you can ask the Codex CLI questions such as the following:

   ```text theme={null}
   What is a summary of the kinds of information that are available in the Unstructured Foundation index about my sources?
   ```

   ```text theme={null}
   What are some examples of the kinds of questions I can ask the Unstructured Foundation index about my sources?
   ```

## Next steps

* To learn more about how to use Unstructured Foundation, enter the following prompt in the Codex CLI:

  `$foundation:help`

* [Manage your Foundation sources](/foundation/sources): Add, change, and remove sources from Foundation.

* [Foundation storage](/foundation/storage): Understand what artifacts that Foundation generates, indexes, and stores about your sources.

* [Troubleshoot Foundation](/foundation/troubleshooting): Solutions for common issues.

## Questions? Need help?

* For general questions about Unstructured products and pricing, email Unstructured Sales at [sales@unstructured.io](mailto:sales@unstructured.io).
* For technical support, [request support](/support/request).
