> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/explore-docs-with-ai/connect-to-mcp/set-up-codex.md).

# Connect Codex to Apryse docs

Bring Apryse SDK documentation into your Codex workflows.

This guide explains how to connect Codex CLI to a Model Context Protocol (MCP) server that exposes published [Apryse docs](https://docs.apryse.com/). After configuring the connection, Codex can access your documentation directly and use it to answer questions, retrieve information, and assist with documentation-related tasks.

### Prerequisites

Before you start, make sure to:

* Obtain an OpenAI account with access to Codex. See [OpenAI's licensing details](https://chatgpt.com/codex/pricing/).
* Install Codex CLI using the [get-started instructions](https://learn.chatgpt.com/docs/codex/cli#getting-started).
* [Sign in](https://learn.chatgpt.com/docs/codex/cli#getting-started) to Codex with your OpenAI account.

{% hint style="info" %}
**Info:** This guide uses the Codex CLI. Learn about [other ways](https://learn.chatgpt.com/docs/quickstart#where-to-use-chatgpt) to use Codex.
{% endhint %}

### 1. Add the MCP server

First, add the MCP server to Codex and verify the connection. See the [Codex MCP quickstart](https://learn.chatgpt.com/docs/extend/mcp?surface=cli) for more.

{% stepper %}
{% step %}
Open your terminal.
{% endstep %}

{% step %}
Add the MCP server:

{% tabs %}
{% tab title="Shell" %}
{% code overflow="wrap" %}

```shellscript
codex mcp add apryse-docs --url https://docs.apryse.com/~gitbook/mcp
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
Codex may ask you to approve MCP requests or commands. Review each request before allowing it. Some clients can save your approval preference for future requests.
{% endhint %}

* `apryse-docs` is the local name that Claude Code uses to identify the server.
* You can replace `apryse-docs` as you prefer. It doesn't need to match the site name.
* This server supports HTTP only. Don't use `stdio`. Configure with a `url` parameter and an HTTP endpoint.
  {% endstep %}

{% step %}
Launch Codex:

{% tabs %}
{% tab title="Shell" %}
{% code overflow="wrap" %}

```shellscript
codex
```

{% endcode %}
{% endtab %}
{% endtabs %}

If prompted, sign in and complete browser authentication. Subsequent launches typically open directly in your terminal.
{% endstep %}

{% step %}
Verify that the server was added successfully:

{% tabs %}
{% tab title="Shell" %}
{% code overflow="wrap" %}

```shellscript
codex mcp list
```

{% endcode %}
{% endtab %}
{% endtabs %}

Successful output:

{% tabs %}
{% tab title="Shell" %}
{% code overflow="wrap" %}

```shellscript
Configured MCP servers:

Name         URL                                                  Status
apryse-docs  https://docs.apryse.com/~gitbook/mcp                 enabled
```

{% endcode %}
{% endtab %}
{% endtabs %}
{% endstep %}
{% endstepper %}

### 2. Try a sample prompt

Ask Codex questions about the documentation content the MCP server exposes.

{% hint style="info" %}
**Info:** Codex may fall back to doing a web search. To prevent this, be explicit and ask it to use the `apryse-docs` MCP first and to disclose any web fallbacks.
{% endhint %}

{% prompt description="Build an implementation" icon="openai" defaultExpanded="partial" %}

```markdown
How do I use the Apryse Server SDK OCR module to extract text from scanned PDF documents?
```

{% endprompt %}

{% prompt description="Learn about a feature" icon="openai" defaultExpanded="partial" %}

```markdown
What annotation capabilities does Apryse WebViewer provide?
```

{% endprompt %}

{% prompt description="Build an implementation" icon="openai" defaultExpanded="partial" %}

```markdown
How do I enable Microsoft Office-to-PDF conversion using the Apryse Server SDK in a .NET application?
```

{% endprompt %}

### 3. Remove the MCP server

These steps are optional and remove the Apryse documentation MCP server.

{% stepper %}
{% step %}
Remove the configured MCP server:

{% tabs %}
{% tab title="Shell" %}
{% code overflow="wrap" %}

```shellscript
codex mcp remove apryse-docs
```

{% endcode %}
{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}
Remove the configured MCP server:

{% tabs %}
{% tab title="Shell" %}
{% code overflow="wrap" %}

```shellscript
codex mcp list
```

{% endcode %}
{% endtab %}
{% endtabs %}
{% endstep %}
{% endstepper %}

### Troubleshooting

<details>

<summary>Codex cannot find or connect to the MCP server.</summary>

* Verify that the HTTP endpoint URL for the MCP server is correct.
* Don't use `stdio` or `sse` transport types.
* Run `codex mcp list` to confirm the server is configured.
* If the server is missing, add it again using `codex mcp add`.
* Verify that the MCP server is running and reachable from your network.
* Check for firewall, VPN, or proxy restrictions.
* Don't use `stdio` or `sse` transport types.

</details>

<details>

<summary>Codex cannot access documentation content.</summary>

* Confirm that the documentation has been published.
* Complete any required authentication when prompted.
* Verify that your account has permission to access the MCP server.
* Verify that the MCP server provides access to the documentation content.

</details>

<details>

<summary>Codex doesn't return the expected results.</summary>

* Verify that the content exists in the documentation.
* Try a more specific prompt.
* Confirm that the MCP server indexes the content you are searching for.
* Verify that the MCP server is connected and available.

</details>

<details>

<summary>Codex prompts for approval repeatedly.</summary>

* Review and approve the requested action.
* If available, choose the option to remember your approval preference.
* Verify that your approval settings have not been reset.
* Restart Codex and try again.

</details>

### Next steps

Explore setup guides for other supported AI coding assistants:

* [Set up Claude Code](/explore-docs-with-ai/connect-to-mcp/set-up-claude-code.md)
* [Set up Cursor](/explore-docs-with-ai/connect-to-mcp/set-up-cursor.md)
* [Set up GitHub Copilot](/explore-docs-with-ai/connect-to-mcp/set-up-github-copilot.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/explore-docs-with-ai/connect-to-mcp/set-up-codex.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
