Skip to main content
Codex is OpenAI’s AI coding agent. When connected to Nekt through the MCP Server, it can query and analyze your data directly from the CLI. The connection uses bearer token authentication via an environment variable.
Requires a paid Nekt plan (for MCP Server access) and the Codex CLI installed (codex command available).

1. Activate your MCP Server

The connection is made by activating the MCP Server in your workspace. Check this guide for instructions.

2. Get your endpoint and token

In Nekt, click MCP in the top-right corner of the header, then Manage MCP Gateway. You’ll need two values:
  • Endpoint: the MCP server URL displayed at the top of the page
  • Token: a bearer token created in the Access tokens section
If you don’t have a token yet, create one, choosing Full access or Custom scope.
Tokens can be scoped per resource type (tables, volumes, secrets, context layer, and live connections) and per tool. Picking individual resources requires the Growth or Custom plan. See Permissions.

3. Connect Codex to Nekt

1

Set your token as an environment variable

Export the token in your current shell session:
To persist it across sessions, add it to your shell profile:
2

Add the Nekt MCP server

You can register the MCP server using the CLI or by editing the configuration file directly.Option A: Using the CLI
Option B: Editing the configuration fileOpen ~/.codex/config.toml and add the following block:
3

Verify the connection

Confirm the server was registered correctly:
The server nekt should appear as enabled, with the URL https://mcp.nekt.com/mcp and auth mode showing bearer token via env var.You can also ask Codex to list the available Nekt tools to confirm the connection is working. You should see the tools provided by the Nekt MCP Server. You can learn more about them here.
The OAuth login flow (codex mcp login nekt) is not supported for Nekt. Use bearer token authentication as described above.

4. Explore your data

Once connected, ask Codex a question about your data. For example:
Codex will use the MCP tools to query your data and return an answer.
We’d love to know what you’re building with Nekt! Share your projects with us through any of our communication channels.

Privacy & Security

Your data privacy is a core principle of the Nekt platform. When you connect Codex to Nekt through the MCP Server, Codex does not receive direct database credentials or unrestricted access to your infrastructure. Instead, Codex interacts with your data exclusively through the secure tools exposed by the Nekt MCP Server, which act as a controlled gateway to the Nekt API. These tools enforce the same authentication, authorization, and permission rules used throughout the Nekt platform. A full access token can do everything its user can, including writes. Use a scoped token to limit the tools and data Codex can reach. Every request is recorded in the token access log (7 days on Starter, 30 on Growth, 90 on Custom; not available on Free). When using Codex, your interactions are subject to OpenAI’s privacy settings and policies. We recommend reviewing the official OpenAI privacy documentation to understand their data handling policies and selecting the configuration that best aligns with your organization’s security requirements.

Need help?

Contact our support team if you encounter issues during setup.